[geeklog-hg] geeklog: Updated Staticpages Plugin to Version 2.1.1. Now uses s...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Thu Feb 19 10:15:13 EST 2015


changeset 9580:b759c53774a3
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/b759c53774a3
user: Tom
date: Thu Feb 19 10:12:22 2015 -0500
description:
Updated Staticpages Plugin to Version 2.1.1. Now uses standardized template and css file location functions

diffstat:

 plugins/staticpages/autoinstall.php                               |    4 +-
 plugins/staticpages/functions.inc                                 |   44 +--
 plugins/staticpages/templates/admin/editor.thtml                  |  130 -------
 plugins/staticpages/templates/admin/editor_advanced.thtml         |  164 ----------
 plugins/staticpages/templates/centerblock.thtml                   |    7 -
 plugins/staticpages/templates/default/admin/editor.thtml          |  130 +++++++
 plugins/staticpages/templates/default/admin/editor_advanced.thtml |  164 ++++++++++
 plugins/staticpages/templates/default/centerblock.thtml           |    7 +
 plugins/staticpages/templates/default/printable.thtml             |   22 +
 plugins/staticpages/templates/default/spcomments.thtml            |    5 +
 plugins/staticpages/templates/default/staticpage.thtml            |   10 +
 plugins/staticpages/templates/printable.thtml                     |   22 -
 plugins/staticpages/templates/spcomments.thtml                    |    5 -
 plugins/staticpages/templates/staticpage.thtml                    |   10 -
 public_html/admin/plugins/staticpages/index.php                   |    3 +-
 15 files changed, 349 insertions(+), 378 deletions(-)

diffs (truncated from 840 to 300 lines):

diff -r f8652077694c -r b759c53774a3 plugins/staticpages/autoinstall.php
--- a/plugins/staticpages/autoinstall.php	Thu Feb 19 10:11:13 2015 -0500
+++ b/plugins/staticpages/autoinstall.php	Thu Feb 19 10:12:22 2015 -0500
@@ -51,8 +51,8 @@
     $info = array(
         'pi_name'         => $pi_name,
         'pi_display_name' => $pi_display_name,
-        'pi_version'      => '1.6.6',
-        'pi_gl_version'   => '2.1.0',
+        'pi_version'      => '1.6.7',
+        'pi_gl_version'   => '2.1.1',
         'pi_homepage'     => 'http://www.geeklog.net/'
     );
 
diff -r f8652077694c -r b759c53774a3 plugins/staticpages/functions.inc
--- a/plugins/staticpages/functions.inc	Thu Feb 19 10:11:13 2015 -0500
+++ b/plugins/staticpages/functions.inc	Thu Feb 19 10:12:22 2015 -0500
@@ -360,8 +360,7 @@
             $retval .= COM_showMessage($msg, 'staticpages');
         }
 
-        $template_path = staticpages_templatePath();
-        $spage = COM_newTemplate($template_path);
+        $spage = COM_newTemplate(CTL_plugin_templatePath('staticpages'));
         $spage->set_file(array('page'     => 'staticpage.thtml',
                                'comments' => 'spcomments.thtml'));
 
@@ -546,8 +545,7 @@
     global $_CONF, $_TABLES, $LANG01, $LANG_STATIC, $LANG_DIRECTION,
            $_IMAGE_TYPE;
 
-    $template_path = staticpages_templatePath();
-    $print = COM_newTemplate($template_path);
+    $print = COM_newTemplate(CTL_plugin_templatePath('staticpages'));
     $print->set_file(array('print' => 'printable.thtml'));
     $print->set_var('site_slogan', $_CONF['site_slogan']);
 
@@ -1091,8 +1089,7 @@
                 }
             }
 
-            $template_path = staticpages_templatePath();
-            $spage = COM_newTemplate($template_path);
+            $spage = COM_newTemplate(CTL_plugin_templatePath('staticpages'));
             $spage->set_file(array('page' => 'centerblock.thtml'));
 
             if (($S['sp_inblock'] == 1) && !empty ($S['sp_title'])
@@ -1519,7 +1516,11 @@
             SP_update_ConfValues_1_6_5();
 
             $current_version = '1.6.6';
-            break;             
+            break;  
+            
+        case '1.6.6':
+            $current_version = '1.6.7';
+            break;  
 
         default:
             $done = true;
@@ -1592,35 +1593,6 @@
     return $out;
 }
 
-/**
-* Get path for the template files.
-*
-* @param    string  $path   subdirectory within the base template path
-* @return   string          full path to template directory
-*
-*/
-function staticpages_templatePath ($path = '')
-{
-    global $_CONF;
-
-    if (empty ($path)) {
-        $layout_path = $_CONF['path_layout'] . 'staticpages';
-    } else {
-        $layout_path = $_CONF['path_layout'] . 'staticpages/' . $path;
-    }
-
-    if (is_dir ($layout_path)) {
-        $retval = $layout_path;
-    } else {
-        $retval = $_CONF['path'] . 'plugins/staticpages/templates';
-        if (!empty ($path)) {
-            $retval .= '/' . $path;
-        }
-    }
-
-    return $retval;
-}
-
 function plugin_getListField_staticpages($fieldname, $fieldvalue, $A, $icon_arr)
 {
     global $_CONF, $_TABLES, $LANG_ACCESS, $LANG_ADMIN, $LANG_STATIC;
diff -r f8652077694c -r b759c53774a3 plugins/staticpages/templates/admin/editor.thtml
--- a/plugins/staticpages/templates/admin/editor.thtml	Thu Feb 19 10:11:13 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-{# begin {templatelocation} #}
-
-  {start_block_editor}
-  <form action="{site_admin_url}/plugins/staticpages/index.php" method="post" id="sp-editor" class="compact">
-    <div class="admin_basic">
-      <dl class="form_block">
-        <dt><label for="sp-editor-sp_title">{lang_title}</label></dt>
-        <dd><input type="text" maxlength="128" {!if titletoid}onkeyup="TitleToId('sp-editor-sp_title','sp-editor-sp_id');" {!endif}name="sp_title" value="{sp_title}" id="sp-editor-sp_title" class="size5"{xhtml}></dd>
-
-        <dt><label for="sp-editor-sp_id">{lang_id}</label></dt>
-        <dd><input type="text" dir="ltr" name="sp_id" maxlength="128" value="{sp_id}" id="sp-editor-sp_id" class="size5"{xhtml}></dd>
-
-        <dt><label>{lang_url}</label></dt>
-        <dd><span class="break-word">{example_url}</span></dd>
-
-        <dt><label for="sp-editor-sp_page_title">{lang_page_title}</label></dt>
-        <dd><input type="text" maxlength="128" name="sp_page_title" value="{sp_page_title}" id="sp-editor-sp_page_title" class="size5"{xhtml}></dd>
-
-        <dt><label for="sp-editor-sp_onmenu">{lang_addtomenu}</label></dt>
-        <dd><input type="checkbox" name="sp_onmenu" id="sp-editor-sp_onmenu" {onmenu_checked}{xhtml}></dd>
-
-        <dt><label for="sp-editor-sp_label">{lang_label}</label></dt>
-        <dd><input type="text" name="sp_label" maxlength="64" value="{sp_label}" id="sp-editor-sp_label" class="size5"{xhtml}></dd>
-
-        <dt><label>{lang_topic}</label></dt>
-        <dd>{topic_selection}</dd>
-        
-        <dt><label for="sp-editor-sp_format">{lang_pageformat}</label></dt>
-        <dd><select name="sp_format" id="sp-editor-sp_format">
-              <option value="blankpage" {blankpage_selected}>{lang_blankpage}</option>
-              <option value="noblocks" {noblock_selected}>{lang_noblocks}</option>
-              <option value="leftblocks" {leftblocks_selected}>{lang_leftblocks}</option>
-              <option value="allblocks" {allblocks_selected}>{lang_leftrightblocks}</option>
-            </select></dd>
-
-        <dt><label for="sp-editor-commentcode">{lang_mode}</label></dt>
-        <dd><select name="commentcode" id="sp-editor-commentcode">
-              {comment_options}
-            </select></dd>
-
-        <dt{hide_meta}><label for="sp-editor-meta_description">{lang_metadescription}</label></dt>
-        <dd{hide_meta}><textarea name="meta_description" cols="45" rows="2" id="sp-editor-meta_description" class="wide">{meta_description}</textarea></dd>
-
-        <dt{hide_meta}><label for="sp-editor-meta_keywords">{lang_metakeywords}</label></dt>
-        <dd{hide_meta}><textarea name="meta_keywords" cols="45" rows="2" id="sp-editor-meta_keywords" class="wide">{meta_keywords}</textarea></dd>
-
-        <dt><label for="sp-editor-sp_content">{lang_content}</label></dt>
-        <dd><textarea name="sp_content" style="width:99.5%" cols="45" rows="24" id="sp-editor-sp_content" class="wide">{sp_content}</textarea><br{xhtml}>{lang_allowed_html}</dd>
-
-        <dt><label for="sp-editor-draft_flag">{lang_draft}</label></dt>
-        <dd><input type="checkbox" name="draft_flag" id="sp-editor-draft_flag" {draft_flag_checked}{xhtml}></dd>
-
-        <dt><label for="sp-editor-cache_time">{lang_cache_time}</label></dt>
-        <dd><input type="text" size="8" value="{cache_time}" name="cache_time" id="sp-editor-cachetime" class="text"{xhtml}></dd>
-        <dd class="description">{lang_cache_time_desc}</dd>          
-        
-        <dt><label>{lang_lastupdated}</label></dt>
-        <dd>{sp_formateddate}</dd>
-
-        <dt><label>{lang_hits}</label></dt>
-        <dd><input type="hidden" name="sp_hits" value="{sp_hits}"{xhtml}>{sp_hits_formatted}</dd>
-
-        <dt><label>{lang_comments}</label></dt>
-        <dd>{sp_comments}</dd>
-      </dl>
-
-      <hr style="margin-bottom: 15px;"{xhtml}>
-      <dl class="form_block">
-        <dt><label for="sp-editor-template_flag">{lang_template}</label></dt>
-        <dd><input type="checkbox" name="template_flag" id="sp-editor-template_flag" {template_flag_checked}{xhtml}>  {lang_template_flag_msg}</dd>
-
-        <dt><label>{lang_use_template}</label></dt>
-        <dd>{use_template_selection}   {lang_use_template_msg}</dd>
-      </dl>
-
-      <hr style="margin-bottom: 15px;"{xhtml}>
-      <dl class="form_block">
-        <dt><label for="sp-editor-sp_centerblock">{lang_centerblock}</label></dt>
-        <dd><input type="checkbox" name="sp_centerblock" id="sp-editor-sp_centerblock" {centerblock_checked}{xhtml}>  {lang_centerblock_msg}</dd>
-
-        <dt><label>{lang_position}</label></dt>
-        <dd>{pos_selection}</dd>
-      </dl>
-
-      <hr style="margin-bottom: 15px;"{xhtml}>
-      <dl class="form_block">
-        <dt><label for="sp-editor-sp_inblock">{inblock_msg}</label></dt>
-        <dd><input type="checkbox" name="sp_inblock" id="sp-editor-sp_inblock" {inblock_checked}{xhtml}>  {inblock_info}</dd>
-
-        <dt><label for="sp-editor-sp_help">{lang_centerblock_help}</label></dt>
-        <dd><input type="text" name="sp_help" value="{centerblock_help}" id="sp-editor-sp_help" class="size5"{xhtml}> {lang_centerblock_include}
-            <br{xhtml}>{lang_centerblock_desc}</dd>
-
-        <dt><label>{php_msg}</label></dt>
-        <dd>{php_selector}  {php_warn}</dd>
-
-        <dt><label for="sp-editor-sp_nf">{exit_msg}</label></dt>
-        <dd><input type="checkbox" name="sp_nf" id="sp-editor-sp_nf" {exit_checked}{xhtml}>  {exit_info}</dd>
-      </dl>
-
-      <fieldset>
-        <legend>{lang_accessrights}</legend>
-
-        <dl class="form_block">
-          <dt>{lang_owner}</dt>
-          <dd>{owner_link} {camera_icon}
-              <input type="hidden" name="owner_id" value="{owner_id}"{xhtml}></dd>
-
-          <dt><label for="group_id">{lang_group}</label></dt>
-          <dd>{group_dropdown}</dd>
-
-          <dt><label for="admin-permissions">{lang_permissions}</label></dt>
-          <dd>{permissions_editor}</dd>
-          <dd class="description">{lang_perm_key}</dd>
-          <dd class="description">{lang_permissions_msg}</dd>
-        </dl>
-      </fieldset>
-
-      <div class="submit">
-        <input type="submit" value="{lang_save}" name="mode" class="submit"{xhtml}>
-        <input type="submit" value="{lang_cancel}" name="mode" class="submit"{xhtml}>
-        {delete_option}
-        <input type="hidden" name="sp_old_id" value="{sp_old_id}"{xhtml}>
-        <input type="hidden" name="{gltoken_name}" value="{gltoken}"{xhtml}>
-      </div>
-    </div>
-  </form>
-  {end_block}
-
-{# end {templatelocation} #}
diff -r f8652077694c -r b759c53774a3 plugins/staticpages/templates/admin/editor_advanced.thtml
--- a/plugins/staticpages/templates/admin/editor_advanced.thtml	Thu Feb 19 10:11:13 2015 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-{# begin {templatelocation} #}
-
-{noscript}
-<div id="advanced_editor" style="display:none;">
-  {start_block_editor}
-  <form action="{site_admin_url}/plugins/staticpages/index.php" method="post" onsubmit='set_postcontent();' id="sp-advanced_editor" class="compact">
-    <div class="admin_basic">
-      <dl class="form_block">
-        <dt><label for="sp-advanced_editor-sp_title">{lang_title}</label></dt>
-        <dd><input type="text" maxlength="128" {!if titletoid}onkeyup="TitleToId('sp-advanced_editor-sp_title','sp-advanced_editor-sp_id');" {!endif}name="sp_title" value="{sp_title}" id="sp-advanced_editor-sp_title" class="size5"{xhtml}></dd>
-        
-        <dt><label for="sp-advanced_editor-sp_id">{lang_id}</label></dt>
-        <dd><input type="text" dir="ltr" name="sp_id" maxlength="128" value="{sp_id}" id="sp-advanced_editor-sp_id" class="size5"{xhtml}></dd>
-
-        <dt><label>{lang_url}</label></dt>
-        <dd><span class="break-word">{example_url}</span></dd>
-
-        <dt><label for="sp-advanced_editor-sp_page_title">{lang_page_title}</label></dt>
-        <dd><input type="text" maxlength="128" name="sp_page_title" value="{sp_page_title}" id="sp-advanced_editor-sp_page_title" class="size5"{xhtml}></dd>
-
-        <dt><label for="sp-advanced_editor-sp_onmenu">{lang_addtomenu}</label></dt>
-        <dd><input type="checkbox" name="sp_onmenu" id="sp-advanced_editor-sp_onmenu" {onmenu_checked}{xhtml}></dd>
-
-        <dt><label for="sp-advanced_editor-sp_label">{lang_label}</label></dt>
-        <dd><input type="text" name="sp_label" maxlength="64" value="{sp_label}" id="sp-advanced_editor-sp_label" class="size5"{xhtml}></dd>
-
-        <dt><label>{lang_topic}</label></dt>
-        <dd>{topic_selection}</dd>
-        
-        <dt><label for="sp-advanced_editor-sp_format">{lang_pageformat}</label></dt>
-        <dd><select name="sp_format" id="sp-advanced_editor-sp_format">
-              <option value="blankpage" {blankpage_selected}>{lang_blankpage}</option>
-              <option value="noblocks" {noblock_selected}>{lang_noblocks}</option>
-              <option value="leftblocks" {leftblocks_selected}>{lang_leftblocks}</option>
-              <option value="allblocks" {allblocks_selected}>{lang_leftrightblocks}</option>
-            </select></dd>
-
-        <dt><label for="sp-advanced_editor-commentcode">{lang_mode}</label></dt>
-        <dd><select name="commentcode" id="sp-advanced_editor-commentcode">
-              {comment_options}
-            </select></dd>
-
-        <dt><label for="sel_editmode">{lang_postmode}</label></dt>
-        <dd><select name="postmode" id="sel_editmode" {change_editormode}>
-              {post_options}
-            </select></dd>
-
-        <dt{hide_meta}><label for="sp-advanced_editor-meta_description">{lang_metadescription}</label></dt>
-        <dd{hide_meta}><textarea name="meta_description" cols="45" rows="2" id="sp-advanced_editor-meta_description" class="wide">{meta_description}</textarea></dd>
-
-        <dt{hide_meta}><label for="sp-advanced_editor-meta_keywords">{lang_metakeywords}</label></dt>
-        <dd{hide_meta}><textarea name="meta_keywords" cols="45" rows="2" id="sp-advanced_editor-meta_keywords" class="wide">{meta_keywords}</textarea></dd>
-      </dl>
-
-      <div class="story_editor">
-        <span id="sel_toolbar" style="display:{show_adveditor};">{lang_toolbar}: 
-          <select id="fckeditor_toolbar_selector" name="fckeditor_toolbar_selector" onchange="changeToolbar(this.value);">
-            <option value="editor-toolbar1">{toolbar1}</option>
-            <option value="editor-toolbar2" selected="selected">{toolbar2}</option>
-            <option value="editor-toolbar3">{toolbar3}</option>
-            <option value="Default">{toolbar5}</option>
-          </select>
-        </span>
-
-        <table border="0" cellspacing="0" cellpadding="3" width="100%">
-          <tr id="advanced_editarea" style="display:{show_adveditor};">



More information about the geeklog-cvs mailing list