diff --git a/codepot/README b/codepot/README index 5d9ff164..eeb0d816 100644 --- a/codepot/README +++ b/codepot/README @@ -12,9 +12,8 @@ UPGRADING FROM 0.2.0 The code_hide_details column in the user_settings table has been renamed to code_hide_metadata. You must rename your existing database manually. - mysql> ALTER TABLE user_settings CHANGE code_hide_details code_hide_metadata char(1) NOT NULL; - oracle> ALTER TABLE user_settings RENAME COLUMN code_hide_details TO code_hide_metadata; - + mysql> ALTER TABLE user_settings CHANGE code_hide_details code_hide_metadata CHAR(1) NOT NULL; + mysql> ALTER TABLE site ADD COLUMN(summary VARCHAR(255) NOT NULL); INSTALLATION ON CENTOS diff --git a/codepot/etc/codepot.mysql b/codepot/etc/codepot.mysql index f4d02cc4..50ccde60 100644 --- a/codepot/etc/codepot.mysql +++ b/codepot/etc/codepot.mysql @@ -6,6 +6,7 @@ CREATE TABLE site ( id VARCHAR(32) PRIMARY KEY, name VARCHAR(128) NOT NULL, + summary VARCHAR(255) NOT NULL, text TEXT NOT NULL, createdon DATETIME NOT NULL, diff --git a/codepot/src/codepot/controllers/site.php b/codepot/src/codepot/controllers/site.php index 31e93ac9..2a917d08 100644 --- a/codepot/src/codepot/controllers/site.php +++ b/codepot/src/codepot/controllers/site.php @@ -148,7 +148,7 @@ class Site extends Controller $data['login'] = $login; - $site = $this->sites->get ($siteid); + $site = $this->sites->get ($siteid); if ($site === FALSE) { $data['login'] = $login; @@ -174,11 +174,13 @@ class Site extends Controller $data['login'] = $login; - // SET VALIDATION RULES + // SET VALIDATION RULES $this->form_validation->set_rules ( 'site_id', 'ID', 'required|alpha_dash|max_length[32]'); $this->form_validation->set_rules ( 'site_name', 'name', 'required|max_length[128]'); + $this->form_validation->set_rules ( + 'site_summary', 'summary', 'max_length[255]'); $this->form_validation->set_rules ( 'site_text', 'text', 'required'); $this->form_validation->set_error_delimiters( @@ -195,7 +197,9 @@ class Site extends Controller // recompose the site information from POST data. unset ($site); $site->id = $tmpid; + $site->name = $this->input->post('site_name'); + $site->summary = $this->input->post('site_summary'); $site->text = $this->input->post('site_text'); // validate the form @@ -257,6 +261,7 @@ class Site extends Controller { $site->id = $siteid; $site->name = ''; + $site->summary = ''; $site->text = ''; $this->_edit_site ($site, 'create', $login); diff --git a/codepot/src/codepot/models/sitemodel.php b/codepot/src/codepot/models/sitemodel.php index efd58f8d..0efc243f 100644 --- a/codepot/src/codepot/models/sitemodel.php +++ b/codepot/src/codepot/models/sitemodel.php @@ -12,6 +12,7 @@ class SiteModel extends Model { $site->id = CODEPOT_DEFAULT_SITE_LANGUAGE; $site->name = CODEPOT_DEFAULT_SITE_NAME; + $site->summary = ''; $site->text = ''; $site->updatedby = ''; $site->createdby = ''; @@ -63,6 +64,7 @@ class SiteModel extends Model $this->db->set ('id', $site->id); $this->db->set ('name', $site->name); + $this->db->set ('summary', $site->summary); $this->db->set ('text', $site->text); $this->db->set ('createdon', date('Y-m-d H:i:s')); $this->db->set ('createdby', $userid); @@ -88,6 +90,7 @@ class SiteModel extends Model $this->db->where ('id', $site->id); $this->db->set ('name', $site->name); + $this->db->set ('summary', $site->summary); $this->db->set ('text', $site->text); $this->db->set ('updatedon', date('Y-m-d H:i:s')); $this->db->set ('updatedby', $userid); diff --git a/codepot/src/codepot/views/projectbar.php b/codepot/src/codepot/views/projectbar.php index 24c98fe1..7942a823 100644 --- a/codepot/src/codepot/views/projectbar.php +++ b/codepot/src/codepot/views/projectbar.php @@ -16,7 +16,10 @@ function show_projectbar ($con, $banner, $page, $ctxmenuitems) if (isset($banner)) { - print htmlspecialchars($banner); + if (is_array($banner)) + print htmlspecialchars($banner[0]); + else + print htmlspecialchars($banner); } else if ($type == 'project') { @@ -46,15 +49,16 @@ function show_projectbar ($con, $banner, $page, $ctxmenuitems) print "