[geeklog-cvs] geeklog: Added support for textarea input fields in the Configur...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Jan 9 11:08:04 EST 2010


changeset 7588:5b6aaeaebe8a
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/5b6aaeaebe8a
user: Dirk Haun <dirk at haun-online.de>
date: Sat Jan 09 14:43:15 2010 +0100
description:
Added support for textarea input fields in the Configuration (feature request #0000905)

diffstat:

 public_html/admin/install/config-install.php                      |  6 +++---
 public_html/docs/history                                          |  2 ++
 public_html/layout/professional/admin/config/config_element.thtml |  8 ++++++++
 sql/updates/mssql_1.6.1_to_1.6.2.php                              |  5 +++++
 sql/updates/mysql_1.6.1_to_1.6.2.php                              |  5 +++++
 system/classes/config.class.php                                   |  4 +++-
 6 files changed, 26 insertions(+), 4 deletions(-)

diffs (100 lines):

diff -r ed9ed0df445d -r 5b6aaeaebe8a public_html/admin/install/config-install.php
--- a/public_html/admin/install/config-install.php	Wed Jan 06 22:54:46 2010 +0100
+++ b/public_html/admin/install/config-install.php	Sat Jan 09 14:43:15 2010 +0100
@@ -48,12 +48,12 @@
     $c->add('site_name','','text',0,0,NULL,60,TRUE);
     $c->add('site_slogan','','text',0,0,NULL,70,TRUE);
     $c->add('microsummary_short','GL: ','text',0,0,NULL,80,TRUE);
-    $c->add('site_disabled_msg','Geeklog Site is down. Please come back soon.','text',0,0,NULL,510,TRUE);
+    $c->add('site_disabled_msg','Geeklog Site is down. Please come back soon.','textarea',0,0,NULL,510,TRUE);
     $c->add('copyrightyear',date('Y'),'text',0,0,NULL,1440,FALSE);
     $c->add('url_rewrite',FALSE,'select',0,0,1,1800,TRUE);
     $c->add('meta_tags',0,'select',0,0,23,2000,TRUE);
-    $c->add('meta_description','Geeklog, the open source content management system designed with security in mind.','text',0,0,NULL,2010,TRUE);
-    $c->add('meta_keywords','Geeklog, Blog, Content Management System, CMS, Open Source, Security','text',0,0,NULL,2020,TRUE);
+    $c->add('meta_description','Geeklog, the open source content management system designed with security in mind.','textarea',0,0,NULL,2010,TRUE);
+    $c->add('meta_keywords','Geeklog, Blog, Content Management System, CMS, Open Source, Security','textarea',0,0,NULL,2020,TRUE);
 
     $c->add('fs_mail', NULL, 'fieldset', 0, 1, NULL, 0, TRUE);
     $c->add('site_mail','','text',0,1,NULL,40,TRUE);
diff -r ed9ed0df445d -r 5b6aaeaebe8a public_html/docs/history
--- a/public_html/docs/history	Wed Jan 06 22:54:46 2010 +0100
+++ b/public_html/docs/history	Sat Jan 09 14:43:15 2010 +0100
@@ -3,6 +3,8 @@
 ??? ??, 2010 (1.6.2)
 ------------
 
+- Added support for textarea input fields in the Configuration (feature request
+  #0000905) [Dirk]
 - Blocks could not contain words in curly braces as they were mistaken for
   template variables (bug #0001057) [Dirk]
 - Allow groups to be marked as a Default Group. New users will automatically be
diff -r ed9ed0df445d -r 5b6aaeaebe8a public_html/layout/professional/admin/config/config_element.thtml
--- a/public_html/layout/professional/admin/config/config_element.thtml	Wed Jan 06 22:54:46 2010 +0100
+++ b/public_html/layout/professional/admin/config/config_element.thtml	Sat Jan 09 14:43:15 2010 +0100
@@ -10,6 +10,14 @@
 </td></tr>
 <!-- END text-element -->
 
+<!-- BEGIN text-area -->
+<tr><td class="alignright">{display_name} {doc_link} {unset_link}</td>
+<td>
+<textarea class="opt" name="{name}" style="width:300px" cols="3">{value}</textarea>
+{delete}
+</td></tr>
+<!-- END text-area -->
+
 <!-- BEGIN placeholder-element -->
 <tr><td class="alignright">{display_name}</td><td>
 <input type="hidden" name="{name}" value="{value}"{xhtml}>
diff -r ed9ed0df445d -r 5b6aaeaebe8a sql/updates/mssql_1.6.1_to_1.6.2.php
--- a/sql/updates/mssql_1.6.1_to_1.6.2.php	Wed Jan 06 22:54:46 2010 +0100
+++ b/sql/updates/mssql_1.6.1_to_1.6.2.php	Sat Jan 09 14:43:15 2010 +0100
@@ -7,6 +7,11 @@
 // make $_CONF['default_perm_cookie_timeout'] option a dropdown
 $_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'select' WHERE name = 'default_perm_cookie_timeout' AND group_name = 'Core'";
 
+// change some config options to use a textarea instead of a one-line text field
+$_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'textarea' WHERE name = 'site_disabled_msg' AND group_name = 'Core'";
+$_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'textarea' WHERE name = 'meta_description' AND group_name = 'Core'";
+$_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'textarea' WHERE name = 'meta_keywords' AND group_name = 'Core'";
+
 // make room to store IPv6 addresses
 $_SQL[] = "ALTER TABLE {$_TABLES['comments']} ALTER COLUMN [ipaddress] varchar(39) NOT NULL";
 $_SQL[] = "ALTER TABLE {$_TABLES['commentsubmissions']} ALTER COLUMN [ipaddress] varchar(39) NOT NULL";
diff -r ed9ed0df445d -r 5b6aaeaebe8a sql/updates/mysql_1.6.1_to_1.6.2.php
--- a/sql/updates/mysql_1.6.1_to_1.6.2.php	Wed Jan 06 22:54:46 2010 +0100
+++ b/sql/updates/mysql_1.6.1_to_1.6.2.php	Sat Jan 09 14:43:15 2010 +0100
@@ -7,6 +7,11 @@
 // make $_CONF['default_perm_cookie_timeout'] option a dropdown
 $_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'select' WHERE name = 'default_perm_cookie_timeout' AND group_name = 'Core'";
 
+// change some config options to use a textarea instead of a one-line text field
+$_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'textarea' WHERE name = 'site_disabled_msg' AND group_name = 'Core'";
+$_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'textarea' WHERE name = 'meta_description' AND group_name = 'Core'";
+$_SQL[] = "UPDATE {$_TABLES['conf_values']} SET type = 'textarea' WHERE name = 'meta_keywords' AND group_name = 'Core'";
+
 // make room to store IPv6 addresses
 $_SQL[] = "ALTER TABLE {$_TABLES['comments']} CHANGE ipaddress ipaddress varchar(39) NOT NULL default ''";
 $_SQL[] = "ALTER TABLE {$_TABLES['commentsubmissions']} CHANGE ipaddress ipaddress varchar(39) NOT NULL default ''";
diff -r ed9ed0df445d -r 5b6aaeaebe8a system/classes/config.class.php
--- a/system/classes/config.class.php	Wed Jan 06 22:54:46 2010 +0100
+++ b/system/classes/config.class.php	Sat Jan 09 14:43:15 2010 +0100
@@ -621,7 +621,7 @@
 
         $blocks = array('delete-button', 'text-element', 'placeholder-element',
                         'select-element', 'list-element', 'unset-param',
-                        'keyed-add-button', 'unkeyed-add-button');
+                        'keyed-add-button', 'unkeyed-add-button', 'text-area');
         foreach ($blocks as $block) {
             $t->set_block('element', $block);
         }
@@ -677,6 +677,8 @@
             return $t->finish($t->parse('output', 'unset-param'));
         } elseif ($type == "text") {
             return $t->finish($t->parse('output', 'text-element'));
+        } elseif ($type == "textarea") {
+            return $t->finish($t->parse('output', 'text-area'));
         } elseif ($type == "placeholder") {
             return $t->finish($t->parse('output', 'placeholder-element'));
         } elseif ($type == 'select') {



More information about the geeklog-cvs mailing list