codes****@googl*****
codes****@googl*****
2008年 9月 9日 (火) 23:24:59 JST
Author: mystralkk Date: Tue Sep 9 07:24:06 2008 New Revision: 455 Added: trunk/plugins/themedit/ trunk/plugins/themedit/INSTALL trunk/plugins/themedit/INSTALL_ja trunk/plugins/themedit/admin/ trunk/plugins/themedit/admin/getimage.php (contents, props changed) trunk/plugins/themedit/admin/images/ trunk/plugins/themedit/admin/images/Thumbs.db (contents, props changed) trunk/plugins/themedit/admin/images/themedit.gif (contents, props changed) trunk/plugins/themedit/admin/index.php (contents, props changed) trunk/plugins/themedit/admin/install.php (contents, props changed) trunk/plugins/themedit/admin/preview.css (contents, props changed) trunk/plugins/themedit/admin/preview.html trunk/plugins/themedit/admin/readme.html (contents, props changed) trunk/plugins/themedit/admin/readme_ja.html (contents, props changed) trunk/plugins/themedit/admin/selection.js (contents, props changed) trunk/plugins/themedit/admin/upload.php (contents, props changed) trunk/plugins/themedit/config.php (contents, props changed) trunk/plugins/themedit/functions.inc (contents, props changed) trunk/plugins/themedit/install_defaults.php (contents, props changed) trunk/plugins/themedit/language/ trunk/plugins/themedit/language/english.php (contents, props changed) trunk/plugins/themedit/language/english_utf-8.php (contents, props changed) trunk/plugins/themedit/language/japanese.php (contents, props changed) trunk/plugins/themedit/language/japanese_utf-8.php (contents, props changed) trunk/plugins/themedit/templates/ trunk/plugins/themedit/templates/admin.thtml (contents, props changed) trunk/plugins/themedit/templates/cell.thtml (contents, props changed) trunk/plugins/themedit/templates/install.thtml (contents, props changed) trunk/plugins/themedit/templates/topmenu.thtml (contents, props changed) trunk/plugins/themedit/templates/upload.thtml (contents, props changed) Log: テーマエディタプラグイン(themedit)-1.1.1をコミット。 Added: trunk/plugins/themedit/INSTALL ============================================================================== --- (empty file) +++ trunk/plugins/themedit/INSTALL Tue Sep 9 07:24:06 2008 @@ -0,0 +1 @@ +See admin/readme.html Added: trunk/plugins/themedit/INSTALL_ja ============================================================================== --- (empty file) +++ trunk/plugins/themedit/INSTALL_ja Tue Sep 9 07:24:06 2008 @@ -0,0 +1 @@ +admin/readme_ja.htmlをご覧ください。 Added: trunk/plugins/themedit/admin/getimage.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/getimage.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,97 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | public_html/admin/plugins/themedit/getimage.php | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +require_once '../../../lib-common.php'; + +/** +* Security check +*/ +if (!SEC_hasRights('themedit.admin')) { + // Someone is trying to illegally access this page + COM_errorLog("Someone has tried to illegally access the themedit uploader. User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); + $display = COM_siteHeader() + . COM_startBlock(THM_str('access_denied')) + . THM_str('access_denied_msg') + . COM_endBlock() + . COM_siteFooter(); + echo $display; + exit; +} + +$path = $_GET['path']; +$info = pathinfo($path); + +/** +* Creates an image +*/ +switch (strtolower($info['extension'])) { + case 'jpg': + case 'jpeg': + $type = 'jpeg'; + $im = @imagecreatefromjpeg($path); + break; + + case 'png': + $type = 'png'; + $im = @imagecreatefrompng($path); + break; + + case 'gif': + $type = 'gif'; + $im = @imagecreatefromgif($path); + break; + + default: + $type = 'none'; + $im = false; + break; +} + +/** +* Displays the image +*/ +if ($im === false) { + COM_errorLog("themedit: invalid path or GD unsupported: {$path}"); +} else { + header("Content-Type: image/{$type}"); + + if ($type == 'jpeg') { + imagejpeg($im); + } else if ($type == 'png') { + imagepng($im); + } else if ($type == 'gif') { + imagegif($im); + } + + imagedestroy($im); +} Added: trunk/plugins/themedit/admin/images/Thumbs.db ============================================================================== Binary file. No diff available. Added: trunk/plugins/themedit/admin/images/themedit.gif ============================================================================== Binary file. No diff available. Added: trunk/plugins/themedit/admin/index.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/index.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,407 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | public_html/admin/plugins/themedit/index.php | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +require_once '../../../lib-common.php'; + +if (!defined('XHTML')) { + define('XHTML', ''); +} + +/** +* Only lets admin users access this page +*/ +if (!SEC_hasRights('themedit.admin')) { + // Someone is trying to illegally access this page + COM_errorLog("Someone has tried to illegally access the themedit Admin page. User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); + $display = COM_siteHeader() + . COM_startBlock(THM_str('access_denied')) + . THM_str('access_denied_msg') + . COM_endBlock() + . COM_siteFooter(); + echo $display; + exit; +} + +/** +* Main +*/ +$sys_message = ''; +$file = ''; +$vars = array(); +$op = ''; +$contents = ''; + +/** +* Undoes magic_quotes if necessary +*/ +if (get_magic_quotes_gpc()) { + $_GET = array_map('stripslashes', $_GET); + $_POST = array_map('stripslashes', $_POST); + $_COOKIE = array_map('stripslashes', $_COOKIE); +} + +/** +* Checks if themes and/or files are added and/or deleted +*/ +switch (strtolower($_THM_CONF['resync_database'])) { + case 'auto': + $diff = THM_isAddedOrRemoved(); + if ((count($diff['added']) > 0) OR (count($diff['removed']) > 0)) { + THM_updateAll(); + } + break; + + case 'manual': + $diff = THM_isAddedOrRemoved(); + if ((count($diff['added']) > 0) OR (count($diff['removed']) > 0)) { + $link = $_CONF['site_admin_url'] . '/plugins/themedit/index.php?op=updateall'; + $sys_message .= str_replace('%s', $link, $LANG_THM['file_changed']); + } + break; + + case 'ignore': + default: + break; +} + +/** +* Retrieve $_GET/$_POST vars +*/ +$theme_names = THM_getAllowedThemes(); +$theme = $theme_names[0]; + +/** +* Theme name +*/ +if (isset($_POST['thm_theme'])) { + $req_theme = COM_applyFilter($_POST['thm_theme']); +} else if (isset($_GET['thm_theme'])) { + $req_theme = COM_applyFilter($_GET['thm_theme']); +} +if (in_array($req_theme, $theme_names)) { + $theme = $req_theme; +} else { + COM_errorLog('Themedit: Unknown theme name posted: ' . $req_theme); +} + +/** +* File name +*/ +if (isset($_POST['thm_file'])) { + $req_file = COM_applyFilter($_POST['thm_file']); +} else if (isset($_GET['thm_file'])) { + $req_file = COM_applyFilter($_GET['thm_file']); +} +if (in_array($req_file, $_THM_CONF['allowed_files'])) { + $file = $req_file; +} else { + COM_errorLog('Themedit: Unknown file name posted: ' . $req_file); +} + +/** +* Operation +*/ +if (isset($_POST['thm_op'])) { + $op = COM_applyFilter($_POST['thm_op']); +} else if (isset($_GET['op'])) { + $op = COM_applyFilter($_GET['op']); +} +if (($op == '') AND ($file != '')) { + $op = 'load'; +} + +/** +* Content being edited +*/ +if (isset($_POST['theme_contents'])) { + $contents = $_POST['theme_contents']; +} + +/** +* Checks if $file is writable +*/ +if (!empty($file)) { + if (!THM_isWritable($theme, $file)) { + $sys_message .= THM_str('not_writable'); + COM_errorLog('Themedit: File is not writable. Theme: ' . $theme . ' file: ' . $file); + } +} + +/** +* Operation +*/ +switch ($op) { + case $LANG_THM['save']: + /** + * Checks CSRF token + */ + if (defined('THEMEDIT_GL15') AND $_THM_CONF['enable_csrf_protection'] + AND !SEC_checkToken()) { + COM_errorLog("Themedit: Someone might have tried CSRF attack. User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); + COM_refresh($_CONF['site_url']); + exit; + } + $result = THM_saveFile($theme, $file, $contents); + $sys_message = ($result) ? THM_str('save_success') : THM_str('save_fail'); + break; + + case $LANG_THM['init']: + $result = THM_initFile($theme, $file); + if ($result) { + $contents = THM_getContents($theme, $file); + $sys_message = THM_str('init_success'); + } else { + $sys_message = THM_str('init_fail'); + } + break; + + case 'updateall': + THM_updateAll(); + break; + + case $LANG_THM['image']: + header('Location: ' . $_CONF['site_admin_url'] . '/plugins/themedit/upload.php?thm_theme=' . rawurlencode($theme)); + exit; + break; + + default: + break; +} + +/** +* Display +*/ +$display = COM_siteHeader(); +$T = new Template($_CONF['path'] . 'plugins/themedit/templates'); +$T->set_file('admin', 'admin.thtml'); + +/** +* To prevent template engine from removing template vars loaded in <textarea> +*/ +$T->set_unknowns('keep'); + +$T->set_var('xhtml', XHTML); +$T->set_var('temp_site_url', $_CONF['site_url']); +$T->set_var('temp_site_admin_url', $_CONF['site_admin_url']); +$T->set_var('temp_header', THM_str('admin')); +$code4preview = <<<EOD1 +<script type="text/javascript"> +<!-- + window.open("{$_CONF['site_admin_url']}/plugins/themedit/preview.html", "PREVIEW"); +//--> +</script> +EOD1; + +if ($op == $LANG_THM['preview']) { + /** + * If a file is being edited, first swap its contents with that of the + * corresponding file saved on the Web, then create a preview, and finally + * restore the file contents + */ + if (!empty($file)) { + $path_parts = pathinfo($file); + $is_css = preg_match("/\.css$/i", $file); + if ($is_css) { + $fh = fopen($_CONF['path_html'] . 'admin/plugins/themedit/preview.css', 'wb'); + if ($fh !== false) { + fwrite($fh, $contents); + fclose($fh); + } + } else { + $org_contents = THM_getContents($theme, $file); + THM_saveFile($theme, $file, $contents); + } + } + + $preview = THM_getPreview(); + + if (!empty($file) AND !$is_css) { + THM_saveFile($theme, $file, $org_contents); + } + + $preview = preg_replace( + '/(^.*?<title>).*?(<\/title>.*$)/mi', + '$1' . THM_str('preview') . '$2', + $preview + ); + list(, $dummy) = explode(' ', microtime()); + + /** + * Makes sure your browser reads a CSS file afresh, not from cache + */ + if ($is_css) { + $css_path = $_CONF['site_url'] . '/layout/' . $theme . '/' . $file; + $alt_css_path = $_CONF['site_admin_url'] + . '/plugins/themedit/preview.css?dummy=' . $dummy; + $pos = strpos(strtolower($preview), strtolower($css_path)); + COM_errorLog('$preview: ' . $preview . "\r\n" . '$css_path: ' . $css_path); + if ($pos !== false) { + $preview = substr($preview, 0, $pos) . $alt_css_path + . substr($preview, $pos + strlen($css_path)); + } +// $preview = str_replace($css_path, $alt_css_path, $preview); + } else { + $preview = preg_replace( + '/(^.*?)(href=".*\.css)(".*$)/im', + '$1$2?dummy=' . $dummy . '$3', + $preview + ); + } + $fh = fopen($_CONF['path_html'] . 'admin/plugins/themedit/preview.html', 'wb'); + if ($fh !== false) { + fwrite($fh, $preview); + fclose($fh); + } + $T->set_var('temp_preview_code', $code4preview); +} else { + $T->set_var('temp_preview_code', ''); +} + +if (empty($sys_message)) { + $T->set_var('temp_sys_message', ''); +} else { + $T->set_var( + 'temp_sys_message', + '<p style="border: solid 2px red; padding: 5px;">' . $sys_message . '</p>' + ); +} +$T->set_var( + 'temp_lang_script_disabled', + '<p style="color: red; font-weight: bold;">' . THM_str('script_disabled') . '</p>' +); +$T->set_var('temp_lang_select', THM_str('select')); +$T->set_var('temp_lang_theme_edited', THM_str('theme_edited')); +$T->set_var('temp_lang_file_edited', THM_str('file_edited')); + +/** +* Set theme name drop down list +*/ +$themes4html = ''; +foreach ($theme_names as $theme_name) { + if ($theme_name == $theme) { + $themes4html .= "<option value='{$theme_name}' selected='selected'>"; + } else { + $themes4html .= "<option value='{$theme_name}'>"; + } + $themes4html .= THM_esc($theme_name) . '</option>' . LB; +} + +$T->set_var('temp_themes', $themes4html); + +/** +* Set template/css name drop down list +*/ +if ($file == '') { + $files4html = '<option selected="selected">'; +} else { + $files4html = '<option>'; +} +$files4html .= '-</option>' . LB; + +foreach ($_THM_CONF['allowed_files'] as $allowed_file) { + if ($allowed_file == $file) { + $files4html .= "<option value='{$allowed_file}' selected='selected'>"; + } else { + $files4html .= "<option value='{$allowed_file}'>"; + } + if (isset($LANG_THM[$allowed_file])) { + $text = THM_str($allowed_file); + } else { + $text = $allowed_file; + } + $files4html .= THM_esc($text) . '</option>' . LB; +} + +$T->set_var('temp_files', $files4html); + +/** +* Load template vars & file contents +*/ +if (!empty($file)) { + $vars = THM_getTemplateVars($theme, $file); +} +if ($op == 'load') { + $contents = THM_getContents($theme, $file); +} +$contents4html = THM_esc($contents); + +/** +* In case of a template file, show a list of template vars available +*/ +$vars4html = ''; +if (count($vars) > 0) { + $vars4html .= '<table style="border: solid 1px #7F9DB9; padding: 5px; width: 100%">'; + $vars4html .= '<caption style="text-align: center; color: white; background-color: #7F9DB9;">'; + $vars4html .= THM_str('vars_available') . '</caption>'; + $vars4html .= '<tr>' . LB; + + for ($i = 0, $j = 0; $i < count($vars); $i ++) { + $vars4html .= '<td width="150"><button type="button" title="' + . THM_str("help_{$vars[$i]}") . '" onClick="insert_var(\'' + . $vars[$i]. '\')"' + . ' style="color: white; background-color: #333366;">' + . $vars[$i] . '</button></td>'; + $j ++; + if ($j % 4 == 0) { + $vars4html .= '</tr>' . LB . '<tr>'; + } + } + + $vars4html .= '</tr>' . LB; + $vars4html .= '</table>' . LB; +} + +$T->set_var('temp_vars', $vars4html); +$T->set_var('temp_contents', $contents4html); +$T->set_var('temp_lang_preview', THM_str('preview')); +$T->set_var('temp_lang_save', THM_str('save')); +$T->set_var('temp_lang_image', THM_str('image')); +$T->set_var('temp_lang_init', THM_str('init')); + +/** +* For GL-1.5.0+ +*/ +if (defined('THEMEDIT_GL15') AND $_THM_CONF['enable_csrf_protection']) { + /** + * Sets CSRF token + */ + $T->set_var('temp_token_name', CSRF_TOKEN); + $ttl = DB_getItem($_TABLES['users'], 'cookietimeout', "(uid='" . addslashes($_USER['uid']) . "')"); + $T->set_var('temp_token_value', SEC_createToken($ttl)); +} + +$T->parse('output','admin'); +$display .= $T->finish($T->get_var('output')); +$display .= COM_siteFooter(); + +echo $display; Added: trunk/plugins/themedit/admin/install.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/install.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,247 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | public_html/admin/plugins/themedit/install.php | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +require_once '../../../lib-common.php'; +require_once $_CONF['path'] . 'plugins/themedit/config.php'; +require_once $_CONF['path'] . 'plugins/themedit/functions.inc'; + +$pi_name = 'themedit'; // Plugin name Must be 15 chars or less +$pi_version = $_THM_CONF['pi_version']; // Plugin Version +$gl_version = $_THM_CONF['gl_version']; // GL Version plugin for +$pi_url = $_THM_CONF['pi_url']; // Plugin Homepage + +// +// $NEWTABLE contains table name(s) and sql to create it(them) +// Fill it in and you are ready to go. +// Note: you must put the table names in the uninstall routine in functions.inc +// and in the $_TABLES array in config.php. +// Note: Be sure to replace table1, table2 with the actual names of your tables. +// and the table definition with the definition of your table +// + +$NEWTABLE = array(); +$NEWTABLE['thm_contents'] = "CREATE TABLE " . $_TABLES['thm_contents'] . "(" + . "thm_id INT(10) unsigned NOT NULL AUTO_INCREMENT," + . "thm_name VARCHAR(20) NOT NULL DEFAULT ''," + . "thm_filename VARCHAR(100) NOT NULL DEFAULT ''," + . "thm_init_contents TEXT NOT NULL," + . "thm_vars TEXT NOT NULL DEFAULT ''," + . "PRIMARY KEY (thm_id)" + . ") TYPE=MyISAM"; + + +// +// Security Feature to add +// Fill in your security features here +// Note you must add these features to the uninstall routine in function.inc so that they will +// be removed when the uninstall routine runs. +// You do not have to use these particular features. You can edit/add/delete them +// to fit your plugins security model +// + +$NEWFEATURE = array(); +$NEWFEATURE['themedit.admin'] = "themedit Admin"; + +// Only let Root users access this page +if (!SEC_inGroup('Root')) { + // Someone is trying to illegally access this page + COM_errorLog("Someone has tried to illegally access the themedit install/uninstall page. User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: $REMOTE_ADDR",1); + $display = COM_siteHeader() + . COM_startBlock(THM_str('access_denied')) + . THM_str('access_denied_msg') + . COM_endBlock() + . COM_siteFooter(); + echo $display; + exit; +} + +/** +* Puts the datastructures for this plugin into the Geeklog database +* +* Note: Corresponding uninstall routine is in functions.inc +* +* @return boolean True if successful False otherwise +*/ +function plugin_install_themedit() { + global $pi_name, $pi_version, $gl_version, $pi_url, $NEWTABLE, $DEFVALUES, + $NEWFEATURE, $_TABLES, $_CONF; + + COM_errorLog("Attempting to install the {$pi_name} Plugin", 1); + + // Create the Plugins Tables + + foreach ($NEWTABLE as $table => $sql) { + COM_errorLog("Creating {$table} table", 1); + DB_query($sql,1); + if (DB_error()) { + COM_errorLog("Error Creating {$table} table", 1); + plugin_uninstall_themedit(); + return false; + exit; + } + COM_errorLog("Success - Created {$table} table",1); + } + + // Initialize themedit database + + THM_initDatabase(); + + // Create the plugin admin security group + + COM_errorLog("Attempting to create {$pi_name} admin group", 1); + DB_query("INSERT INTO {$_TABLES['groups']} (grp_name, grp_descr) " + . "VALUES ('{$pi_name} Admin', 'Users in this group can administer the {$pi_name} plugin')", 1); + if (DB_error()) { + plugin_uninstall_themedit(); + return false; + exit; + } + COM_errorLog('...success', 1); + $group_id = DB_insertId(); + + // Save the grp id for later uninstall + COM_errorLog('About to save group_id to vars table for use during uninstall', 1); + DB_query("INSERT INTO {$_TABLES['vars']} VALUES ('{$pi_name}_gid', '{$group_id}')", 1); + if (DB_error()) { + plugin_uninstall_themedit(); + return false; + exit; + } + COM_errorLog('...success', 1); + + // Add plugin Features + + foreach ($NEWFEATURE as $feature => $desc) { + COM_errorLog("Adding {$feature} feature", 1); + DB_query("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) " + . "VALUES ('{$feature}','{$desc}')", 1); + if (DB_error()) { + COM_errorLog("Failure adding {$feature} feature", 1); + plugin_uninstall_themedit(); + return false; + exit; + } + $feat_id = DB_insertId(); + COM_errorLog("Success", 1); + COM_errorLog("Adding {$feature} feature to admin group", 1); + DB_query("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ('{$feat_id}', '{$group_id}')"); + if (DB_error()) { + COM_errorLog("Failure adding {$feature} feature to admin group", 1); + plugin_uninstall_themedit(); + return false; + exit; + } + COM_errorLog('Success', 1); + } + + /** + * OK, now give Root users access to this plugin now! + * NOTE: Root group should always be 1 + */ + COM_errorLog("Attempting to give all users in Root group access to {$pi_name} admin group", 1); + DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES ('{$group_id}', NULL, 1)"); + if (DB_error()) { + plugin_uninstall_themedit(); + return false; + exit; + } + + // Register the plugin with Geeklog + + COM_errorLog("Registering {$pi_name} plugin with Geeklog", 1); + DB_delete($_TABLES['plugins'],'pi_name','themedit'); + DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " + . "VALUES ('{$pi_name}', '{$pi_version}', '{$gl_version}', '{$pi_url}', 1)"); + + if (DB_error()) { + plugin_uninstall_themedit(); + return false; + exit; + } + + /** + * Add config info + */ + if (version_compare(VERSION, '1.5') >= 0) { + require_once $_CONF['path'] . 'plugins/themedit/install_defaults.php'; + plugin_initconfig_themedit(); + } + + COM_errorLog("Succesfully installed the {$pi_name} Plugin!", 1); + return true; +} + +/** +* Main Function +*/ +$display = COM_siteHeader(); +$T = new Template($_CONF['path'] . 'plugins/themedit/templates'); +$T->set_file('install', 'install.thtml'); +$T->set_var('xhtml', XHTML); +$T->set_var('install_header', THM_str('install_header')); +$T->set_var('img', $_CONF['site_admin_url'] . '/plugins/themedit/images/themedit.gif'); +$T->set_var('cgiurl', $_CONF['site_admin_url'] . '/plugins/themedit/install.php'); +$T->set_var('admin_url', $_CONF['site_admin_url'] . '/plugins/themedit/index.php'); + +$action = COM_applyFilter($_POST['action']); +if ($action == 'install') { + if (plugin_install_themedit()) { + echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=44'); + exit; +// $T->set_var('installmsg1', $LANG_THM['install_success']); + } else { + $T->set_var('installmsg1', THM_str('install_failed')); + } +} else if ($action == "uninstall") { + plugin_uninstall_themedit('installed'); + $T->set_var('installmsg1', THM_str('uninstall_msg')); +} + +if (DB_count($_TABLES['plugins'], 'pi_name', 'themedit') == 0) { + $T->set_var('installmsg2', THM_str('uninstalled')); + $T->set_var('readme', THM_str('readme')); + $T->set_var('site_admin_url', $_CONF['site_admin_url']); + $T->set_var('installdoc', THM_str('installdoc')); + $T->set_var('installdoc_ja', THM_str('installdoc_ja')); + $T->set_var('btnmsg', THM_str('install')); + $T->set_var('action','install'); +} else { + $T->set_var('installmsg2', THM_str('installed')); + $T->set_var('btnmsg', THM_str('uninstall')); + $T->set_var('action','uninstall'); +} +$T->parse('output','install'); +$display .= $T->finish($T->get_var('output')) + . COM_siteFooter(); + +echo $display; Added: trunk/plugins/themedit/admin/preview.css ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/preview.css Tue Sep 9 07:24:06 2008 @@ -0,0 +1,2 @@ + @ import url("style.css"); + @ import url("style_forum.css"); Added: trunk/plugins/themedit/admin/preview.html ============================================================================== Added: trunk/plugins/themedit/admin/readme.html ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/readme.html Tue Sep 9 07:24:06 2008 @@ -0,0 +1,235 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="en"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <meta http-equiv="Content-Style-Type" content="text/css"> + <title>the Geeklog Theme Editor plugin</title> + <style type="text/css"> + <!--> + body { + color: black; + background-color: white; + line-height: 1.5em; + } + .geeklog { + background-color: yellow; + } + .public { + background-color: #99ff00; + } + .admin { + background-color: aqua; + } + li { + padding: 5px 5px 10px 5px; + } + h2, h3 { + padding: 0.3em; + background-color: #99ff99; + } + p { + text-indent: 1em; + } + table { + border-collapse: collapse; + border: solid 2px black; + padding: 0.3em; + } + th, td { + border: solid 1px black; + padding: 0.3em; + } + #copyright { + padding: 0.5em 1em; + border: solid 1px aqua; + background-color: #ccffff; + font-style: italic; + } + .fix { + color: red; + font-weight: bold; + } + .new { + color: green; + font-weight: bold; + } + <! --> + </style> +</head> + +<body> +<h1>Geeklog Theme Editor Plugin [v1.1.1]</h1> +by mystral-kk [<a href="mailto:geekl****@mystr*****">geekl****@mystr*****</a>]<br> +Aug 18, 2008 + +<h2>Table of Contents</h2> + +<ul> + <li><a href="#description">Description</a></li> + <li><a href="#version">Version History</a></li> + <li><a href="#thanks">Thanks!</a></li> + <li><a href="#install">Installing The Plugin</a></li> + <li><a href="#uninstall">Uninstalling The Plugin</a></li> + <li><a href="#config">Configuring The Plugin</a></li> + <li><a href="#upgrade">Upgrading The Plugin</a></li> + <li><a href="#usage">Usage</a></li> + <li><a href="#license">License</a></li> +</ul> + +<a name="description"></a><h3>Description</h3> +<p>The Theme Editor is an online theme editor which allows you to edit template files (*.thtml) and cascading style sheet file (*.css). With this plugin, you can edit Geeklog themes on the Web, without uploading theme files.</p> + +<a name="version"></a><h3>Version History</h3> +<table border="1"> + <tr> + <th>Date</th><th>Version</th><th>Description</th> + </tr> + <tr> + <td>Aug 18, 2008</td><td>1.1.1</td><td><span class="fix">[Fix]</span> Upgraded to properly work with DokuWiki plugin.</td> + </tr> + <tr> + <td>Aug 11, 2008</td><td>1.1.0</td><td><span class="new">[New]</span> Upgraded to properly work with Geeklog-1.5.0 as well.<br><span class="fix">[New]</span> Upgraded to use Config UI with GL-1.5.0.</td> + </tr> + <tr> + <td>Mar 29, 2007</td><td>1.0.5</td><td><span class="fix">[Fix]</span> Modified to properly handle a path containing an apostrophe.<br><span class="new">[New]</span> Added a new option to make all themes available automatically. (See <a href="#config">Configuring the plugin</a> below.)<br><span class="new">[New]</span> Added a new option to make all theme-related files (*.thtml, *.css) available automatically. (See <a href="#config">Configuring the plugin</a> below.)</td> + </tr> + <tr> + <td>Dec 21, 2006</td><td>1.0.4</td><td><span class="new">[New]</span> Added a functionality of uploading images to the images directory under each theme directory<br><span class="new">[New]</span> Changed file name dropdown list so that the purposes of the files, instead of file names themselves, will appear.</td> + </tr> + <tr> + <td>Nov 7, 2006</td><td>1.0.3</td><td><span class="fix">[Fix]</span> Dealed with the case where default language is not Japanese (Thanks, Kemal and Tsuchi).<br><span class="new">[New]</span> Added many more template file names(Thanks, Ivy).</td> + </tr> + <tr> + <td>Nov 2, 2006</td><td>1.0.2</td><td><span class="fix">[Fix]</span> Dealed with the case where magic_quotes_gpc is on (Thanks, samstone).</td> + </tr> + <tr> + <td>Oct 1, 2006</td><td>1.0.0</td><td>Initial version</td> + </tr> +</table> + +<a name="version"></a><h3>Thanks!</h3> +<ul> + <li>Geeklog.jp members for useful suggestions</li> + <li>Geeklog Core Team for developing and maintaining Geeklog, the Ultimate CMS</li> +</ul> + +<a name="#install"></a><h3>Install instruction for the Geeklog Theme Editor plugin</h3> + +<p>In the following descriptions</p> +<ul> + <li><span class="geeklog"><geeklog_dir></span> is the directory where the system config.php file resides</li> + <li><span class="admin"><admin></span> is the directory where the administration files reside (usually, under <span class="public"><public_html></span>)</li> +</ul> + +<ol> + <li>Back up your Geeklog Database. The themedit plugin adds tables to your Geeklog database. You can do this with the built in admin backup facility.</li> + <li>Uncompress the themedit plugin archive while in the <span class="geeklog"><geeklog_dir></span>/plugins directory. The archive will create a directory called themedit in the plugins directory.</li> + <li>Create the admin directory. Under your <span class="admin"><admin></span>/plugins/ directory create a directory called themedit.</li> + <li>Change to your <span class="geeklog"><geeklog_dir></span>/plugins/themedit/ directory. Copy the files in the admin directory to the <span class="admin"><admin></span>/plugins/themedit/ directory your created in step 3.</li> + <li>Edit the config.php in the themedit directory and confirm the table prefix (the same as Geeklog table prefix by default) and modify the names of themes and files you would like to edit with the Theme Editor plugin.</li> + <li>Log in to your Geeklog as a root user and run install.php in your <span class="admin"><admin></span>/plugins/themedit/ directory. The install page will tell you if the install was successful or not. If not, examine Geeklog system errorlog for possible problems. The themedit plugin should now be installed and functioning. Clicking on the themedit Icon will take you to the admin page.</li> + <li>Set up security. On install only the root users have access to themedit administration. You can delegate control for the functions through the user and group editors.</li> + <li><strong>[***** EXTRA STEP 1 FOR THEME EDITOR PLUGIN *****]</strong> Change the permissions of the directories where *.thtml files resides to <strong>757</strong>. Change the permissions of the *.thtml files to <strong>646</strong>.</li> + <li><strong>[***** EXTRA STEP 2 FOR THEME EDITOR PLUGIN *****]</strong> Change the permissions of the files preview.html and preview.css, which reside in the <span class="admin"><admin></span>/plugins/themedit/ directory, to <strong>646</strong>.</li> +</ol> +<p>NOTE: The Theme Editor plugin uses JavaScript a lot. For better functionality, it is strongly recommended that you enable JavaScript.</p> + +<a name="#uninstall"></a><h3>Uninstall instruction for the Geeklog Theme Editor plugin</h3> + +<ol> + <li>Run the install.php page in your <span class="admin"><admin></span>/plugins/themedit directory. This will remove all the data from your database.</li> + <li>Delete the two plugin directories created in the install process: <span class="geeklog"><geeklog-dir></span>/plugins/themedit/ and <span class="admin"><admin></span>/plugins/themedit/</li> + <li><strong>[***** EXTRA STEP FOR THEME EDITOR PLUGIN *****]</strong> Restore the permissions of the directories and files you changed during the installation. For example, change the permissions of the directories to 755 and those of the files to 644.</li> +</ol> + +<a name="config"></a><h3>Configuring the plugin</h3> +<p>In the plugin's config.php, you can modify these values:</p> +<table border="1"> + <tr> + <th width="250">Name</th><th>Type</th><th>Description</th> + </tr> + <tr> + <td><code>$_THM_CONF['allowed_themes']</code></td> + <td>Array of theme names</td> + <td>The theme names (case-sensitive) you can edit with the plugin. The default value is 'professional'.</td> + </tr> + <tr> + <td><code>$_THM_CONF['allowed_files']</code></td> + <td>Array of file names</td> + <td>The file names (case-sensitive) you can edit with the plugin. Template files (*.thtml) and cascading style sheet files (*.css) are supported.</td> + </tr> + <tr> + <td><code>$_THM_CONF['resync_database']</code></td> + <td>One of 'auto', 'manual', 'ignore'</td> + <td>When you add/remove a theme to/from <code>$_THM_CONF['allowed_themes']</code>, or a template file to/from <code>$_THM_CONF['allowed_files']</code>, The Theme Editor plugin will detect it automatically.<br> + <ul> + <li>'auto' -- the plugin will update the data stored in databse automatically.</li> + <li>'manual' -- the plugin will display the information and 'UPDATE database' button.</li> + <li>'ignore' -- the plugin will do nothing about the change.</li> + </ul> + </td> + </tr> + <tr> + <td><code>$_THM_CONF['allow_upload']</code></td> + <td>Boolean (true or false)</td> + <td>Whether you allow images to be uploaded to the images directories under the theme directories. The default value is true.</td> + </tr> + <tr> + <td><code>$_THM_CONF['image_width']</code></td> + <td>Integer</td> + <td>The width (in pixels) of thumb nail images. The default value is 120.</td> + </tr> + <tr> + <td><code>$_THM_CONF['image_height']</code></td> + <td>Integer</td> + <td>The height (in pixels) of thumb nail images. The default value is 100.</td> + </tr> + <tr> + <td><code>$_THM_CONF['image_max_col']</code></td> + <td>Integer</td> + <td>The number of columns of thumb nail images. The default value is 6.</td> + </tr> + <tr> + <td><code>$_THM_CONF['upload_max_size']</code></td> + <td>Integer</td> + <td>The max size (in bytes) of images to be uploaded to the web server. The default value is 1048576, that is, 1M bytes.</td> + </tr> + <tr> + <td><code>$_THM_CONF['enable_all_themes']</code><br>(ver.1.0.5 or later)</td> + <td>Boolean</td> + <td>If set true, all themes are allowed automatically regardless of the value of <code>$_THM_CONF['allowed_themes']</code>. The default value is false.</td> + </tr> + <tr> + <td><code>$_THM_CONF['enable_all_files']</code><br>(ver.1.0.5 or later)</td> + <td>Boolean</td> + <td>If set true, all theme-related files (*.thtml, *.css) are allowed automatically regardless of the value of <code>$_THM_CONF['allowed_files']</code>. The default value is false.</td> + </tr> + <tr> + <td><code>$_THM_CONF['enable_csrf_protection']</code><br>(ver.1.1.0 or later)</td> + <td>Boolean</td> + <td>If set true, CSRF protection will be enabled when you are using Geeklog-1.5.0.</td> + </tr> +</table> + +<a name="upgrade"></a><h3>Upgrading The Plugin</h3> +<p>First, after you download and unpack a new archive, upload all the files to the Web server. Then, log in as admin and go to the Plugin Editor. Click the edit icon and click "upgrade" button.</p> + +<a name="usage"></a><h3>Usage</h3> +<p>The Theme Editor plugin is so simple that you can use it almost intuitively.</p> +<ol> + <li>Choose a theme you want to edit at a dropdown menu.<br><strong>NOTE</strong>: theme names you can choose from are defined as the <tt>$_THM_CONF['allowed_themes']</tt> array in <tt>config.php</tt>. Please edit it as you like.</li> + <li>Choose a file you want to edit at a dropdown menu.<br><strong>NOTE</strong>: file names you can choose from are defined as the <tt>$_THM_CONF['allowed_files']</tt> array in <tt>config.php</tt>. Please edit it as you like.</li> + <li>A list of template vars available in the current file will be displayed.</li> + <li>When you hit one of the buttons with a template var name on it, the corresponding tag will be inserted into the caret position.<br><strong>NOTE</strong>: you have to enable JavaScript to use these buttons.</li> + <li>When you hit the "<strong>Preview</strong>" button, the current content will be previewed in another page.</li> + <li>When you hit the "<strong>Save</strong>" button, the current content will be saved on the Web.</li> + <li>When you hit the "<strong>Initialize</strong>" button, the content of the file will be reverted to what it used to be when you installed the Theme Editor plugin.</li> + <li>When you hit the "<strong>Image</strong>" button, a simple image browser will be displayed. Supported file types are 'jpg', 'jpeg', 'png', and 'gif'. In the screen, you can choose a theme and a directory from dropdown lists. When you want to upload an image file to the current directory, hit the 'Browse...' button and select an image file to upload and then hit the 'Upload' button. If you want to delete an image file(s), check all the files you'd like to and hit the 'Delete' button. <strong>The deleting process will be carried out WITHOUT CONFIRMATION, so be very careful!</strong> There is no undoing it.</li> +</ol> + +<a name="license"></a><h3>License</h3> +<p>The Theme Editor plugin is licensed under the GPL.</p> + +<div id="copyright">Copyright © 2006-2008 mystral-kk</div> +</body> +</html> Added: trunk/plugins/themedit/admin/readme_ja.html ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/readme_ja.html Tue Sep 9 07:24:06 2008 @@ -0,0 +1,236 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html lang="ja"> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <meta http-equiv="Content-Style-Type" content="text/css"> + <title>Geeklog テーマエディタプラグイン</title> + <style type="text/css"> + <!--> + body { + color: black; + background-color: white; + line-height: 1.5em; + } + .geeklog { + background-color: yellow; + } + .public { + background-color: #99ff00; + } + .admin { + background-color: aqua; + } + li { + padding: 5px 5px 10px 5px; + } + h2, h3 { + padding: 0.3em; + background-color: #99ff99; + } + p { + text-indent: 1em; + } + table { + border-collapse: collapse; + border: solid 2px black; + padding: 0.3em; + } + th, td { + border: solid 1px black; + padding: 0.3em; + } + #copyright { + padding: 0.5em 1em; + border: solid 1px aqua; + background-color: #ccffff; + font-style: italic; + } + .fix { + color: red; + font-weight: bold; + } + .new { + color: green; + font-weight: bold; + } + <! --> + </style> +</head> + +<h1>Geeklogテーマエディタプラグイン [v1.1.1]</h1> +by mystral-kk [<a href="mailto:geekl****@mystr*****">geekl****@mystr*****</a>]<br> +2008年 8月18日 + +<h2>目次</h2> + +<ul> + <li><a href="#description">概要</a></li> + <li><a href="#version">改訂履歴</a></li> + <li><a href="#thanks">謝辞</a></li> + <li><a href="#install">プラグインのインストール</a></li> + <li><a href="#uninstall">プラグインのアンインストール</a></li> + <li><a href="#config">プラグインの設定</a></li> + <li><a href="#upgrade">プラグインのアップグレード</a></li> + <li><a href="#usage">使用法</a></li> + <li><a href="#license">ライセンス</a></li> +</ul> + +<a name="description"></a><h3>概要</h3> +<p>テーマエディタを使うと、オンラインでテンプレートファイル(*.thtml)とカス ケィディングスタイルシートファイル(*.css)を編集できます。このプラグインを使 えば、テンプレートファイルを変更する度にアップロードする必要はなくなります。 </p> + +<a name="version"></a><h3>改訂履歴</h3> +<table border="1"> + <tr> + <th>日付</th><th>バージョン</th><th>説明</th> + </tr> + <tr> + <td>2008年 8月18日</td><td>1.1.1</td><td><span class="new">[Fix]</span> DokuWikiプラグインと協調できるように修正しました。</td> + </tr> + <tr> + <td>2008年 8月11日</td><td>1.1.0</td><td><span class="new">[New]</span> Geeklog-1.5.0でも動作するよう更新。<br><span class="new">[New]</span> Geeklog-1.5.0のコンフィギュレーションUIを使用するよう更新。</td> + </tr> + <tr> + <td>2007年 3月29日</td><td>1.0.5</td><td><span class="fix">[Fix]</span> アポストロフィを含むパスを正しく処理するように変更。<br><span class="new">[New]</span> すべてのテーマを自動的に利用可能にするオプションを 追加。(<a href="#config">プラグインの設定</a>を参照のこと。)<br><span class="new">[New]</span> テーマに関するすべてのファイル(*.thtml, *.css)を自 動的に利用可能にするオプションを追加。(<a href="#config">プラグインの設定 </a>を参照のこと。)</td> + </tr> + <tr> + <td>2006年12月21日</td><td>1.0.4</td><td><span class="new">[New]</span> 各テーマディレクトリ下の images ディレクトリに画像をアップロードする機能を追 加。<br><span class="new">[New]</span> ファイル名ドロップダウンリストで、フ ァイル名ではなく機能名を表示するように変更。</td> + </tr> + <tr> + <td>2006年11月 7日</td><td>1.0.3</td><td><span class="fix">[Fix]</span> デフォルトの言語が日本語の場合に対応(Thanks, Kemal and Tsuchi)。<br><span class="new">[New]</span> テンプレートファイル名を大幅に追加(Thanks, Ivy)。 </td> + </tr> + <tr> + <td>2006年11月 2日</td><td>1.0.2</td><td><span class="fix">[Fix]</span> magic_quotes_gpcがオンの場合に対応(Thanks, samstone)。</td> + </tr> + <tr> + <td>2006年10月 1日</td><td>1.0.0</td><td>初期バージョン</td> + </tr> +</table> + +<a name="version"></a><h3>謝辞</h3> +<ul> + <li>有益なアイデアを提供してくれたGeeklog.jpのメンバーに、</li> + <li>Geeklogを開発・維持してくれるGeeklogのコア開発チームに、</li> +</ul> +感謝します。 + +<a name="#install"></a><h3>プラグインのインストール</h3> + +<p>以下の説明で、</p> +<ul> + <li><span class="geeklog"><geeklog_dir></span>は、システムの config.php が存在するディレクトリ</li> + <li><span class="admin"><admin></span>は、管理者用ファイルが存在する ディレクトリ(ふつうは、<span class="public"><public_html></span>ディ レクトリの下)</li> +</ul> +<p>を表しています。</p> + +<ol> + <li>テーマエディタプラグインはテーブルを追加するので、管理者メニューの「 DBのバックアップ」やphpMyAdminを使用して、事前にGeeklogのデータベースをバッ クアップしておきます。</li> + <li>テーマエディタプラグインのアーカイブを<span class="geeklog"><geeklog_dir></span>/pluginsディレクトリに展開します。 themeditという名前のディレクトリができます。</li> + <li>adminディレクトリを作ります。<span class="admin"><admin></span>/plugins/ ディレクトリの下に themeditとい う名前のディレクトリを作ります。</li> + <li><span class="geeklog"><geeklog_dir></span>/plugins/themedit/ デ ィレクトリに移動します。adminディレクトリの内容を、3.で作成した <span class="admin"><admin></span>/plugins/themedit/ ディレクトリにコピーし ます。</li> + <li>themeditディレクトリの config.php ファイルを編集し、データベースのテー ブルのプレフィックスと編集対象テーマ、編集対象ファイルなどを設定します。デフ ォルトでは、Geeklogのテーブルのプレフィックスを使用し、themedit admin以外の アクセスを認めないようになっています。</li> + <li>Rootユーザーとしてログインし、プラグインエディタからインストールを実行 します。失敗した場合には、エラーログ(error.log)を調べます。この時点で、 テーマエディタプラグインはインストールされ、機能しているはずです。テーマエデ ィタアイコンをクリックすると、管理機能ページへジャンプするでしょう。</li> + <li>セキュリティを設定します。インストール直後には、テーマエディタプラグイ ンの管理権限(themedit admin)を持っているのは、Rootユーザーだけです。ユーザー エディタやグループエディタを使用して、管理権限を他の人やグループに委譲するこ とができます</li> + <li><strong>[***** 注意1 *****]</strong> 編集するテーマが入っているディレ クトリのパーミッションを<strong>757</strong>、編集するファイルのパーミッショ ンを<strong>646</strong>に変更する必要があります。</li> + <li><strong>[***** 注意2 *****]</strong> <span class="admin"><admin></span>/plugins/ ディレクトリ内の preview.html と preview.css のパーミッションを<strong>646</strong>に変更する必要がありま す。</li> +</ol> +<p>注意: テーマエディタプラグインではかなりJavaScriptを使用しています。快適 な操作性を得るには、JavaScriptをオンにすることを強くお勧めします。</p> + +<a name="#uninstall"></a><h3>プラグインのアンインストール</h3> + +<ol> + <li>プラグインエディタから、テーマエディタプラグインをアンインストールしま す。このとき、テーマエディタプラグインが使用していたテーブルは破棄され、その 中に記録されていたデータも削除されます。</li> + <li>インストールの過程で作成した 2つのディレクトリ(<span class="geeklog"><geeklog-dir></span>/plugins/themedit/ と <span class="admin"><admin></span>/plugins/themedit/ を削除します。</li> + <li>[***** 注意 *****]</strong> インストール時に変更したディレクトリとフ ァイルのパーミッションを元に戻します。たとえば、ディレクトリは <strong>755</strong>、ファイルは<strong>644</strong>に変更します。</li> +</ol> + +<a name="config"></a><h3>プラグインの設定</h3> +<p>プラグインのconfig.phpでが、次の値を設定できます:</p> +<table border="1"> + <tr> + <th width="250">変数名</th><th>タイプ</th><th>説明</th> + </tr> + <tr> + <td><code>$_THM_CONF['allowed_themes']</code></td> + <td>テーマ名の配列</td> + <td>このプラグインを使用して編集するテーマ名(大文字小文字を区別します )を設定します。デフォルト値は、'professional' です。</td> + </tr> + <tr> + <td><code>$_THM_CONF['allowed_files']</code></td> + <td>ファイル名の配列</td> + <td>このプラグインを使用して編集するファイル名(大文字小文字を区別します )を設定します。テンプレートファイル(*.thtml)とカスケィディングスタイルシー トファイル(*.css)を指定できます。</td> + </tr> + <tr> + <td><code>$_THM_CONF['resync_database']</code></td> + <td>'auto', 'manual', 'ignore'のどれか</td> + <td><code>$_THM_CONF['allowed_themes']</code>にテーマを、 <code>$_THM_CONF['allowed_files']</code>にファイルを追加・削除する度に、テー マエディタプラグインは自動的に検出します。<br> + <ul> + <li>'auto' -- プラグインはデータベースに保存されているデータを更新しま す。</li> + <li>'manual' -- プラグインは更新情報と、「データベースを更新」ボタンを 表示します。</li> + <li>'ignore' -- プラグインは変更を無視します。</li> + </ul> + </td> + </tr> + <tr> + <td><code>$_THM_CONF['allow_upload']</code></td> + <td>論理型(trueまたはfalse)</td> + <td>画像ファイルのアップロードを許可するかどうかを決めます。デフォルト値 はtrueです。</td> + </tr> + <tr> + <td><code>$_THM_CONF['image_width']</code></td> + <td>整数型</td> + <td>サムネール画像の幅(ピクセル)。デフォルト値は120です。</td> + </tr> + <tr> + <td><code>$_THM_CONF['image_height']</code></td> + <td>整数型</td> + <td>サムネール画像の高さ(ピクセル)。デフォルト値は100です。</td> + </tr> + <tr> + <td><code>$_THM_CONF['image_max_col']</code></td> + <td>整数型</td> + <td>1列の中でサムネール画像を表示する個数。デフォルト値は6です。</td> + </tr> + <tr> + <td><code>$_THM_CONF['upload_max_size']</code></td> + <td>整数型</td> + <td>アップロードできる画像ファイルの最大サイズ。デフォルト値は1048576、つ まり、1Mバイトです。</td> + </tr> + <tr> + <td><code>$_THM_CONF['enable_all_themes']</code><br>(ver.1.0.5以降)</td> + <td>論理型(trueまたはfalse)</td> + <td>trueにすると、<code>$_THM_CONF['allowed_themes']</code>の値とは無関係 に、すべてのテーマを自動的に利用可能にします。デフォルト値はfalseです。</td> + </tr> + <tr> + <td><code>$_THM_CONF['enable_all_files']</code><br>(ver.1.0.5以降)</td> + <td>論理型(trueまたはfalse)</td> + <td>trueにすると、<code>$_THM_CONF['allowed_files']</code>の値とは無関係 に、すべてのテーマに関係するファイル(*.thtml, *.css)を自動的に利用可能にしま す。デフォルト値はfalseです。</td> + </tr> + <tr> + <td><code>$_THM_CONF['enable_csrf_protection']</code><br>(ver.1.1.0以降 )</td> + <td>論理型</td> + <td>trueにすると、Geeklog-1.5.0で導入されたCSRF攻撃対策が有効になります。 </td> + </tr> +</table> + +<a name="upgrade"></a><h3>プラグインのアップグレード</h3> +<p>新しいアーカイブを展開(解凍)してできたファイルをすべてWebサーバにアッ プロードし、プラグインエディタから「編集」-「更新」を実行するだけです。</p> + +<a name="usage"></a><h3>使用法</h3> +<p>テーマエディタプラグインはとてもシンプルなので、ほとんど直感的に使えま す。</p> +<ol> + <li>編集したいテーマをドロップダウンリストから選択します。<br><strong>注意 </strong>:選択できるテーマ名は <tt>config.php</tt> 中の <tt>$_THM_CONF['allowed_themes']</tt> で定義されています。必要に応じて変更し てください。</li> + <li>編集したいファイルをドロップダウンリストから選択します。<br><strong>注 意</strong>:選択できるファイル名は <tt>config.php</tt> 中の <tt>$_THM_CONF['allowed_files']</tt> で定義されています。必要に応じて変更し てください。</li> + <li>使用可能なテンプレート変数の一覧が表示されます。</li> + <li>テンプレート変数名が書かれたボタンをクリックすると、編集画面のキャレッ トの位置に対応するタグが挿入されます。<br><strong>注意</strong>: JavaScriptを有効にしないとこのボタンは使えません。</li> + <li>「プレビュー」ボタンをクリックすると、編集内容のプレビューが別のページ で表示されます。</li> + <li>「保存」ボタンをクリックすると、編集内容がWeb上に保存されます。</li> + <li>「初期設定に戻す」ボタンをクリックすると、ファイルの内容はこのプラグイ ンがインストールされた時点の内容に戻ります。</li> + <li>「画像」ボタンをクリックすると、シンプルな画像ブラウザが表示されます。 サポートされている画像タイプは'jpg', 'jpeg', 'png', 'gif'です。テーマ名とデ ィレクトリ名のドロップダウンリストを選択することでブラウズできます。画像をア ップロードするときには、「参照...」ボタンをクリックして選択し、「アップロー ド」ボタンをクリックします。画像ファイルを削除したい場合は、該当のファイルに チェックを入れて、「削除」ボタンをクリックします。<strong>削除は確認なしに行 われるので、注意してください。</strong>やり直しはできません。</li> +</ol> + +<a name="license"></a><h3>ライセンス</h3> +<p>テーマエディタプラグインはGPLです。</p> + +<div id="copyright">Copyright © 2006-2008 mystral-kk</div> +</body> +</html> Added: trunk/plugins/themedit/admin/selection.js ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/selection.js Tue Sep 9 07:24:06 2008 @@ -0,0 +1,87 @@ +function insert_var(var_name){ + var o_text = document.getElementById('theme_contents'); + + // Get caret position + var s = new Selection(o_text); + var res = s.create(); + var ca_begin = res.start; + var ca_end = res.end; + var part1 = o_text.value.substr(0, ca_begin); + var part2 = o_text.value.substr(ca_end, o_text.value.length - ca_end + 1); + var data = '{' + var_name + '}'; + var data_len = data.length; + + // Insert {template_var} + o_text.value = part1 + data + part2; + + // Set caret position + if (document.all) { // IE + } else { // FF + o_text.selectionStart = ca_begin + data_len; + o_text.selectionEnd = o_text.selectionStart; + } + o_text.focus(); +} + +// Cross Browser selectionStart/selectionEnd +// Version 0.1 +// Copyright (c) 2005 KOSEKI Kengo +// +// This script is distributed under the MIT licence. +// http://www.opensource.org/licenses/mit-license.php + +function Selection(textareaElement) { + this.element = textareaElement; +} + +Selection.prototype.create = function() { + if (document.selection != null && this.element.selectionStart == null) { + return this._ieGetSelection(); + } else { + return this._mozillaGetSelection(); + } +} + +Selection.prototype._mozillaGetSelection = function() { + return { + start: this.element.selectionStart, + end: this.element.selectionEnd + }; +} + +Selection.prototype._ieGetSelection = function() { + this.element.focus(); + + var range = document.selection.createRange(); + var bookmark = range.getBookmark(); + + var contents = this.element.value; + var originalContents = contents; + var marker = this._createSelectionMarker(); + while(contents.indexOf(marker) != -1) { + marker = this._createSelectionMarker(); + } + var selection = range.text; + + var parent = range.parentElement(); + if (parent == null || parent.type != "textarea") { + return { start: 0, end: 0 }; + } + range.text = marker + range.text + marker; + contents = this.element.value; + + var result = {}; + result.start = contents.indexOf(marker); + contents = contents.replace(marker, ""); + result.end = contents.indexOf(marker); + + this.element.value = originalContents; + range.moveToBookmark(bookmark); + range.select(); + + return result; +} + +Selection.prototype._createSelectionMarker = function() { + return "##SELECTION_MARKER_" + Math.random() + "##"; +} Added: trunk/plugins/themedit/admin/upload.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/admin/upload.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,246 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | public_html/admin/plugins/themedit/upload.php | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +require_once '../../../lib-common.php'; + +/** +* Security check +*/ +if (!SEC_hasRights('themedit.admin')) { + // Someone is trying to illegally access this page + COM_errorLog( "Someone has tried to illegally access the themedit uploader. User id: {$_USER['uid']}, Username: {$_USER['username']}, IP: {$_SERVER['REMOTE_ADDR']}", 1); + $display = COM_siteHeader() + . COM_startBlock(THM_str('access_denied')) + . THM_str('access_denied_msg') + . COM_endBlock() + . COM_siteFooter(); + echo $display; + exit; +} + +/** +* Retrives vars +*/ +if (get_magic_quotes_gpc() == 1) { + $_GET = array_map('stripslashes', $_GET); + $_POST = array_map('stripslashes', $_POST); + $_COOKIE = array_map('stripslashes', $_COOKIE); +} + +$theme = ''; +if (isset($_GET['thm_theme'])) { + $theme = COM_applyFilter($_GET['thm_theme']); +} else if (isset($_POST['thm_theme'])) { + $theme = COM_applyFilter($_POST['thm_theme']); +} +$all_themes = THM_getAllowedThemes(); +if (!in_array($theme, $all_themes)) { + $theme = $all_themes[0]; +} + +$selected_dir = 'images/'; +if (isset($_POST['thm_dir'])) { + $selected_dir = $_POST['thm_dir']; +} + +$display = COM_siteHeader(); +$T = new Template($_CONF['path'] . 'plugins/themedit/templates'); +$T->set_file( + array( + 'upload' => 'upload.thtml', + 'cell' => 'cell.thtml' + ) +); +$T->set_var('temp_site_admin_url', $_CONF['site_admin_url']); +$T->set_var('temp_header', THM_str('upload_header')); +$T->set_var('temp_theme', $theme); +$T->set_var('temp_lang_return_to_editor', THM_str('return_to_editor')); +$T->set_var('site_admin_url', $_CONF['site_admin_url']); +$T->set_var('temp_lang_dest', THM_str('dest')); +$T->set_var('temp_lang_script_disabled', THM_str('script_disabled')); +$T->set_var('thm_theme', $theme); +$T->set_var('thm_dir', $selected_dir); + +/** +* Sets theme names +*/ +$theme_names = THM_getAllowedThemes(); +$themes4html = ''; + +foreach ($theme_names as $theme_name) { + if ($theme_name == $theme) { + $themes4html .= "<option value='{$theme_name}' selected='selected'>"; + } else { + $themes4html .= "<option value='{$theme_name}'>"; + } + $themes4html .= THM_esc($theme_name) . '</option>' . LB; +} + +$T->set_var('temp_themes', $themes4html); + +$T->set_var('temp_lang_dir', THM_str('dir')); +$allowed_dirs = array( + 'images/', 'images/admin/', 'images/buttons/', 'images/icons/', + 'images/custom/', +); +$temp_dirs = ''; + +foreach ($allowed_dirs as $allowed_dir) { + if ($allowed_dir == $selected_dir) { + $temp_dirs .= '<option selected="selected">'; + } else { + $temp_dirs .= '<option>'; + } + $temp_dirs .= $allowed_dir . '</option>' . LB; +} + +$T->set_var('temp_dirs', $temp_dirs); +$T->set_var('temp_lang_file', THM_str('file')); +$T->set_var('temp_lang_submit', THM_str('upload')); +$T->set_var('temp_lang_change', THM_str('change')); +$T->set_var('temp_lang_delete', THM_str('delete')); +$T->set_var('max_upload_size', THM_str('upload_max_size')); + +// Processes uploaded files if any + +if (isset($_POST['submit']) AND ($_POST['submit'] == $LANG_THM['upload']) + AND isset($_FILES['thmfile']) AND ($_FILES['thmfile']['size'] > 0)) { + $u_name = $_FILES['thmfile']['name']; + $u_size = $_FILES['thmfile']['size']; + $u_tmp = $_FILES['thmfile']['tmp_name']; + $path_parts = pathinfo( $u_name ); + if ($u_size > $_THM_CONF['upload_max_size']) { + $T->set_var('temp_sys_message', "<span style='color: red; font-weight: bold;'>{$LANG_THM['file_too_large']}</a>"); + } else if (!in_array(strtolower($path_parts['extension']), array('jpg', 'jpeg', 'gif', 'png'))) { + $T->set_var('temp_sys_message', "<span style='color: red; font-weight: bold;'>{$LANG_THM['file_type_unsupported']}</p>"); + } else if (is_uploaded_file($u_tmp)) { + $dest = $_CONF['path_themes'] . $theme . '/' . $selected_dir + . basename($u_name); + if (@move_uploaded_file($u_tmp, $dest)) { + $T->set_var('temp_sys_message', "<span style='color: #339933; font-weight: bold;'>{$LANG_THM['upload_success']}</p>"); + } else { + $T->set_var('temp_sys_message', "<span style='color: red; font-weight: bold;'>{$LANG_THM['upload_fail']}</p>"); + } + } else { + $T->set_var('temp_sys_message', "<span style='color: red; font-weight: bold;'>{$LANG_THM['upload_attack']}</p>"); + } +} + +// Deletes checked files if any + +if (isset($_POST['thm_delete']) AND ($_POST['thm_delete'] == $LANG_THM['delete']) + AND isset($_POST['ch'])) { + $success = $fail = 0; + + foreach ($_POST['ch'] as $checked_file) { + $entry = $_CONF['path_themes'] . $theme . '/' . $selected_dir . $checked_file; + if (@unlink($entry)) { + $success ++; + } else { + $fail ++; + } + } + + $delete_msg = ''; + if ($success) { + $delete_msg = '<span style="color: #339933; font-weight: bold;">' . sprintf($LANG_THM['delete_success'], $success) . '</span>'; + if ($fail) { + $delete_msg .= ' '; + } + } + if ($fail) { + $delete_msg = '<span style="color: red; font-weight: bold;">' . sprintf($LANG_THM['delete_fail'], $fail) . '</span>'; + } + + $T->set_var('temp_sys_message', $delete_msg); +} + +/** +* Displays images +*/ +$basedir = $_CONF['path_themes'] . $theme . '/' . $selected_dir; +$images = ''; +$num_col = 0; +$dh = opendir($basedir); +if ($dh !== false) { + while (($entry = readdir($dh)) !== false) { + if (is_file($basedir . '/' . $entry)) { + if (preg_match('/\.gif$/i', $entry) + OR preg_match('/\.png$/i', $entry) + OR preg_match('/\.jpg$/i', $entry) + OR preg_match('/\.jpeg$/i', $entry)) { + if ($num_col == 0) { + $images .= '<tr>' . LB; + } + + $T->set_var('temp_cell_width', $_THM_CONF['image_width'] + 2); + $T->set_var('temp_cell_height', $_THM_CONF['image_height'] + 12 + 2); + $T->set_var('temp_img_src', $_CONF['site_url'] . '/layout/' . $theme . '/' . $selected_dir . $entry); + $T->set_var('temp_filename', $entry); + list($width, $height, $type, $dummy) = @getimagesize($basedir . '/' . $entry); + if ($width > $_THM_CONF['image_width'] + OR $height > $_THM_CONF['image_height']) { + if ($width / $_THM_CONF['image_width'] > $height / $_THM_CONF['image_height']) { + $height = floor($height * ($_THM_CONF['image_width'] / $width)); + $width = $_THM_CONF['image_width']; + } else { + $width = floor($width * ($_THM_CONF['image_height'] / $height)); + $height = $_THM_CONF['image_height']; + } + } + $T->set_var('temp_img_width', $width); + $T->set_var('temp_img_height', $height); + $path = $basedir . '/' . $entry; + $T->set_var('temp_getimage_url', $_CONF['site_admin_url'] . "/plugins/themedit/getimage.php?path={$path}"); + $T->parse('output', 'cell'); + $images .= '<td>' . $T->finish($T->get_var('output')) . '</td>' . LB; + $num_col ++; + if ($num_col >= $_THM_CONF['image_max_col']) { + $num_col = 0; + $images .= '</tr>' . LB; + } + } + } + } +} + +if ($num_col > 0) { + $images .= '</tr>' . LB; +} + +$T->set_var('temp_images', $images); +$T->parse('output','upload'); +$display .= $T->finish($T->get_var('output')) + . COM_siteFooter(); + +echo $display; Added: trunk/plugins/themedit/config.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/config.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,201 @@ +<?php +// +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | geeklog/plugins/themedit/config.php | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +global $_DB_table_prefix, $_TABLES; + +/** +* set Plugin Table Prefix the Same as Geeklogs +*/ +$_THM_table_prefix = $_DB_table_prefix; + +/** +* Add to $_TABLES array the tables your plugin uses +*/ +$_TABLES['thm_contents'] = $_THM_table_prefix . 'thm_contents'; + +$_THM_CONF = array(); + +/** +* Plugin info +*/ +$_THM_CONF['pi_version'] = '1.1.1'; // Plugin Version +$_THM_CONF['gl_version'] = '1.4.0'; // GL Version plugin for +$_THM_CONF['pi_url'] = 'http://mystral-kk.net/'; // Plugin Homepage + +//========================================================= +// USER CONFIGURATION +//========================================================= + +//------------------------------------- +// Theme names and file names +//------------------------------------- + +/** +* If you set $_THM_CONF['enable_all_themes'] to true, all themes will be +* accessible from the Theme Editor Plugin, regardless of the value of +* $_THM_CONF['allowed_themes'] var. +*/ +$_THM_CONF['enable_all_themes'] = false; + +/** +* If you set true to $_THM_CONF['enable_all_files'], all files related to +* themes (*.thtml, *.css) will be accessible from the Theme Editor Plugin, +* regardless of the value of $_THM_CONF['allowed_files'] var +*/ +$_THM_CONF['enable_all_files'] = false; + +/** +* Themes to be edited with this plugin +* @NOTE: theme names are case-sensitive +*/ +$_THM_CONF['allowed_themes'] = array( + 'professional', 'ProfessionalCSS', 'mobile', 'mobile_3g', +); + +/** +* Template files and CSS files to be edited with this plugin +* @NOTE: file names are case-sensitive +*/ +$_THM_CONF['allowed_files'] = array( + // CSS + 'style.css', 'custom.css', 'custom.sample.css', 'style_forum.css', + + // Site header and footer + 'header.thtml', 'footer.thtml', + + // Blocks + 'leftblocks.thtml', 'blockheader-left.thtml', 'blockfooter-left.thtml', + 'rightblocks.thtml', 'blockheader-right.thtml', 'blockfooter-right.thtml', + + // Story + 'storytext.thtml', 'featuredstorytext.thtml', 'archivestorytext.thtml', + 'article/article.thtml', 'article/printable.thtml', + + // Menu + 'menuitem.thtml', 'menuitem_last.thtml', 'menuitem_none.thtml', + + // List + 'list.thtml', 'listitem.thtml', + + // Login + 'loginform.thtml', + + // Profile + 'profiles/contactuserform.thtml', 'profiles/contactauthorform.thtml', + 'preferences/profile.thtml', 'users/profile.thtml', + + // Search + 'search/searchform.thtml', 'search/searchresults.thtml', + + // User submission + 'submit/submitevent.thtml', 'submit/submitloginrequired.thtml', + + // User + 'users/newpassword.thtml', 'users/getpasswordform.thtml', + 'users/loginform.thtml', 'users/registrationform.thtml', + 'users/storyrow.thtml', 'users/commentrow.thtml', +); + +/** +* If you'd like to see theme names and file names sorted alphabetically in +* their dropdown list, uncomment the next two lines. +*/ +// sort($_THM_CONF['allowed_themes']); +// sort($_THM_CONF['allowed_files']); + +/** +* When you add/remove a theme to/from $_THM_CONF['allowed_themes'], or +* a template file to/from $_THM_CONF['allowed_files'], Theme Editor plugin will +* detect it automatically. When this option is set to 'auto', the plugin will +* update the data stored in databse automatically. When set to 'manual', the +* plugin will display the information and 'UPDATE database' button. When set +* to 'ignore', the plugin will do nothing about the change. +*/ +$_THM_CONF['resync_database'] = 'manual'; + +//------------------------------------- +// Image upload +//------------------------------------- + +/** +* If set true, you can upload images to theme/images/* directories +*/ +$_THM_CONF['allow_upload'] = true; + +/** +* Thumbnail sizes in pixels +*/ +$_THM_CONF['image_width'] = 120; + +$_THM_CONF['image_height'] = 100; + +/** +* Max column number of thumbnails +*/ +$_THM_CONF['image_max_col'] = 6; + +/** +* Max size of a file in bytes (1048576 bytes = 1M bytes) for uploading to the +* Web server +*/ +$_THM_CONF['upload_max_size'] = 1048576; + +/** +* Enable CSRF protection for GL-1.5.0+ +*/ +$_THM_CONF['enable_csrf_protection'] = true; + +//========================================================= +// END OF USER CONFIGURATION +//========================================================= + +//=============================================== +// For GL-1.5.0+ +//=============================================== + +/** +* Check and see if we need to load the plugin configuration +*/ +if (version_compare(VERSION, '1.5') >= 0) { + require_once $_CONF['path_system'] . 'classes/config.class.php'; + + $themedit_config = config::get_instance(); + if ($themedit_config->group_exists('themedit')) { + $temp = $themedit_config->get_config('themedit'); + if (is_array($temp) AND (count($temp) >= 1)) { + $_THM_CONF = array_merge($_THM_CONF, $temp); + } + } + + unset($themedit_config); +} Added: trunk/plugins/themedit/functions.inc ============================================================================== --- (empty file) +++ trunk/plugins/themedit/functions.inc Tue Sep 9 07:24:06 2008 @@ -0,0 +1,854 @@ +<?php +// +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | geeklog/plugins/themedit/functions.inc | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +/** +* Language file Include +*/ +$langfile = $_CONF['path'] . 'plugins/themedit/language/' . $_CONF['language'] . '.php'; + +clearstatcache(); +if (file_exists($langfile)) { + include_once $langfile; +} else { + include_once $_CONF['path'] . 'plugins/themedit/language/english.php'; +} + +/* +* Include themedit config file +*/ +require_once $_CONF['path'] . 'plugins/themedit/config.php'; + +/** +* Define useful constants +*/ +if (!defined('LB')) { + define('LB', "\n"); +} +if (!defined('XHTML')) { + define('XHTML', ''); +} +define('THEMEDIT_BASE_URL', $_CONF['site_admin_url'] . '/plugins/themedit'); +if (version_compare(VERSION, '1.5') >= 0) { // for GL-1.5 + + define('THEMEDIT_GL15', true); +} + +/** +* Enables all files if $_THM_CONF['enable_all_files'] is true +*/ +if (isset($_THM_CONF['enable_all_files']) + AND $_THM_CONF['enable_all_files'] == true) { + unset($_THM_CONF['allowed_files']); + $_THM_CONF['allowed_files'] = array(); + $_THM_CONF['allowed_files'] = THM_getAllThemeFiles( + $_CONF['path_themes'] . 'professional', true + ); +} + +// +---------------------------------------------------------------------------+ +// | Geeklog Plugin API Implementations | +// +---------------------------------------------------------------------------+ + +/** +* Checks to see if this Plugin uses comments +*/ +function plugin_commentsupport_themedit() { + return false; +} + +/** +* Returs ccpanel options +*/ +function plugin_cclabel_themedit() { + global $_CONF, $LANG_THM; + + if (SEC_hasRights('themedit.admin')) { + $pi_name = THM_str('cc_label'); + $admin_url = THEMEDIT_BASE_URL . '/index.php'; + $icon_url = THEMEDIT_BASE_URL . '/images/themedit.gif'; + return array($pi_name, $admin_url, $icon_url); + } +} + +/** +* Returns the administrative option for this plugin +*/ +function plugin_getadminoption_themedit() { + global $_CONF, $_TABLES; + + if (SEC_hasRights('themedit.admin')) { + $pi_name = THM_str('cc_label'); + $admin_url = THEMEDIT_BASE_URL . '/index.php'; + $num_items = DB_count($_TABLES['thm_contents']); + return array($pi_name, $admin_url, $num_items); + } +} + +/** +* Returns the version for this plugin +*/ +function plugin_chkVersion_themedit() { + global $_THM_CONF; + + return $_THM_CONF['pi_version']; +} + +/** +* Upgrade the plugin +*/ +function plugin_upgrade_themedit() { + global $_CONF, $_TABLES, $_THM_CONF; + + $pi_version = DB_getItem( + $_TABLES['plugins'], 'pi_version', "(pi_name = 'themedit')" + ); + + /** + * Do upgrading + */ + + /** + * If the version of Themedit plugin is lower than 1.0.5 AND Geeklog version + * is 1.5 or newer, then save config values into DB with config.class.php. + */ + if ((version_compare($pi_version, '1.0.5') <= 0) + AND (version_compare(VERSION, '1.5') >= 0)) { + require_once $_CONF['path'] . 'plugins/themedit/install_defaults.php'; + plugin_initconfig_themedit(); + } + + /** + * Update plugin info + */ + $sql = "UPDATE {$_TABLES['plugins']} " + . "SET pi_version = '". $_THM_CONF['pi_version'] . "' " + . "WHERE (pi_name = 'themedit')"; + $result = DB_query($sql); + COM_errorLog("Themedit plugin was successfully updated to version {$_THM_CONF['pi_version']}."); + + return true; +} + +/** +* Returns JavaScript to be inserted into the header +*/ +function plugin_getheadercode_themedit() { + global $_CONF; + + $header = '<meta http-equiv="Content-Script-Type" content="text/javascript">' . LB + . '<script type="text/javascript" src="' + . THEMEDIT_BASE_URL . '/selection.js' . '">' + . '</script>' . LB; + return $header; +} + +/** +* Removes the datastructures for this plugin from the Geeklog database. +* +* @param string $installCheck Default is blank but if set, check if +* plugin is disabled first +* @return boolean true if successful false otherwise +*/ +function plugin_uninstall_themedit($installCheck = '') { + global $_CONF, $_TABLES, $LANG_THM; + + $pi_name = 'themedit'; + $FEATURES = array('themedit.admin'); + $TABLES = array('thm_contents'); + + /** + * Check and see if plugin is still enabled - if so display warning and exit + */ + if (($installCheck != '') + AND DB_getItem($_TABLES['plugins'],'pi_enabled', 'pi_name = "' .$pi_name. '"')) { + COM_errorLog('Plugin is installed and enabled. Disable first if you want to de-install it', 1); + $display .= COM_startBlock(THM_str('warning')) + . THM_str('enabled') + . COM_endBlock(); + echo $display; + return false; + } + + /** + * Unregister the plugin with Geeklog + */ + COM_errorLog('Attempting to unregister the themedit plugin from Geeklog', 1); + DB_query("DELETE FROM {$_TABLES['plugins']} WHERE (pi_name = 'themedit')", 1); + + /** + * Drop themedit tables + */ + foreach($TABLES as $table) { + $t = $_TABLES["$table"]; + COM_errorLog("Removing Table {$t}", 1); + DB_query("DROP TABLE {$t}", 1); + } + + /** + * Remove Security for this plugin + */ + $grp_id = DB_getItem($_TABLES['vars'], 'value', "name = '{$pi_name}_gid'"); + + COM_errorLog("Removing {$pi_name} Admin Group", 1); + DB_query("DELETE FROM {$_TABLES['groups']} WHERE (grp_id = '{$grp_id}')", 1); + DB_query("DELETE FROM {$_TABLES['vars']} WHERE (name = '{$pi_name}_gid')"); + COM_errorLog("Removing root users from admin of {$pi_name}"); + DB_query("DELETE FROM {$_TABLES['group_assignments']} WHERE (ug_main_grp_id = '{$grp_id}')", 1); + + /** + * Remove all the associated features -- access rights + */ + foreach ($FEATURES as $feature) { + COM_errorLog("Removing {$feature} feature and rights to it", 1); + $feat_id = DB_getItem($_TABLES['features'], 'ft_id', "ft_name = '{$feature}'"); + DB_query("DELETE FROM {$_TABLES['access']} WHERE (acc_ft_id = '{$feat_id}')", 1); + DB_query("DELETE FROM {$_TABLES['features']} WHERE (ft_id = '{$feat_id}')", 1); + } + + /** + * Delete config info + */ + if (defined('THEMEDIT_GL15')) { + require_once $_CONF['path_system'] . 'classes/config.class.php'; + + $themedit_config = config::get_instance(); + if ($themedit_config->group_exists('themedit')) { + $param_names = array( + 'sg_main', 'fs_main', 'enable_all_themes', 'enable_all_files', + 'allowed_themes', 'allowed_files', 'resync_database', + 'allow_upload', 'image_width', 'image_height', 'image_max_col', + 'upload_max_size', 'enable_csrf_protection', + ); + + foreach ($param_names as $param_name) { + $themedit_config->del($param_name, 'themedit'); + } + } + } + + COM_errorLog('...success', 1); + return true; +} + +/** +* Escapes a string for output +*/ +function THM_esc($str) { + global $LANG_CHARSET; + + $str = html_entity_decode($str, ENT_QUOTES, $LANG_CHARSET); + return htmlentities($str, ENT_QUOTES, $LANG_CHARSET); +} + +function THM_str($index) { + global $LANG_THM; + + if (isset($LANG_THM[$index])) { + return THM_esc($LANG_THM[$index]); + } else { + COM_errorLog('Themedit: Debug::undefined index: ' . $index); + return '(undefined)'; + } +} + +/** +* Return template vars stored in DB +* @return: array of string: names of template vars +*/ +function THM_getTemplateVars($theme, $filename) { + global $_TABLES; + + $retval = array(); + + $theme = addslashes($theme); + $filename = addslashes($filename); + $sql = "SELECT thm_vars FROM {$_TABLES['thm_contents']} " + . "WHERE (thm_name = '{$theme}') AND (thm_filename = '{$filename}')"; + $result = DB_query($sql); + if (!DB_error()) { + $A = DB_fetchArray($result); + if (!empty($A['thm_vars'])) { + $retval = explode(',', $A['thm_vars']); + } + } + + return $retval; +} + +/** +* Return template vars +* @param $text string the contents of a template +* @return array of string names of template vars +*/ +function THM_scanTemplateVars($text) { + $retval = array(); + + $result = preg_match_all('/\{([^}].*?)\}/', $text, $match); + if ($result >= 1) { + $retval = array_unique($match[1]); + sort($retval); + } + + return $retval; +} + +/** +* Return the current contents of a given file stored on Web server +* @param $theme string theme name +* $filename string file name +* @return string the current contents of a given file +*/ +function THM_getContents($theme, $filename) { + global $_CONF, $_THM_CONF; + + $retval = ''; + $path = $_CONF['path_themes'] . $theme . '/' . $filename; + clearstatcache(); + if (file_exists($path)) { + $contents = @file_get_contents($path); + if ($contents === false) { + $retval = ''; + } else { + $retval = $contents; + } + } else { + $retval = ''; + } + + return $retval; +} + +/** +* Return the initial contents of a given file stored in DB +* +* @param $theme string theme name +* $filename string file name +* @return string the initial contents of a given file +*/ +function THM_getInitalContents($theme, $filename) { + global $_CONF, $_TABLES, $_THM_CONF; + + $contents = ''; + $theme = addslashes($theme); + $filename = addslashes($filename); + + $sql = "SELECT thm_init_contents " + . "FROM {$_TABLES['thm_contents']} " + . "WHERE (thm_name = '{$theme}') AND (thm_filename = '{$filename}')"; + $result = DB_query($sql); + if (!DB_error()) { + $A = DB_fetchArray($result); + $contents = $A['thm_init_contents']; + } + + return $contents; +} + +/** +* Return allowed theme names, considering $_THM_CONF['allowed_themes'] +* +* @return array of string theme names +*/ +function THM_getAllowedThemes() { + global $_CONF, $_THM_CONF; + + $retval = array(); + $themes = COM_getThemes(true); + if ($_THM_CONF['enable_all_themes']) { + $retval = $themes; + } else { + foreach ($themes as $theme) { + if (in_array($theme, $_THM_CONF['allowed_themes'])) { + $retval[] = $theme; + } + } + } + + return $retval; +} + +/** +* Import the designated file and scan template vars in case of a template file +* and save the contents into database +* +* @return boolean true = success, false = otherwise +*/ +function THM_importFile($theme, $filename) { + global $_TABLES; + + $contents = THM_getContents($theme, $filename); + if (preg_match("/\.thtml$/i", $filename)) { + $vars = implode(',', THM_scanTemplateVars($contents)); + } else { + $vars = ''; + } + $theme = addslashes($theme); + $filename = addslashes($filename); + $contents = addslashes($contents); + $vars = addslashes($vars); + $sql = "INSERT INTO {$_TABLES['thm_contents']} " + . "(thm_name, thm_filename, thm_init_contents, thm_vars) " + . "VALUES ('{$theme}', '{$filename}', '{$contents}', '{$vars}')"; + $result = DB_query($sql); + return !($result === false); +} + +/** +* Initialize themedit database -- populate the table with default file contents +*/ +function THM_initDatabase() { + global $_CONF, $_TABLES, $_THM_CONF; + + $themes = THM_getAllowedThemes(); + + foreach ($themes as $theme) { + foreach ($_THM_CONF['allowed_files'] as $filename) { + THM_importFile($theme, $filename); + } + } +} + +/** +* Save the file on the web +* +* @return boolean true = success, false = fail +*/ +function THM_saveFile($theme, $filename, $contents) { + global $_CONF; + + $path = $_CONF['path_themes'] . $theme . '/' . $filename; + $fh = @fopen($path, 'wb'); + if ($fh === false) { + return false; + } + + $result1 = fwrite($fh, $contents); + $result2 = fclose($fh); + if (($result1 === false) OR ($result1 != strlen($contents)) + OR ($result2 === false)) { + return false; + } + + return true; +} + +/** +* Initialize the contnets on the web with the data stored in DB +*/ +function THM_initFile($theme, $filename) { + $contents = THM_getInitalContents($theme, $filename); + return THM_saveFile($theme, $filename, $contents); +} + +/** +* Returns if a file is writable +*/ +function THM_isWritable($theme, $filename) { + global $_CONF; + + $path = $_CONF['path_themes'] . $theme . '/' . $filename; + clearstatcache(); + $retval = is_writable($path); +# if ($retval) { +# $path_parts = pathinfo($path); +# clearstatcache(); +# $retval = is_writable($path_parts['dirname']); +# } + + return $retval; +} + +/** +* Returns if themes and/or files are added and/or removed +* +* @TODO this function doesn't work well when themes are deleted from +* $_THM_CONF['allowed_themes']. +*/ +function THM_isAddedOrRemoved() { + global $_CONF, $_TABLES, $_THM_CONF; + + $retval = array(); + $retval['added'] = array(); + $retval['removed'] = array(); + $themes = THM_getAllowedThemes(); + + foreach ($themes as $theme) { + $theme = addslashes($theme); + $sql = "SELECT thm_filename FROM {$_TABLES['thm_contents']} " + . "WHERE (thm_name = '{$theme}')"; + $result = DB_query($sql); + if (DB_error()) { + exit; + } else { + $db_files = array(); + while (($A = DB_fetchArray($result)) !== false) { + $db_files[] = $A['thm_filename']; + } + } + + foreach ($_THM_CONF['allowed_files'] as $filename) { + $path = $_CONF['path_themes'] . $theme . '/' . $filename; + clearstatcache(); + if (file_exists($path)) { + // file exists, but not in DB + if (!in_array($filename, $db_files)) { + $retval['added'][] = array('theme' => $theme, 'file' => $filename); + } + } else { + // the file no longer exits but the corresponding DB record still remains + if (in_array($filename, $db_files)) { + $retval['removed'][] = array('theme' => $theme, 'file' => $filename); + } + } + } + } + + return $retval; +} + +/** +* Update all files and/or database according to $_THM_CONF['allowed_themes'] +* and $_THM_CONF['allowed_files'] +*/ +function THM_updateAll() { + global $_CONF, $_TABLES; + + $diff = THM_isAddedOrRemoved(); + + /** + * Add new files into database + */ + foreach ($diff['added'] as $added) { + $theme = $added['theme']; + $file = $added['file']; + THM_importFile($theme, $file); + } + + /** + * Delete old files from database + */ + foreach ($diff['removed'] as $removed) { + $theme = $removed['theme']; + $file = $removed['file']; + $theme = addslashes($theme); + $file = addslashes($file); + $sql = "DELETE FROM {$_TABLES['thm_contents']} " + . "WHERE (thm_name = '{$theme}') AND (thm_filename = '{$file}')"; + DB_query($sql); + } + + COM_errorLog('Themedit: Updated the information stored in the database successfully.'); + echo COM_refresh(THEMEDIT_BASE_URL . '/index.php'); +} + +/** +* Returns the preview HTML by letting public_html/index.php do the job +*/ +function THM_getPreview() { + global $_CONF, $_TABLES; + + ob_start(); + require_once $_CONF['path_html'] . 'index.php'; + $retval = ob_get_contents(); + ob_end_clean(); + return $retval; +} + +/** +* Returns a directory tree with the current directory name stressed +*/ +function THM_getDirTree($theme, $selected_dir = '/images') { + global $_CONF, $_USER, $_TABLES; + + /** + * Checks for '..' in case of the directory-traversal attack + */ + if (strpos($selected_dir, '..') !== false) { + COM_errorLog("Themedit: someone tried directory-traversal attack on THM_getDirTree(): User ID = {$_USER['uid']}"); + return ''; + } + + $retval = '<ul>' . LB; + $cgi_path = THEMEDIT_BASE_URL . '/upload.php'; + + /** + * images/ + */ + $retval .= '<li>'; + if ($selected_dir == '/images') { + $retval .= "<strong>{$theme}/images</strong>"; + } else { + $url = THM_buildURL( + $cgi_path, + array( + 'path' => '/images', + 'theme' => $theme + ) + ); + $retval .= '<a href="' . $url . '">' . THM_esc($theme) . '/images<a>'; + } + $retval .= '<br>' . LB; + $retval .= '<ul>' . LB; + + /** + * images/admin/ + */ + $retval .= '<li>' . LB; + if ($selected_dir == '/images/admin') { + $retval .= '<strong>/admin</strong>'; + } else { + $url = THM_buildURL( + $cgi_path, + array( + 'path' => '/images/admin', + 'theme' => $theme + ) + ); + $retval .= '<a href="' . $url . '">/admin</a>'; + } + $retval .= '</li>' . LB; + + /** + * images/buttons/ + */ + $retval .= '<li>' . LB; + if ($selected_dir == '/images/buttons') { + $retval .= '<strong>/buttons</strong>'; + } else { + $url = THM_buildURL( + $cgi_path, + array( + 'path' => '/images/buttons', + 'theme' => $theme + ) + ); + $retval .= '<a href="' . $url . '">/buttons</a>'; + } + $retval .= '</li>' . LB; + + /** + * images/icons/ + */ + $retval .= '<li>' . LB; + if ($selected_dir == '/images/icons') { + $retval .= '<strong>/icons</strong>'; + } else { + $url = THM_buildURL( + $cgi_path, + array( + 'path' => '/images/icons', + 'theme' => $theme + ) + ); + $retval .= '<a href="' . $url . '">/icons</a>'; + } + $retval .= '</li>' . LB; + + $retval .= '</ul>' . LB; + $retval .= '</li>' . LB; + $retval .= '</ul>' . LB; + return $retval; +} + +/** +* Gets all theme-related files (*.thtml, *.css) +* +* @param string $path the name of the path +* @return array of file names +*/ +function THM_getAllThemeFiles($path, $top_level = false) { + global $_CONF; + + $retval = array(); + + $dh = @opendir($path); + if ($dh !== false) { + while (($entry = readdir($dh)) !== false) { + $this_path = $path . '/' . $entry; + if (is_dir($this_path)) { + if (($entry != '.') AND ($entry != '..')) { + $retval = array_merge($retval, THM_getAllThemeFiles($this_path, false)); + } + } else { + if (preg_match("/\.(thtml|css)$/i", $this_path)) { + $retval[] = $this_path; + } + } + } + } + closedir($dh); + + if ($top_level) { + for ($i = 0; $i < count($retval); $i ++) { + $retval[$i] = substr( + $retval[$i], + strlen($_CONF['path_themes'] . 'professional/') + ); + } + } + + return $retval; +} + +/** +* Builds a URL with a query string +*/ +function THM_buildURL($url, $params = array()) { + $retval = $url; + + if (count($params) >= 1) { + $temp = array(); + + foreach ($params as $key => $value) { + $temp[] = $key . '=' . rawurlencode($value); + } + + $retval .= '?' . implode('&', $temp); + } + + return $retval; +} + +/** +* Creates a menu with an optional icon and optional text below +* this is used in the admin screens but may be used elsewhere also. +* +* @param string $text instructions to be displayed +* @return string HTML output of function +* +*/ +function THM_createMenu($current_menu = 'list', $text = '', $noesc = true) { + global $_CONF, $_THM_CONF; + + $THM_MENU = array( + 'admin' => array( + 'url' => $_CONF['site_admin_url'], + 'text' => THM_str('menu_admin_home'), + ), + 'file' => array( + 'url' => THEMEDIT_BASE_URL . '/index.php?cmd=file', + 'text' => THM_str('menu_file'), + ), + 'image' => array( + 'url' => THEMEDIT_BASE_URL . '/index.php?cmd=image', + 'text' => THM_str('menu_image'), + ), + ); + + if ($_THM_CONF['allow_restore'] == false) { + unset($THM_MENU['restore']); + } + $admin_templates = new Template($_CONF['path'] . 'plugins/themedit/templates'); + $admin_templates->set_file ( + array ('top_menu' => 'topmenu.thtml') + ); + + $menu_fields = array(); + $attr = array( + 'class' => 'admin-menu-item' + ); + + foreach ($THM_MENU as $key => $value) { + if ($key != $current_menu) { + $menu_fields[] = '<a href="' . $value['url'] + . '" class="admin-menu-item">' . $value['text'] . '</a>'; + } else { + $menu_fields[] = '<strong>' . $value['text'] . '</strong>'; + } + } + + $admin_templates->set_var('icon', THEMEDIT_BASE_URL . '/images/themedit.gif'); + $admin_templates->set_var('menu_fields', implode(' | ', $menu_fields)); + if ($noesc) { + $admin_templates->set_var('lang_instructions', THM_esc($text)); + } else { + $admin_templates->set_var('lang_instructions', $text); + } + $admin_templates->set_var('xhtml', XHTML); + $admin_templates->parse('top_menu', 'top_menu'); + $retval = $admin_templates->finish($admin_templates->get_var('top_menu')); + + return $retval; +} + +function THM_list($header_arr, $data_arr) { + $retval = '<table class="admin-list-table">' . LB + . '<tr style="background: #ffffff;">' . LB; + + foreach ($header_arr as $header) { + $retval .= '<th class="admin-list-headerfield">' . $header . '</th>' . LB; + } + + $retval .= '</tr>' . LB; + $class = 'pluginRow1'; + + foreach ($data_arr as $row) { + $retval .= '<tr class="' . $class . '" onmouseover="className=\'pluginRollOver\';" onmouseout="className=\'' . $class . '\';">' . LB; + + foreach ($row as $cell) { + $retval .= '<td class="admin-list-field">' . $cell . '</td>' . LB; + } + + $retval .= '</tr>' . LB; + $class = ($class == 'pluginRow1' ? 'pluginRow2' : 'pluginRow1'); + } + + $retval .= '</table>' . LB; + return $retval; +} + +function THM_form() { + return '<form action="' . THEMEDIT_BASE_URL . '/index.php" method="post">' . LB; +} + +function THM_checkbox($name, $id, $value, $label, $checked = true) { + $retval = '<input type="checkbox" id="' . $id . '" name="' . $name + . '" value="' . $value . '"'; + if ($checked) { + $retval .= ' checked="checked"'; + } + + $retval .= XHTML . '><label for="' . $id . '">' . $label . '</label>'; + return $retval; +} + +function THM_radio($name, $id, $value, $label, $checked = true) { + $retval = '<input type="radio" id="' . $id . '" name="' . $name + . '" value="' . $value . '"'; + if ($checked) { + $retval .= ' checked="checked"'; + } + + $retval .= XHTML . '><label for="' . $id . '">' . THM_esc($label) . '</label>'; + return $retval; +} + Added: trunk/plugins/themedit/install_defaults.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/install_defaults.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,217 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------+ +// | geeklog/plugins/themedit/install_defaults.php | +// +---------------------------------------------------------------------------+ +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// +---------------------------------------------------------------------------+ +// | | +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software Foundation, | +// | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | +// | | +// +---------------------------------------------------------------------------+ + +if (strpos($_SERVER['PHP_SELF'], 'install_defaults.php') !== false) { + die('This file can not be used on its own!'); +} + +/** +* Theme Editor default settings +* +* Initial Installation Defaults used when loading the online configuration +* records. These settings are only used during the initial installation +* and not referenced any more once the plugin is installed +*/ + +/** +* Theme Editor plugin configuration file +*/ +global $_DB_table_prefix, $_THM_DEFAULT; + +/** +* the Theme Editor plugin's config array +* +* @global array $_THM_DEFAULT +*/ +$_THM_DEFAULT = array(); + +//========================================================= +// USER CONFIGURATION +//========================================================= + +//------------------------------------- +// Theme names and file names +//------------------------------------- + +/** +* If you set $_THM_CONF['enable_all_themes'] to true, all themes will be +* accessible from the Theme Editor Plugin, regardless of the value of +* $_THM_CONF['allowed_themes'] var. +*/ +$_THM_DEFAULT['enable_all_themes'] = false; + +/** +* If you set true to $_THM_DEFAULT['enable_all_files'], all files related to +* themes (*.thtml, *.css) will be accessible from the Theme Editor Plugin, +* regardless of the value of $_THM_DEFAULT['allowed_files'] var +*/ +$_THM_DEFAULT['enable_all_files'] = false; + +/** +* Themes to be edited with this plugin +* @NOTE: theme names are case-sensitive +*/ +$_THM_DEFAULT['allowed_themes'] = array( + 'professional', 'ProfessionalCSS', 'mobile', 'mobile_3g', +); + +/** +* Template files and CSS files to be edited with this plugin +* @NOTE: file names are case-sensitive +*/ +$_THM_DEFAULT['allowed_files'] = array( + // CSS + 'style.css', 'custom.css', 'custom.sample.css', 'style_forum.css', + + // Site header and footer + 'header.thtml', 'footer.thtml', + + // Blocks + 'leftblocks.thtml', 'blockheader-left.thtml', 'blockfooter-left.thtml', + 'rightblocks.thtml', 'blockheader-right.thtml', 'blockfooter-right.thtml', + + // Story + 'storytext.thtml', 'featuredstorytext.thtml', 'archivestorytext.thtml', + 'article/article.thtml', 'article/printable.thtml', + + // Menu + 'menuitem.thtml', 'menuitem_last.thtml', 'menuitem_none.thtml', + + // List + 'list.thtml', 'listitem.thtml', + + // Login + 'loginform.thtml', + + // Profile + 'profiles/contactuserform.thtml', 'profiles/contactauthorform.thtml', + 'preferences/profile.thtml', 'users/profile.thtml', + + // Search + 'search/searchform.thtml', 'search/searchresults.thtml', + + // User submission + 'submit/submitevent.thtml', 'submit/submitloginrequired.thtml', + + // User + 'users/newpassword.thtml', 'users/getpasswordform.thtml', + 'users/loginform.thtml', 'users/registrationform.thtml', + 'users/storyrow.thtml', 'users/commentrow.thtml', +); + +/** +* If you'd like to see theme names and file names sorted alphabetically in +* their dropdown list, uncomment the next two lines. +*/ +// sort($_THM_DEFAULT['allowed_themes']); +// sort($_THM_DEFAULT['allowed_files']); + +/** +* When you add/remove a theme to/from $_THM_DEFAULT['allowed_themes'], or +* a template file to/from $_THM_DEFAULT['allowed_files'], Theme Editor plugin will +* detect it automatically. When this option is set to 'auto', the plugin will +* update the data stored in databse automatically. When set to 'manual', the +* plugin will display the information and 'UPDATE database' button. When set +* to 'ignore', the plugin will do nothing about the change. +*/ +$_THM_DEFAULT['resync_database'] = 'manual'; + +//------------------------------------- +// Image upload +//------------------------------------- + +/** +* If set true, you can upload images to theme/images/* directories +*/ +$_THM_DEFAULT['allow_upload'] = true; + +/** +* Thumbnail sizes in pixels +*/ +$_THM_DEFAULT['image_width'] = 120; + +$_THM_DEFAULT['image_height'] = 100; + +/** +* Max column number of thumbnails +*/ +$_THM_DEFAULT['image_max_col'] = 6; + +/** +* Max size of a file in bytes (1048576 bytes = 1M bytes) for uploading to the +* Web server +*/ +$_THM_DEFAULT['upload_max_size'] = 1048576; + +/** +* Enable CSRF protection for GL-1.5.0+ +*/ +$_THM_DEFAULT['enable_csrf_protection'] = true; + +//========================================================= +// END OF USER CONFIGURATION +//========================================================= + +/** +* Initialize Dbman plugin configuration +* +* Creates the database entries for the configuation if they don't already exist. +* Initial values will be taken from $_THM_CONF if available (e.g. from an old +* config.php), uses $_THM_CONF otherwise. +* +* @return boolean true: success; false: an error occurred +*/ +function plugin_initconfig_themedit() { + global $_THM_CONF, $_THM_DEFAULT; + + if (isset($_THM_CONF) AND is_array($_THM_CONF) + AND (count($_THM_CONF) >= 1)) { + $_THM_DEFAULT = array_merge($_THM_DEFAULT, $_THM_CONF); + } + + $c = config::get_instance(); + if (!$c->group_exists('themedit')) { + $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'themedit'); + $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'themedit'); + + /** + * Main + */ + $c->add('enable_all_themes', $_THM_DEFAULT['enable_all_themes'], 'select', 0, 0, 0, 10, true, 'themedit'); + $c->add('enable_all_files', $_THM_DEFAULT['enable_all_files'], 'select', 0, 0, 0, 20, true, 'themedit'); + $c->add('allowed_themes', $_THM_DEFAULT['allowed_themes'], '%text', 0, 0, null, 30, true, 'themedit'); + $c->add('allowed_files', $_THM_DEFAULT['allowed_files'], '%text', 0, 0, null, 40, true, 'themedit'); + $c->add('resync_database', $_THM_DEFAULT['resync_database'], 'select', 0, 0, 1, 50, true, 'themedit'); + $c->add('allow_upload', $_THM_DEFAULT['allow_upload'], 'select', 0, 0, 0, 60, true, 'themedit'); + $c->add('image_width', $_THM_DEFAULT['image_width'], 'text', 0, 0, null, 70, true, 'themedit'); + $c->add('image_height', $_THM_DEFAULT['image_height'], 'text', 0, 0, null, 80, true, 'themedit'); + $c->add('image_max_col', $_THM_DEFAULT['image_max_col'], 'text', 0, 0, null, 90, true, 'themedit'); + $c->add('upload_max_size', $_THM_DEFAULT['upload_max_size'], 'text', 0, 0, null, 100, true, 'themedit'); + $c->add('enable_csrf_protection', $_THM_DEFAULT['enable_csrf_protection'], 'select', 0, 0, 0, 110, true, 'themedit'); + } + + return true; +} Added: trunk/plugins/themedit/language/english.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/language/english.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,278 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------| +// | geeklog/plugins/themedit/language/english.php | +// +---------------------------------------------------------------------------| +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------| +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA| +// | | +// +---------------------------------------------------------------------------| + +$LANG_CHARSET = 'iso-8859-1'; + +$LANG_THM = array( + 'plugin' => 'Plugin', + 'access_denied' => 'Access Denied', + 'access_denied_msg' => 'Only Root Users have Access to this Page. Your user name and IP have been recorded.', + 'admin' => 'Theme Editor', + 'install_header' => 'Install/Uninstall Plugin', + 'installed' => 'The Plugin is Installed', + 'uninstalled' => 'The Plugin is Not Installed', + 'install_success' => 'Installation Successful', + 'install_failed' => 'Installation Failed -- See your error log to find out why.', + 'uninstall_msg' => 'Plugin Successfully Uninstalled', + 'install' => 'Install', + 'uninstall' => 'UnInstall', + 'warning' => 'Warning! Plugin is still Enabled', + 'enabled' => 'Disable plugin before uninstalling.', + 'readme' => 'STOP! Before you press install please read the ', + 'installdoc' => 'Install Document.', + 'installdoc_ja' => 'Install Document (Japanese).', + 'menu_label' => 'Theme Editor', + 'cc_label' => 'Theme Editor', + 'script_disabled' => 'JavaScript is disabled. For better functionality, please set JavaScript on.', + 'theme_edited' => 'Current Theme', + 'file_edited' => 'Current File', + 'select' => 'Select', + 'preview' => 'Preview', + 'save' => 'Save', + 'image' => 'Image', + 'upload' => 'Upload', + 'upload_header' => 'Themedit - image', + 'return_to_editor' => 'Return to theme editor', + 'change' => 'Change', + 'file_too_large' => 'The file is too large.', + 'file_type_unsupported' => 'The file type is not supported.', + 'upload_success' => 'The file was successfully uploaded.', + 'upload_fail' => 'The file was NOT uploaded.', + 'upload_attack' => 'Possible file upload attack.', + 'delete' => 'Delete all checked files', + 'delete_success' => '%s file(s) were successfully deleted.', + 'delete_fail' => '%s file(s) were NOT deleted.', + 'dir' => 'Current directory', + 'file' => 'File to upload (jpg, jpeg, png, gif)', + 'submit' => 'Submit', + 'dest' => 'Destination', + 'init' => 'Initialize', + 'vars_available' => 'Template Vars Available', + 'save_success' => 'Saved the file successfully.', + 'save_fail' => 'Error: coludn\'t save the file.', + 'init_success' => 'Initialized the file successfully.', + 'init_fail' => 'Error: coludn\'t initialize the file.', + 'not_writable' => 'This file is not writable or does not exist.', + 'file_changed' => "Themes and/or files are added and/or deleted. To update the information stored in the database accordingly, click <a href='%s'>here</a>.", + 'help_advanced_editor' => 'advanced_editor: code to invoke FCKeditor', + 'help_button_advsearch' => 'button_advsearch: text for \'advanced search\' button', + 'help_button_search' => 'button_search: text for \'search\' button', + 'help_centerblockfooter-span' => 'centerblockfooter-span:', + 'help_comments_with_count' => 'comments_with_count: comments with count', + 'help_contributedby_user' => 'contributedby_user: contributer of the story', + 'help_copyright_notice' => 'copyright_notice: notice of your copyright', + 'help_css_url' => 'css_url: URL to css file', + 'help_datetime' => 'datetime: date and time', + 'help_direction' => 'direction: direction to display texts', + 'help_edit_link' => 'edit_link: link for editing the story', + 'help_email_icon' => 'email_icon: icon for \'email this story to friends', + 'help_end_comments_anchortag' => 'end_comments_anchortag: end tag for comments', + 'help_end_contributedby_anchortag' => 'end_contributedby_anchortag: end tag for contributer', + 'help_end_storylink_anchortag' => 'end_storylink_anchortag: end tag for story links', + 'help_end_trackbacks_anchortag' => 'end_trackbacks_anchortag: end tag for trackbacks', + 'help_execution_textandtime' => 'execution_textandtime: text to display execution time', + 'help_feed_url' => 'feed_url: URL to feed file', + 'help_geeklog_blocks' => 'geeklog_blocks: place holder for system-default blocks', + 'help_geeklog_url' => 'geeklog_url: URL to geeklog.net', + 'help_lang_contributed_by' => 'lang_contributed_by: text for \'contributed by\'', + 'help_lang_views' => 'lang_views:', + 'help_left_blocks' => 'left_blocks: place holder for left blocks', + 'help_menu_elements' => 'menu_elements: place holder for global menu', + 'help_page_selector' => 'page_selector: place holder for Google-like paging', + 'help_page_title' => 'page_title: title of the page', + 'help_pdf_icon' => 'pdf_icon: icon for pdf', + 'help_plg_headercode' => 'plg_headercode: JavaScript code plugins put into HTML header', + 'help_post_comment_link' => 'post_comment_link: link to post a comment', + 'help_powered_by' => 'powered_by: text for \'powered_by\'', + 'help_print_icon' => 'print_icon: icon for printing', + 'help_readmore_link' => 'readmore_link: link to \'Read more\'', + 'help_right_blocks' => 'right_blocks: place holder for right blocks', + 'help_site_logo' => 'site_logo: URL to your site logo', + 'help_site_name' => 'site_name: name of your site', + 'help_site_slogan' => 'site_slogan: slogan your site shouts', + 'help_site_url' => 'site_url: URL to your site', + 'help_start_comments_anchortag' => 'start_comments_anchortag: start tag for comments', + 'help_start_contributedby_anchortag' => 'start_contributedby_anchortag: start tag for contributer', + 'help_start_storylink_anchortag' => 'start_storylink_anchortag: start tag for story links', + 'help_start_trackbacks_anchortag' => 'start_trackbacks_anchortag: start tag for trackbacks', + 'help_story_anchortag_and_image' => 'story_anchortag_and_image: tag for story and image', + 'help_story_date' => 'story_date: date and time when the artcile was posted', + 'help_story_hits' => 'story_hits: how many times the story was read', + 'help_story_introtext' => 'story_introtext: introduction of the story', + 'help_story_title' => 'story_title: the title of the story', + 'help_theme' => 'theme: name of theme your Geeklog uses', + 'help_trackbacks_with_count' => 'trackbacks_with_count: trackbacks with count', + 'help_welcome_msg' => 'welcome_msg: message displayed at the top of your site', + 'style.css' => 'Style Sheet(style.css)', + 'style_jp.css' => 'Style Sheet(stlye_jp.css)', + 'style_forum.css' => 'Style Sheet(stlye_forum.css)', + 'header.thtml' => 'Header', + 'footer.thtml' => 'Footer', + 'leftblocks.thtml' => 'Left Blocks', + 'blockheader-left.thtml' => 'Left Block Header', + 'blockfooter-left.thtml' => 'Left Block Footer', + 'rightblocks.thtml' => 'Right Blocks', + 'blockheader-right.thtml' => 'Right Block Header', + 'blockfooter-right.thtml' => 'Right Block Footer', + 'blockheader-list.thtml' => 'Block Header with list (GL-1.5.0+)', + 'blockfooter-list.thtml' => 'Block Footer with list (GL-1.5.0+)', + 'storytext.thtml' => 'Story Text', + 'featuredstorytext.thtml' => 'Featured Story Text', + 'archivestorytext.thtml' => 'Archived Story Text', + 'article/article.thtml' => 'Article', + 'article/printable.thtml' => 'Article (Printable)', + 'menuitem.thtml' => 'Menu Item', + 'menuitem_last.thtml' => 'Menu Item (Last)', + 'menuitem_none.thtml' => 'Menu Item (None)', + 'list.thtml' => 'List', + 'listitem.thtml' => 'List Item', + 'loginform.thtml' => 'Login Form', + 'profiles/contactuserform.thtml' => 'Contact User Form', + 'profiles/contactauthorform.thtml' => 'Contact Author Form', + 'preferences/profile.thtml' => 'Profile (Preference)', + 'users/profile.thtml' => 'Profile (Users)', + 'search/searchform.thtml' => 'Search Form', + 'search/searchresults.thtml' => 'Search Results', + 'submit/submitevent.thtml' => 'Submit Event', + 'submit/submitloginrequired.thtml' => 'Submit Login Required', + 'submit/submitstory.thtml' => 'Submit Story by user (GL-1.5.0+)', + 'submit/submitstory_advacned.thtml' => 'Submit Story by user (Advanced Editor) (GL-1.5.0+)', + 'users/newpassword.thtml' => 'New Password', + 'users/getpasswordform.thtml' => 'Get Password Form', + 'users/loginform.thtml' => 'Login Form', + 'users/registrationform.thtml' => 'Registration Form', + 'users/storyrow.thtml' => 'Story Row', + 'users/commentrow.thtml' => 'Comment Row', + + 'menu_admin_home' => 'Admin HOME', + 'menu_file' => 'Files', + 'menu_image' => 'Images', + + 'help_page_site_splitter' => 'page_site_splitter: ?', + 'help_lang_attribute' => 'lang_attribute: lang attribute', + 'help_xhtml' => 'xhtml: tag for XHTML', + 'help_rel_links' => 'rel_links: ?', + 'help_block_help' => 'block_help: Block Help', + 'help_block_title' => 'block_title: Block Title', + 'help_contributedby_author' => 'contributedby_author: ?', + 'help_plugin_itemdisplay' => 'plugin_itemdisplay: ', + 'help_edit_icon' => 'edit_icon: Icon for editing', + 'help_story_title_link' => 'story_title_link: Link to Story Title', + 'help_story_bodytext' => 'story_bodytext: Body text of Story', + 'help_commentbar' => 'commentbar: Comment Bae', + 'help_whats_related' => 'whats_related: What\'s Related', + 'help_formatted_article' => 'formatted_article: Formated Article', + 'help_story_options' => 'story_options: Story Options', + 'help_trackback' => 'trackback: Trackback', + 'help_article_url' => 'article_url: URL of Article', + 'help_story_author' => 'story_author: Story Author', + 'help_lang_contributedby' => 'lang_contributedby: [L]Contributed By', + 'help_menuitem_text' => 'menuitem_text: Text of Menu Item', + 'help_menuitem_url' => 'menuitem_url: URL of Menu Item', + 'help_list_class' => 'list_class: Class of List', + 'help_list_items' => 'list_items: List Items', + 'help_list_item' => 'list_item: List Item', + 'help_lang_forgetpassword' => 'lang_forgetpassword: [L]Forget Password?', + 'help_lang_username' => 'lang_username: [L]User Name', + 'help_lang_login' => 'lang_login: [L]Login', + 'help_openid_login' => 'openid_login: Login with OpenID', + 'help_lang_password' => 'lang_password: [L]Password', + 'help_services' => 'services: Services', + 'help_lang_signup' => 'lang_signup: [L]Signup', + 'help_captcha' => 'captcha: CAPTCHA', + 'help_lang_subject' => 'lang_subject: [L]Subject', + 'help_message' => 'message: Message', + 'help_useremail' => 'useremail: User Email', + 'help_lang_description' => 'lang_description: [L]Description', + 'help_lang_submit' => 'lang_submit: [L]Submit', + 'help_username' => 'username: User Name', + 'help_lang_message' => 'lang_message: [L]Message', + 'help_lang_useremail' => 'lang_useremail: [L]User Email', + 'help_subject' => 'subject: Subject', + 'help_lang_nohtml' => 'lang_nohtml: [L]No HTML', + 'help_uid' => 'uid: User ID', + 'help_lang_fromname' => 'lang_fromname: [L]Name of Email Sender', + 'help_lang_toname' => 'lang_toname: [L]Name of Email Recipient', + 'help_toname' => 'toname: Recipient', + 'help_email' => 'email: Email', + 'help_lang_sendmessage' => 'lang_sendmessage: [L]Send Message', + 'help_lang_warning' => 'lang_warning: [L]Warning', + 'help_start_block_mailstory2friend' => 'start_block_mailstory2friend: Start of Block of Mail Story to Friend', + 'help_end_block' => 'end_block: End of Block', + 'help_lang_shortmessage' => 'lang_shortmessage: [L]Message', + 'help_name' => 'name: Name', + 'help_story_id' => 'story_id: Story ID', + 'help_lang_fromemailaddress' => 'lang_fromemailaddress: [L]Email Address of Sender', + 'help_lang_toemailaddress' => 'lang_toemailaddress: [L]Email Address of Recipient', + 'help_shortmsg' => 'shortmsg: Message', + 'help_toemail' => 'toemail: Email Address of Recipient', +); + +// Localization of the Admin Configuration UI +$LANG_configsections['themedit'] = array( + 'label' => 'Theme Editor', + 'title' => 'Theme Editor Config' +); + +/** +* For Config UI +*/ +$LANG_confignames['themedit'] = array( + 'enable_all_themes' => 'Allow editing all themes', + 'enable_all_files' => 'Allow editing all files', + 'allowed_themes' => 'Themes allowed to be edited', + 'allowed_files' => 'Files allowed to be edited', + 'resync_database' => 'Resync method', + 'allow_upload' => 'Allow uploading files', + 'image_width' => 'Width of thumbnail images in pixels', + 'image_height' => 'Height of thumbnail images in pixels', + 'image_max_col' => 'Num of columns of thumbnail images', + 'upload_max_size' => 'Maximum size of files to be uploaded in bytes', + 'enable_csrf_protection' => 'Enable CSRF protection', +); + +$LANG_configsubgroups['themedit'] = array( + 'sg_main' => 'Main' +); + +$LANG_fs['themedit'] = array( + 'fs_main' => 'Main Config', +); + +// Note: entries 0, 1, 9, and 12 are the same as in $LANG_configselects['Core'] +$LANG_configselects['themedit'] = array( + 0 => array('Yes' => true, 'No' => false), + 1 => array( + 'Resync manually' => 'manual', 'Resync Automatically' => 'auto', 'Do not resync' => 'ignore' + ), + +); Added: trunk/plugins/themedit/language/english_utf-8.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/language/english_utf-8.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,278 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------| +// | geeklog/plugins/themedit/language/english_utf-8.php | +// +---------------------------------------------------------------------------| +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------| +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA| +// | | +// +---------------------------------------------------------------------------| + +$LANG_CHARSET = 'utf-8'; + +$LANG_THM = array( + 'plugin' => 'Plugin', + 'access_denied' => 'Access Denied', + 'access_denied_msg' => 'Only Root Users have Access to this Page. Your user name and IP have been recorded.', + 'admin' => 'Theme Editor', + 'install_header' => 'Install/Uninstall Plugin', + 'installed' => 'The Plugin is Installed', + 'uninstalled' => 'The Plugin is Not Installed', + 'install_success' => 'Installation Successful', + 'install_failed' => 'Installation Failed -- See your error log to find out why.', + 'uninstall_msg' => 'Plugin Successfully Uninstalled', + 'install' => 'Install', + 'uninstall' => 'UnInstall', + 'warning' => 'Warning! Plugin is still Enabled', + 'enabled' => 'Disable plugin before uninstalling.', + 'readme' => 'STOP! Before you press install please read the ', + 'installdoc' => 'Install Document.', + 'installdoc_ja' => 'Install Document (Japanese).', + 'menu_label' => 'Theme Editor', + 'cc_label' => 'Theme Editor', + 'script_disabled' => 'JavaScript is disabled. For better functionality, please set JavaScript on.', + 'theme_edited' => 'Current Theme', + 'file_edited' => 'Current File', + 'select' => 'Select', + 'preview' => 'Preview', + 'save' => 'Save', + 'image' => 'Image', + 'upload' => 'Upload', + 'upload_header' => 'Themedit - image', + 'return_to_editor' => 'Return to theme editor', + 'change' => 'Change', + 'file_too_large' => 'The file is too large.', + 'file_type_unsupported' => 'The file type is not supported.', + 'upload_success' => 'The file was successfully uploaded.', + 'upload_fail' => 'The file was NOT uploaded.', + 'upload_attack' => 'Possible file upload attack.', + 'delete' => 'Delete all checked files', + 'delete_success' => '%s file(s) were successfully deleted.', + 'delete_fail' => '%s file(s) were NOT deleted.', + 'dir' => 'Current directory', + 'file' => 'File to upload (jpg, jpeg, png, gif)', + 'submit' => 'Submit', + 'dest' => 'Destination', + 'init' => 'Initialize', + 'vars_available' => 'Template Vars Available', + 'save_success' => 'Saved the file successfully.', + 'save_fail' => 'Error: coludn\'t save the file.', + 'init_success' => 'Initialized the file successfully.', + 'init_fail' => 'Error: coludn\'t initialize the file.', + 'not_writable' => 'This file is not writable or does not exist.', + 'file_changed' => "Themes and/or files are added and/or deleted. To update the information stored in the database accordingly, click <a href='%s'>here</a>.", + 'help_advanced_editor' => 'advanced_editor: code to invoke FCKeditor', + 'help_button_advsearch' => 'button_advsearch: text for \'advanced search\' button', + 'help_button_search' => 'button_search: text for \'search\' button', + 'help_centerblockfooter-span' => 'centerblockfooter-span:', + 'help_comments_with_count' => 'comments_with_count: comments with count', + 'help_contributedby_user' => 'contributedby_user: contributer of the story', + 'help_copyright_notice' => 'copyright_notice: notice of your copyright', + 'help_css_url' => 'css_url: URL to css file', + 'help_datetime' => 'datetime: date and time', + 'help_direction' => 'direction: direction to display texts', + 'help_edit_link' => 'edit_link: link for editing the story', + 'help_email_icon' => 'email_icon: icon for \'email this story to friends', + 'help_end_comments_anchortag' => 'end_comments_anchortag: end tag for comments', + 'help_end_contributedby_anchortag' => 'end_contributedby_anchortag: end tag for contributer', + 'help_end_storylink_anchortag' => 'end_storylink_anchortag: end tag for story links', + 'help_end_trackbacks_anchortag' => 'end_trackbacks_anchortag: end tag for trackbacks', + 'help_execution_textandtime' => 'execution_textandtime: text to display execution time', + 'help_feed_url' => 'feed_url: URL to feed file', + 'help_geeklog_blocks' => 'geeklog_blocks: place holder for system-default blocks', + 'help_geeklog_url' => 'geeklog_url: URL to geeklog.net', + 'help_lang_contributed_by' => 'lang_contributed_by: text for \'contributed by\'', + 'help_lang_views' => 'lang_views:', + 'help_left_blocks' => 'left_blocks: place holder for left blocks', + 'help_menu_elements' => 'menu_elements: place holder for global menu', + 'help_page_selector' => 'page_selector: place holder for Google-like paging', + 'help_page_title' => 'page_title: title of the page', + 'help_pdf_icon' => 'pdf_icon: icon for pdf', + 'help_plg_headercode' => 'plg_headercode: JavaScript code plugins put into HTML header', + 'help_post_comment_link' => 'post_comment_link: link to post a comment', + 'help_powered_by' => 'powered_by: text for \'powered_by\'', + 'help_print_icon' => 'print_icon: icon for printing', + 'help_readmore_link' => 'readmore_link: link to \'Read more\'', + 'help_right_blocks' => 'right_blocks: place holder for right blocks', + 'help_site_logo' => 'site_logo: URL to your site logo', + 'help_site_name' => 'site_name: name of your site', + 'help_site_slogan' => 'site_slogan: slogan your site shouts', + 'help_site_url' => 'site_url: URL to your site', + 'help_start_comments_anchortag' => 'start_comments_anchortag: start tag for comments', + 'help_start_contributedby_anchortag' => 'start_contributedby_anchortag: start tag for contributer', + 'help_start_storylink_anchortag' => 'start_storylink_anchortag: start tag for story links', + 'help_start_trackbacks_anchortag' => 'start_trackbacks_anchortag: start tag for trackbacks', + 'help_story_anchortag_and_image' => 'story_anchortag_and_image: tag for story and image', + 'help_story_date' => 'story_date: date and time when the artcile was posted', + 'help_story_hits' => 'story_hits: how many times the story was read', + 'help_story_introtext' => 'story_introtext: introduction of the story', + 'help_story_title' => 'story_title: the title of the story', + 'help_theme' => 'theme: name of theme your Geeklog uses', + 'help_trackbacks_with_count' => 'trackbacks_with_count: trackbacks with count', + 'help_welcome_msg' => 'welcome_msg: message displayed at the top of your site', + 'style.css' => 'Style Sheet(style.css)', + 'style_jp.css' => 'Style Sheet(stlye_jp.css)', + 'style_forum.css' => 'Style Sheet(stlye_forum.css)', + 'header.thtml' => 'Header', + 'footer.thtml' => 'Footer', + 'leftblocks.thtml' => 'Left Blocks', + 'blockheader-left.thtml' => 'Left Block Header', + 'blockfooter-left.thtml' => 'Left Block Footer', + 'rightblocks.thtml' => 'Right Blocks', + 'blockheader-right.thtml' => 'Right Block Header', + 'blockfooter-right.thtml' => 'Right Block Footer', + 'blockheader-list.thtml' => 'Block Header with list (GL-1.5.0+)', + 'blockfooter-list.thtml' => 'Block Footer with list (GL-1.5.0+)', + 'storytext.thtml' => 'Story Text', + 'featuredstorytext.thtml' => 'Featured Story Text', + 'archivestorytext.thtml' => 'Archived Story Text', + 'article/article.thtml' => 'Article', + 'article/printable.thtml' => 'Article (Printable)', + 'menuitem.thtml' => 'Menu Item', + 'menuitem_last.thtml' => 'Menu Item (Last)', + 'menuitem_none.thtml' => 'Menu Item (None)', + 'list.thtml' => 'List', + 'listitem.thtml' => 'List Item', + 'loginform.thtml' => 'Login Form', + 'profiles/contactuserform.thtml' => 'Contact User Form', + 'profiles/contactauthorform.thtml' => 'Contact Author Form', + 'preferences/profile.thtml' => 'Profile (Preference)', + 'users/profile.thtml' => 'Profile (Users)', + 'search/searchform.thtml' => 'Search Form', + 'search/searchresults.thtml' => 'Search Results', + 'submit/submitevent.thtml' => 'Submit Event', + 'submit/submitloginrequired.thtml' => 'Submit Login Required', + 'submit/submitstory.thtml' => 'Submit Story by user (GL-1.5.0+)', + 'submit/submitstory_advacned.thtml' => 'Submit Story by user (Advanced Editor) (GL-1.5.0+)', + 'users/newpassword.thtml' => 'New Password', + 'users/getpasswordform.thtml' => 'Get Password Form', + 'users/loginform.thtml' => 'Login Form', + 'users/registrationform.thtml' => 'Registration Form', + 'users/storyrow.thtml' => 'Story Row', + 'users/commentrow.thtml' => 'Comment Row', + + 'menu_admin_home' => 'Admin HOME', + 'menu_file' => 'Files', + 'menu_image' => 'Images', + + 'help_page_site_splitter' => 'page_site_splitter: ?', + 'help_lang_attribute' => 'lang_attribute: lang attribute', + 'help_xhtml' => 'xhtml: tag for XHTML', + 'help_rel_links' => 'rel_links: ?', + 'help_block_help' => 'block_help: Block Help', + 'help_block_title' => 'block_title: Block Title', + 'help_contributedby_author' => 'contributedby_author: ?', + 'help_plugin_itemdisplay' => 'plugin_itemdisplay: ', + 'help_edit_icon' => 'edit_icon: Icon for editing', + 'help_story_title_link' => 'story_title_link: Link to Story Title', + 'help_story_bodytext' => 'story_bodytext: Body text of Story', + 'help_commentbar' => 'commentbar: Comment Bae', + 'help_whats_related' => 'whats_related: What\'s Related', + 'help_formatted_article' => 'formatted_article: Formated Article', + 'help_story_options' => 'story_options: Story Options', + 'help_trackback' => 'trackback: Trackback', + 'help_article_url' => 'article_url: URL of Article', + 'help_story_author' => 'story_author: Story Author', + 'help_lang_contributedby' => 'lang_contributedby: [L]Contributed By', + 'help_menuitem_text' => 'menuitem_text: Text of Menu Item', + 'help_menuitem_url' => 'menuitem_url: URL of Menu Item', + 'help_list_class' => 'list_class: Class of List', + 'help_list_items' => 'list_items: List Items', + 'help_list_item' => 'list_item: List Item', + 'help_lang_forgetpassword' => 'lang_forgetpassword: [L]Forget Password?', + 'help_lang_username' => 'lang_username: [L]User Name', + 'help_lang_login' => 'lang_login: [L]Login', + 'help_openid_login' => 'openid_login: Login with OpenID', + 'help_lang_password' => 'lang_password: [L]Password', + 'help_services' => 'services: Services', + 'help_lang_signup' => 'lang_signup: [L]Signup', + 'help_captcha' => 'captcha: CAPTCHA', + 'help_lang_subject' => 'lang_subject: [L]Subject', + 'help_message' => 'message: Message', + 'help_useremail' => 'useremail: User Email', + 'help_lang_description' => 'lang_description: [L]Description', + 'help_lang_submit' => 'lang_submit: [L]Submit', + 'help_username' => 'username: User Name', + 'help_lang_message' => 'lang_message: [L]Message', + 'help_lang_useremail' => 'lang_useremail: [L]User Email', + 'help_subject' => 'subject: Subject', + 'help_lang_nohtml' => 'lang_nohtml: [L]No HTML', + 'help_uid' => 'uid: User ID', + 'help_lang_fromname' => 'lang_fromname: [L]Name of Email Sender', + 'help_lang_toname' => 'lang_toname: [L]Name of Email Recipient', + 'help_toname' => 'toname: Recipient', + 'help_email' => 'email: Email', + 'help_lang_sendmessage' => 'lang_sendmessage: [L]Send Message', + 'help_lang_warning' => 'lang_warning: [L]Warning', + 'help_start_block_mailstory2friend' => 'start_block_mailstory2friend: Start of Block of Mail Story to Friend', + 'help_end_block' => 'end_block: End of Block', + 'help_lang_shortmessage' => 'lang_shortmessage: [L]Message', + 'help_name' => 'name: Name', + 'help_story_id' => 'story_id: Story ID', + 'help_lang_fromemailaddress' => 'lang_fromemailaddress: [L]Email Address of Sender', + 'help_lang_toemailaddress' => 'lang_toemailaddress: [L]Email Address of Recipient', + 'help_shortmsg' => 'shortmsg: Message', + 'help_toemail' => 'toemail: Email Address of Recipient', +); + +// Localization of the Admin Configuration UI +$LANG_configsections['themedit'] = array( + 'label' => 'Theme Editor', + 'title' => 'Theme Editor Config' +); + +/** +* For Config UI +*/ +$LANG_confignames['themedit'] = array( + 'enable_all_themes' => 'Allow editing all themes', + 'enable_all_files' => 'Allow editing all files', + 'allowed_themes' => 'Themes allowed to be edited', + 'allowed_files' => 'Files allowed to be edited', + 'resync_database' => 'Resync method', + 'allow_upload' => 'Allow uploading files', + 'image_width' => 'Width of thumbnail images in pixels', + 'image_height' => 'Height of thumbnail images in pixels', + 'image_max_col' => 'Num of columns of thumbnail images', + 'upload_max_size' => 'Maximum size of files to be uploaded in bytes', + 'enable_csrf_protection' => 'Enable CSRF protection', +); + +$LANG_configsubgroups['themedit'] = array( + 'sg_main' => 'Main' +); + +$LANG_fs['themedit'] = array( + 'fs_main' => 'Main Config', +); + +// Note: entries 0, 1, 9, and 12 are the same as in $LANG_configselects['Core'] +$LANG_configselects['themedit'] = array( + 0 => array('Yes' => true, 'No' => false), + 1 => array( + 'Resync manually' => 'manual', 'Resync Automatically' => 'auto', 'Do not resync' => 'ignore' + ), + +); Added: trunk/plugins/themedit/language/japanese.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/language/japanese.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,278 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------| +// | geeklog/plugins/themedit/language/japanese.php | +// +---------------------------------------------------------------------------| +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------| +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA| +// | | +// +---------------------------------------------------------------------------| + +$LANG_CHARSET = 'euc-jp'; + +$LANG_THM = array( + 'plugin' => '�ץ饰����', + 'access_denied' => '���������ϵ��ݤ���ޤ�����', + 'access_denied_msg' => '���Υڡ����˥��������Ǥ���Τ�Root�桼��������Ǥ������ʤ��Υ桼����̾��IP���ɥ쥹�ϵ�Ͽ����ޤ�����', + 'admin' => '�ơ��ޥ��ǥ���', + 'install_header' => '�ơ��ޥ��ǥ����ץ饰����Υ��ȡ���/���ȡ���', + 'installed' => '�ơ��ޥ��ǥ����ץ饰����ϥ��ȡ��뤵��Ƥ��ޤ���', + 'uninstalled' => '�ơ��ޥ��ǥ����ץ饰����ϥ��ȡ��뤵��Ƥ��ޤ���', + 'install_success' => '���ȡ�������ޤ�����', + 'install_failed' => '���ȡ���˼��Ԥ��ޤ������ܺ٤ϥ��顼��(error.log)����������', + 'uninstall_msg' => '�ơ��ޥ��ǥ����ץ饰����ϥ��ȡ��뤵��ޤ�����', + 'install' => '���ȡ���', + 'uninstall' => '���ȡ���', + 'warning' => '�ٹ�!���ơ��ޥ��ǥ����ץ饰�����ͭ��ʤޤޤǤ���', + 'enabled' => '���ȡ��뤹����ˡ��ơ��ޥ��ǥ����ץ饰�����̵��ˤ��Ƥ��������', + 'readme' => '���ä��Ԥä�!���֥��ȡ���פ�å�������ˡ����ɤߤ��������', + 'installdoc' => '���ȡ������ʱѸ��', + 'installdoc_ja' => '���ȡ����������ܸ��', + 'menu_label' => '�ơ��ޥ��ǥ���', + 'cc_label' => '�ơ��ޥ��ǥ���', + 'script_disabled' => 'JavaScript��̵��ˤʤäƤ��ޤ�����������夵����ˤϡ�JavaScript��ͭ��ˤ��Ƥ��������', + 'theme_edited' => '�Խ���Υơ���', + 'file_edited' => '�Խ���Υե�����', + 'select' => '���', + 'preview' => '�ץ�ӥ塼', + 'save' => '��¸', + 'image' => '����', + 'upload' => '���åץ���', + 'upload_header' => '�ơ��ޥ��ǥ��� - ����', + 'return_to_editor' => '�ơ��ޤ��Խ������', + 'change' => '�ѹ�', + 'file_too_large' => '�ե����뤬�礭�����ޤ���', + 'file_type_unsupported' => '���Υե����륿���פϥ��ݡ��Ȥ���Ƥ��ޤ���', + 'upload_success' => '���åץ��ɤ����ޤ�����', + 'upload_fail' => '���åץ��ɤ˼��Ԥ��ޤ�����', + 'upload_attack' => '�ե����륢�åץ��ɹ��⤬�Ԥ�줿��ǽ�������ޤ���', + 'delete' => '����å������ե�����٤ƺ��', + 'delete_success' => '%s �ĤΥե��������ޤ�����', + 'delete_fail' => '%s �ĤΥե��������Ǥ��ޤ���Ǥ�����', + 'dir' => '���ߤΥǥ��쥯�ȥ�', + 'file' => '���åץ��ɤ���ե����� (jpg, jpeg, png, gif)', + 'submit' => '��', + 'dest' => '���åץ�����', + 'init' => '���������᤹', + 'vars_available' => '���Ѳ�ǽ�ʥƥ�ץ졼���ѿ�', + 'save_success' => '�ե��������¸���ޤ�����', + 'save_fail' => '���顼���ե��������¸�Ǥ��ޤ���Ǥ�����', + 'init_success' => '�ե��������ޤ�����', + 'init_fail' => '���顼���ե��������Ǥ��ޤ���Ǥ�����', + 'not_writable' => '���Υե�������Խ��ػߤˤʤäƤ��뤫��¸�ߤ��Ƥ��ޤ���', + 'file_changed' => '�ơ��ޤʤ����ե����뤬�ɲá��ѹ�����Ƥ��ޤ����ǡ����١����ξ��������ˤϡ�<a href="%s">����</a>��å����Ƥ��������', + 'help_advanced_editor' => 'advanced_editor: ���ɥХȥ��ǥ�����ư���뤿��Υ�����', + 'help_button_advsearch' => 'button_advsearch: \'advanced search\'������', + 'help_button_search' => 'button_search: text for \'search\'������', + 'help_centerblockfooter-span' => 'centerblockfooter-span:', + 'help_comments_with_count' => 'comments_with_count: �����Ȥ��ο�', + 'help_contributedby_user' => 'contributedby_user: �������Ƽ�', + 'help_copyright_notice' => 'copyright_notice: ���ԡ��饤��ɽ��', + 'help_css_url' => 'css_url: CSS�ե������URL', + 'help_datetime' => 'datetime: ���ߤ����', + 'help_direction' => 'direction: �ƥ����Ȥ�ɽ���������', + 'help_edit_link' => 'edit_link: ������Խ����뤿��Υ��', + 'help_email_icon' => 'email_icon: ��ͧ���˥��Ƕ�����פΥ�������', + 'help_end_comments_anchortag' => 'end_comments_anchortag: �����ȥ֥�å��ν�λ����', + 'help_end_contributedby_anchortag' => 'end_contributedby_anchortag: ��Ƽԥ֥�å��ν�λ����', + 'help_end_storylink_anchortag' => 'end_storylink_anchortag: ��Ϣ����ʥ�˥֥�å��ν�λ����', + 'help_end_trackbacks_anchortag' => 'end_trackbacks_anchortag: �ȥ�å��Хå��֥�å��ν�λ����', + 'help_execution_textandtime' => 'execution_textandtime: �¹Ի��֤�ɽ������ƥ�����', + 'help_feed_url' => 'feed_url: �ե����ɥե������URL', + 'help_geeklog_blocks' => 'geeklog_blocks: �����ƥ�ǥե���ȤΥ֥�å��Υץ졼���ۥ���', + 'help_geeklog_url' => 'geeklog_url: Geeklog�ܲ�(geeklog.net)��URL', + 'help_lang_contributed_by' => 'lang_contributed_by: \'contributed by\'������', + 'help_lang_views' => 'lang_views:', + 'help_left_blocks' => 'left_blocks: ���֥�å��Υץ졼���ۥ���', + 'help_menu_elements' => 'menu_elements: ��������ΤΥ�˥塼�Υץ졼���ۥ���', + 'help_page_selector' => 'page_selector: Google��ڡ����Υץ졼���ۥ���', + 'help_page_title' => 'page_title: �ڡ����Υ����ȥ�', + 'help_pdf_icon' => 'pdf_icon: pdf��������', + 'help_plg_headercode' => 'plg_headercode: HTML�Υإå�����������JavaScript������', + 'help_post_comment_link' => 'post_comment_link: ����������ѥ��', + 'help_powered_by' => 'powered_by: \'powered_by\'������', + 'help_print_icon' => 'print_icon: ����ѥ�������', + 'help_readmore_link' => 'readmore_link: \'�ʸɽ��\'�ѥ��', + 'help_right_blocks' => 'right_blocks: ���֥�å��Υץ졼���ۥ���', + 'help_site_logo' => 'site_logo: �����ȤΥ���URL', + 'help_site_name' => 'site_name: ������̾', + 'help_site_slogan' => 'site_slogan: �����ȤΥ�������', + 'help_site_url' => 'site_url: �����Ȥ�URL', + 'help_start_comments_anchortag' => 'start_comments_anchortag: �����ȥ֥�å��γ��ϥ���', + 'help_start_contributedby_anchortag' => 'start_contributedby_anchortag: ��Ƽԥ֥�å��γ��ϥ���', + 'help_start_storylink_anchortag' => 'start_storylink_anchortag: ��Ϣ����ʥ�˥֥�å��γ��ϥ���', + 'help_start_trackbacks_anchortag' => 'start_trackbacks_anchortag: �ȥ�å��Хå��֥�å��γ��ϥ���', + 'help_story_anchortag_and_image' => 'story_anchortag_and_image: ������Ȳ���', + 'help_story_date' => 'story_date: �����������', + 'help_story_hits' => 'story_hits: �����ɽ�����', + 'help_story_introtext' => 'story_introtext: �����Ƴ����', + 'help_story_title' => 'story_title: ����Υ����ȥ�', + 'help_theme' => 'theme: Geeklog�����Ѥ��Ƥ���ơ���̾', + 'help_trackbacks_with_count' => 'trackbacks_with_count: �ȥ�å��Хå��Ȥ��ο�', + 'help_welcome_msg' => 'welcome_msg: �����Ȥξ����ɽ�������֤褦�����פΥƥ�����', + 'header.thtml' => '�إå�', + 'footer.thtml' => '�եå�', + 'leftblocks.thtml' => '���֥�å�', + 'blockheader-left.thtml' => '���֥�å��Υإå�', + 'blockfooter-left.thtml' => '���֥�å��Υեå�', + 'rightblocks.thtml' => '���֥�å�', + 'blockheader-right.thtml' => '���֥�å��Υإå�', + 'blockfooter-right.thtml' => '���֥�å��Υեå�', + 'blockheader-list.thtml' => 'list����Υ֥�å��إå�(GL-1.5.0�ʹ�)', + 'blockfooter-list.thtml' => 'list����Υ֥�å��եå�(GL-1.5.0�ʹ�)', + 'storytext.thtml' => '�������ʸ', + 'featuredstorytext.thtml' => '���ܵ������ʸ', + 'archivestorytext.thtml' => '���������ֵ������ʸ', + 'article/article.thtml' => '����', + 'article/printable.thtml' => '����ʰ���ѡ�', + 'menuitem.thtml' => '��˥塼����', + 'menuitem_last.thtml' => '��˥塼���ܡʺǸ��', + 'menuitem_none.thtml' => '��˥塼���ܡʤʤ���', + 'list.thtml' => '�ꥹ��', + 'listitem.thtml' => '�ꥹ�ȹ���', + 'loginform.thtml' => '������ե�����', + 'style.css' => '�������륷����(stlye.css)', + 'style_jp.css' => '�������륷����(stlye_jp.css)', + 'style_forum.css' => '�������륷����(stlye_forum.css)', + 'profiles/contactuserform.thtml' => '�桼��Ϣ���ѥե�����', + 'profiles/contactauthorform.thtml' => '��Ƽ�Ϣ���ѥե�����', + 'preferences/profile.thtml' => '�Ŀ;���������', + 'users/profile.thtml' => '�Ŀ;���ʥ桼����', + 'search/searchform.thtml' => '����ե�����', + 'search/searchresults.thtml' => '������', + 'submit/submitevent.thtml' => '���٥�����', + 'submit/submitloginrequired.thtml' => '��Ƥ���ˤ��ץ�����', + 'submit/submitstory.thtml' => '�桼���ˤ�뵭�����(GL-1.5.0�ʹ�)', + 'submit/submitstory_advacned.thtml' => '�桼���ˤ�뵭����ơʥ��ɥХȥ��ǥ�����(GL-1.5.0�ʹ�)', + 'users/newpassword.thtml' => '�����ѥ����', + 'users/getpasswordform.thtml' => '�ѥ���ɼ��ե�����', + 'users/loginform.thtml' => '������ե�����', + 'users/registrationform.thtml' => '��Ͽ�ե�����', + 'users/storyrow.thtml' => '�������', + 'users/commentrow.thtml' => '�����Ȥ���', + + 'menu_admin_home' => '��ƴ���', + 'menu_file' => '�ե������Խ�', + 'menu_image' => '�������', + + 'help_page_site_splitter' => 'page_site_splitter: ?', + 'help_lang_attribute' => 'lang_attribute: lang°�', + 'help_xhtml' => 'xhtml: XHTML���б����뤿��Υ���', + 'help_rel_links' => 'rel_links: ?', + 'help_block_help' => 'block_help: �֥�å��Υإ��', + 'help_block_title' => 'block_title: �֥�å��Υ����ȥ�', + 'help_contributedby_author' => 'contributedby_author: ?', + 'help_plugin_itemdisplay' => 'plugin_itemdisplay: ', + 'help_edit_icon' => 'edit_icon: �Խ��ѥ�������', + 'help_story_title_link' => 'story_title_link: ����Υ����ȥ�ؤΥ��', + 'help_story_bodytext' => 'story_bodytext: ������ʸ', + 'help_commentbar' => 'commentbar: �����ȥС�', + 'help_whats_related' => 'whats_related: ��Ϣ����', + 'help_formatted_article' => 'formatted_article: �ե����ޥåȺѤߤε���', + 'help_story_options' => 'story_options: ����Υ��ץ����', + 'help_trackback' => 'trackback: �ȥ�å��Хå�', + 'help_article_url' => 'article_url: �����URL', + 'help_story_author' => 'story_author: ��Ƽ�̾', + 'help_lang_contributedby' => 'lang_contributedby: ��Ƽ�̾������', + 'help_menuitem_text' => 'menuitem_text: ��˥塼���ܤΥ�٥�', + 'help_menuitem_url' => 'menuitem_url: ��˥塼���ܤ�URL', + 'help_list_class' => 'list_class: �ꥹ�ȤΥ��饹', + 'help_list_items' => 'list_items: �ꥹ�Ȥ������', + 'help_list_item' => 'list_item: �ꥹ�Ȥι���', + 'help_lang_forgetpassword' => 'lang_forgetpassword: �֥ѥ���ɤ�˺�줿�פ�����', + 'help_lang_username' => 'lang_username: �֥桼��̾�פ�����', + 'help_lang_login' => 'lang_login: �֥�����פ�����', + 'help_openid_login' => 'openid_login: OpenID�ǥ�����', + 'help_lang_password' => 'lang_password: �֥ѥ���ɡפ�����', + 'help_services' => 'services: �����ӥ�', + 'help_lang_signup' => 'lang_signup: ����Ͽ����פ�����', + 'help_captcha' => 'captcha: CAPTCHA', + 'help_lang_subject' => 'lang_subject: �ַ�̾�פ�����', + 'help_message' => 'message: ��å�����', + 'help_useremail' => 'useremail: �桼����E��륢�ɥ쥹', + 'help_lang_description' => 'lang_description: ?', + 'help_lang_submit' => 'lang_submit: ����פ�����', + 'help_username' => 'username: �桼��̾', + 'help_lang_message' => 'lang_message: �֥�å������פ�����', + 'help_lang_useremail' => 'lang_useremail: �֥桼����E��륢�ɥ쥹�פ�����', + 'help_subject' => 'subject: ��̾', + 'help_lang_nohtml' => 'lang_nohtml: ��HTML�ϻȤ��ޤ���פ�����', + 'help_uid' => 'uid: �桼��ID', + 'help_lang_fromname' => 'lang_fromname: �����̾�פ�����', + 'help_lang_toname' => 'lang_toname: �ּ���̾�פ�����', + 'help_toname' => 'toname: ����̾', + 'help_email' => 'email: E���', + 'help_lang_sendmessage' => 'lang_sendmessage: �֥�å����������פ�����', + 'help_lang_warning' => 'lang_warning: �ַٹ�פ�����', + 'help_start_block_mailstory2friend' => 'start_block_mailstory2friend: �֥���ͧ���˶�����ץ֥�å��λϤޤ�', + 'help_end_block' => 'end_block: �֥�å��ν����', + 'help_lang_shortmessage' => 'lang_shortmessage: �֥�å������פ�����', + 'help_name' => 'name: ��̾', + 'help_story_id' => 'story_id: ����ID', + 'help_lang_fromemailaddress' => 'lang_fromemailaddress: ����Ԥ�E��륢�ɥ쥹�פ�����', + 'help_lang_toemailaddress' => 'lang_toemailaddress: �ּ��ͤ�E��륢�ɥ쥹�פ�����', + 'help_shortmsg' => 'shortmsg: ��å�����', + 'help_toemail' => 'toemail: ���ͤ�E��륢�ɥ쥹', +); + +// Localization of the Admin Configuration UI +$LANG_configsections['themedit'] = array( + 'label' => '�ơ��ޥ��ǥ���', + 'title' => '�ơ��ޥ��ǥ���������' +); + +/** +* For Config UI +*/ +$LANG_confignames['themedit'] = array( + 'enable_all_themes' => '���٤ƤΥơ��ޤ��Խ����Ĥ���', + 'enable_all_files' => '���٤ƤΥե�������Խ����Ĥ���', + 'allowed_themes' => '�Խ����Ĥ���ơ���', + 'allowed_files' => '�Խ����Ĥ���ե�����', + 'resync_database' => '�ǡ����١�����Ʊ����ˡ', + 'allow_upload' => '�ե�����Υ��åץ��ɤ��Ĥ���', + 'image_width' => '����͡����������ñ�̡��ԥ������', + 'image_height' => '����͡������ι⤵��ñ�̡��ԥ������', + 'image_max_col' => '����͡����������', + 'upload_max_size' => '���åץ��Ǥ���ե����륵�����ξ�¡�ñ�̡��Х��ȡ�', + 'enable_csrf_protection' => 'CSRF�к��Ԥ�', +); + +$LANG_configsubgroups['themedit'] = array( + 'sg_main' => '�ᥤ��' +); + +$LANG_fs['themedit'] = array( + 'fs_main' => '�ơ��ޥ��ǥ����Υᥤ������', +); + +// Note: entries 0, 1, 9, and 12 are the same as in $LANG_configselects['Core'] +$LANG_configselects['themedit'] = array( + 0 => array('�Ϥ�' => true, '������' => false), + 1 => array( + '��ư��Ʊ��' => 'manual', '��ư��Ʊ��' => 'auto', 'Ʊ��ʤ�' => 'ignore' + ), + +); Added: trunk/plugins/themedit/language/japanese_utf-8.php ============================================================================== --- (empty file) +++ trunk/plugins/themedit/language/japanese_utf-8.php Tue Sep 9 07:24:06 2008 @@ -0,0 +1,278 @@ +<?php + +// +---------------------------------------------------------------------------+ +// | Theme Editor Plugin for Geeklog - The Ultimate Weblog | +// +---------------------------------------------------------------------------| +// | geeklog/plugins/themedit/language/japanese_utf-8.php | +// +---------------------------------------------------------------------------| +// | Copyright (C) 2006-2008 - geeklog AT mystral-kk DOT net | +// | | +// | Constructed with the Universal Plugin | +// | Copyright (C) 2002 by the following authors: | +// | Tom Willett - twill****@users***** | +// | Blaine Lang - langm****@sympa***** | +// | The Universal Plugin is based on prior work by: | +// | Tony Bibbs - tony****@tonyb***** | +// +---------------------------------------------------------------------------| +// | This program is free software; you can redistribute it and/or | +// | modify it under the terms of the GNU General Public License | +// | as published by the Free Software Foundation; either version 2 | +// | of the License, or (at your option) any later version. | +// | | +// | This program is distributed in the hope that it will be useful, | +// | but WITHOUT ANY WARRANTY; without even the implied warranty of | +// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | +// | GNU General Public License for more details. | +// | | +// | You should have received a copy of the GNU General Public License | +// | along with this program; if not, write to the Free Software | +// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA| +// | | +// +---------------------------------------------------------------------------| + +$LANG_CHARSET = 'utf-8'; + +$LANG_THM = array( + 'plugin' => 'プラグイン', + 'access_denied' => 'アクセスは拒否されました。', + 'access_denied_msg' => 'このページにアクセスできるのはRootユーザーだけで す。あなたのユーザー名とIPアドレスは記録されました。', + 'admin' => 'テーマエディタ', + 'install_header' => 'テーマエディタプラグインのインストール/アンインストー ル', + 'installed' => 'テーマエディタプラグインはインストールされていま す。', + 'uninstalled' => 'テーマエディタプラグインはインストールされていませ ん。', + 'install_success' => 'インストールに成功しました。', + 'install_failed' => 'インストールに失敗しました。詳細はエラーログ (error.log)をご覧ください。', + 'uninstall_msg' => 'テーマエディタプラグインはアンインストールされまし た。', + 'install' => 'インストール', + 'uninstall' => 'アンインストール', + 'warning' => '警告! テーマエディタプラグインは有効なままで す。', + 'enabled' => 'アンインストールする前に、テーマエディタプラグ インを無効にしてください。', + 'readme' => 'ちょっと待って! 「インストール」をクリックする 前に、お読みください:', + 'installdoc' => 'インストール手順書(英語)', + 'installdoc_ja' => 'インストール手順書(日本語)', + 'menu_label' => 'テーマエディタ', + 'cc_label' => 'テーマエディタ', + 'script_disabled' => 'JavaScriptが無効になっています。操作性を向上させる には、JavaScriptを有効にしてください。', + 'theme_edited' => '編集中のテーマ', + 'file_edited' => '編集中のファイル', + 'select' => '選択', + 'preview' => 'プレビュー', + 'save' => '保存', + 'image' => '画像', + 'upload' => 'アップロード', + 'upload_header' => 'テーマエディタ - 画像', + 'return_to_editor' => 'テーマの編集に戻る', + 'change' => '変更', + 'file_too_large' => 'ファイルが大きすぎます。', + 'file_type_unsupported' => 'このファイルタイプはサポートされていません。', + 'upload_success' => 'アップロードに成功しました。', + 'upload_fail' => 'アップロードに失敗しました。', + 'upload_attack' => 'ファイルアップロード攻撃が行われた可能性がありま す。', + 'delete' => 'チェックしたファイルをすべて削除', + 'delete_success' => '%s 個のファイルを削除しました。', + 'delete_fail' => '%s 個のファイルを削除できませんでした。', + 'dir' => '現在のディレクトリ', + 'file' => 'アップロードするファイル (jpg, jpeg, png, gif)', + 'submit' => '送信', + 'dest' => 'アップロード先', + 'init' => '初期設定に戻す', + 'vars_available' => '利用可能なテンプレート変数', + 'save_success' => 'ファイルを保存しました。', + 'save_fail' => 'エラー:ファイルを保存できませんでした。', + 'init_success' => 'ファイルを初期化しました。', + 'init_fail' => 'エラー:ファイルを初期化できませんでした。', + 'not_writable' => 'このファイルは編集禁止になっているか、存在していま せん。', + 'file_changed' => 'テーマないしファイルが追加・変更されています。デー タベースの情報を更新するには、<a href="%s">ここ</a>をクリックしてくださ い。', + 'help_advanced_editor' => 'advanced_editor: アドバンストエディタを起動する ためのコード', + 'help_button_advsearch' => 'button_advsearch: \'advanced search\'の和訳', + 'help_button_search' => 'button_search: text for \'search\'の和訳', + 'help_centerblockfooter-span' => 'centerblockfooter-span:', + 'help_comments_with_count' => 'comments_with_count: コメントその数', + 'help_contributedby_user' => 'contributedby_user: 記事の投稿者', + 'help_copyright_notice' => 'copyright_notice: コピーライト表示', + 'help_css_url' => 'css_url: CSSファイルのURL', + 'help_datetime' => 'datetime: 現在の日時', + 'help_direction' => 'direction: テキストを表示する方向', + 'help_edit_link' => 'edit_link: 記事を編集するためのリンク', + 'help_email_icon' => 'email_icon: 「友だちにメールで教える」のアイコン', + 'help_end_comments_anchortag' => 'end_comments_anchortag: コメントブロック の終了タグ', + 'help_end_contributedby_anchortag' => 'end_contributedby_anchortag: 投稿者 ブロックの終了タグ', + 'help_end_storylink_anchortag' => 'end_storylink_anchortag: 関連情報(リン ク)ブロックの終了タグ', + 'help_end_trackbacks_anchortag' => 'end_trackbacks_anchortag: トラックバッ クブロックの終了タグ', + 'help_execution_textandtime' => 'execution_textandtime: 実行時間を表示する テキスト', + 'help_feed_url' => 'feed_url: フィードファイルのURL', + 'help_geeklog_blocks' => 'geeklog_blocks: システムデフォルトのブロックの プレースホルダー', + 'help_geeklog_url' => 'geeklog_url: Geeklog本家(geeklog.net)のURL', + 'help_lang_contributed_by' => 'lang_contributed_by: \'contributed by\'の和 訳', + 'help_lang_views' => 'lang_views:', + 'help_left_blocks' => 'left_blocks: 左ブロックのプレースホルダー', + 'help_menu_elements' => 'menu_elements: サイト全体のメニューのプレースホ ルダー', + 'help_page_selector' => 'page_selector: Google風ページングのプレースホル ダー', + 'help_page_title' => 'page_title: ページのタイトル', + 'help_pdf_icon' => 'pdf_icon: pdfアイコン', + 'help_plg_headercode' => 'plg_headercode: HTMLのヘッダに挿入される JavaScriptコード', + 'help_post_comment_link' => 'post_comment_link: コメント投稿用リンク', + 'help_powered_by' => 'powered_by: \'powered_by\'の和訳', + 'help_print_icon' => 'print_icon: 印刷用アイコン', + 'help_readmore_link' => 'readmore_link: \'全文表示\'用リンク', + 'help_right_blocks' => 'right_blocks: 右ブロックのプレースホルダー', + 'help_site_logo' => 'site_logo: サイトのロゴのURL', + 'help_site_name' => 'site_name: サイト名', + 'help_site_slogan' => 'site_slogan: サイトのスローガン', + 'help_site_url' => 'site_url: サイトのURL', + 'help_start_comments_anchortag' => 'start_comments_anchortag: コメント ブロックの開始タグ', + 'help_start_contributedby_anchortag' => 'start_contributedby_anchortag: 投 稿者ブロックの開始タグ', + 'help_start_storylink_anchortag' => 'start_storylink_anchortag: 関連情報 (リンク)ブロックの開始タグ', + 'help_start_trackbacks_anchortag' => 'start_trackbacks_anchortag: トラッ クバックブロックの開始タグ', + 'help_story_anchortag_and_image' => 'story_anchortag_and_image: 記事タグ と画像', + 'help_story_date' => 'story_date: 記事の投稿日時', + 'help_story_hits' => 'story_hits: 記事の表示回数', + 'help_story_introtext' => 'story_introtext: 記事の導入部', + 'help_story_title' => 'story_title: 記事のタイトル', + 'help_theme' => 'theme: Geeklogが使用しているテーマ 名', + 'help_trackbacks_with_count' => 'trackbacks_with_count: トラックバッ クとその数', + 'help_welcome_msg' => 'welcome_msg: サイトの上部に表示され る「ようこそ」のテキスト', + 'header.thtml' => 'ヘッダ', + 'footer.thtml' => 'フッタ', + 'leftblocks.thtml' => '左ブロック', + 'blockheader-left.thtml' => '左ブロックのヘッダ', + 'blockfooter-left.thtml' => '左ブロックのフッタ', + 'rightblocks.thtml' => '右ブロック', + 'blockheader-right.thtml' => '右ブロックのヘッダ', + 'blockfooter-right.thtml' => '右ブロックのフッタ', + 'blockheader-list.thtml' => 'list形式のブロックヘッダ(GL-1.5.0以 降)', + 'blockfooter-list.thtml' => 'list形式のブロックフッタ(GL-1.5.0以 降)', + 'storytext.thtml' => '記事の本文', + 'featuredstorytext.thtml' => '注目記事の本文', + 'archivestorytext.thtml' => 'アーカイブ記事の本文', + 'article/article.thtml' => '記事', + 'article/printable.thtml' => '記事(印刷用)', + 'menuitem.thtml' => 'メニュー項目', + 'menuitem_last.thtml' => 'メニュー項目(最後)', + 'menuitem_none.thtml' => 'メニュー項目(なし)', + 'list.thtml' => 'リスト', + 'listitem.thtml' => 'リスト項目', + 'loginform.thtml' => 'ログインフォーム', + 'style.css' => 'スタイルシート(stlye.css)', + 'style_jp.css' => 'スタイルシート(stlye_jp.css)', + 'style_forum.css' => 'スタイルシート(stlye_forum.css)', + 'profiles/contactuserform.thtml' => 'ユーザ連絡用フォーム', + 'profiles/contactauthorform.thtml' => '投稿者連絡用フォーム', + 'preferences/profile.thtml' => '個人情報(設定)', + 'users/profile.thtml' => '個人情報(ユーザ)', + 'search/searchform.thtml' => '検索フォーム', + 'search/searchresults.thtml' => '検索結果', + 'submit/submitevent.thtml' => 'イベント投稿', + 'submit/submitloginrequired.thtml' => '投稿するには要ログイン', + 'submit/submitstory.thtml' => 'ユーザによる記事投稿(GL-1.5.0以降 )', + 'submit/submitstory_advacned.thtml' => 'ユーザによる記事投稿(アドバンスト エディタ)(GL-1.5.0以降)', + 'users/newpassword.thtml' => '新規パスワード', + 'users/getpasswordform.thtml' => 'パスワード取り寄せフォーム', + 'users/loginform.thtml' => 'ログインフォーム', + 'users/registrationform.thtml' => '登録フォーム', + 'users/storyrow.thtml' => '記事の列', + 'users/commentrow.thtml' => 'コメントの列', + + 'menu_admin_home' => '投稿管理', + 'menu_file' => 'ファイル編集', + 'menu_image' => '画像管理', + + 'help_page_site_splitter' => 'page_site_splitter: ?', + 'help_lang_attribute' => 'lang_attribute: lang属性', + 'help_xhtml' => 'xhtml: XHTMLに対応するためのタグ', + 'help_rel_links' => 'rel_links: ?', + 'help_block_help' => 'block_help: ブロックのヘルプ', + 'help_block_title' => 'block_title: ブロックのタイトル', + 'help_contributedby_author' => 'contributedby_author: ?', + 'help_plugin_itemdisplay' => 'plugin_itemdisplay: ', + 'help_edit_icon' => 'edit_icon: 編集用アイコン', + 'help_story_title_link' => 'story_title_link: 記事のタイトルへ のリンク', + 'help_story_bodytext' => 'story_bodytext: 記事本文', + 'help_commentbar' => 'commentbar: コメントバー', + 'help_whats_related' => 'whats_related: 関連情報', + 'help_formatted_article' => 'formatted_article: フォーマット済み の記事', + 'help_story_options' => 'story_options: 記事のオプション', + 'help_trackback' => 'trackback: トラックバック', + 'help_article_url' => 'article_url: 記事のURL', + 'help_story_author' => 'story_author: 投稿者名', + 'help_lang_contributedby' => 'lang_contributedby: 投稿者名の和 訳', + 'help_menuitem_text' => 'menuitem_text: メニュー項目のラベ ル', + 'help_menuitem_url' => 'menuitem_url: メニュー項目のURL', + 'help_list_class' => 'list_class: リストのクラス', + 'help_list_items' => 'list_items: リストの全項目', + 'help_list_item' => 'list_item: リストの項目', + 'help_lang_forgetpassword' => 'lang_forgetpassword: 「パスワードを 忘れた」の和訳', + 'help_lang_username' => 'lang_username: 「ユーザ名」の和訳', + 'help_lang_login' => 'lang_login: 「ログイン」の和訳', + 'help_openid_login' => 'openid_login: OpenIDでログイン', + 'help_lang_password' => 'lang_password: 「パスワード」の和 訳', + 'help_services' => 'services: サービス', + 'help_lang_signup' => 'lang_signup: 「登録する」の和訳', + 'help_captcha' => 'captcha: CAPTCHA', + 'help_lang_subject' => 'lang_subject: 「件名」の和訳', + 'help_message' => 'message: メッセージ', + 'help_useremail' => 'useremail: ユーザのEメールアドレ ス', + 'help_lang_description' => 'lang_description: ?', + 'help_lang_submit' => 'lang_submit: 「送信」の和訳', + 'help_username' => 'username: ユーザ名', + 'help_lang_message' => 'lang_message: 「メッセージ」の和 訳', + 'help_lang_useremail' => 'lang_useremail: 「ユーザのEメールア ドレス」の和訳', + 'help_subject' => 'subject: 件名', + 'help_lang_nohtml' => 'lang_nohtml: 「HTMLは使えません」の 和訳', + 'help_uid' => 'uid: ユーザID', + 'help_lang_fromname' => 'lang_fromname: 「送信者名」の和訳', + 'help_lang_toname' => 'lang_toname: 「受取人名」の和訳', + 'help_toname' => 'toname: 受取人名', + 'help_email' => 'email: Eメール', + 'help_lang_sendmessage' => 'lang_sendmessage: 「メッセージを送 る」の和訳', + 'help_lang_warning' => 'lang_warning: 「警告」の和訳', + 'help_start_block_mailstory2friend' => 'start_block_mailstory2friend: 「 メールで友だちに教える」ブロックの始まり', + 'help_end_block' => 'end_block: ブロックの終わり', + 'help_lang_shortmessage' => 'lang_shortmessage: 「メッセージ」の 和訳', + 'help_name' => 'name: 氏名', + 'help_story_id' => 'story_id: 記事ID', + 'help_lang_fromemailaddress' => 'lang_fromemailaddress: 「送信者の Eメールアドレス」の和訳', + 'help_lang_toemailaddress' => 'lang_toemailaddress: 「受取人の Eメールアドレス」の和訳', + 'help_shortmsg' => 'shortmsg: メッセージ', + 'help_toemail' => 'toemail: 受取人のEメールアドレス', +); + +// Localization of the Admin Configuration UI +$LANG_configsections['themedit'] = array( + 'label' => 'テーマエディタ', + 'title' => 'テーマエディタの設定' +); + +/** +* For Config UI +*/ +$LANG_confignames['themedit'] = array( + 'enable_all_themes' => 'すべてのテーマの編集を許可する', + 'enable_all_files' => 'すべてのファイルの編集を許可する', + 'allowed_themes' => '編集を許可するテーマ', + 'allowed_files' => '編集を許可するファイル', + 'resync_database' => 'データベースの同期方法', + 'allow_upload' => 'ファイルのアップロードを許可する', + 'image_width' => 'サムネール画像の幅(単位:ピクセル)', + 'image_height' => 'サムネール画像の高さ(単位:ピクセル)', + 'image_max_col' => 'サムネール画像の列数', + 'upload_max_size' => 'アップローできるファイルサイズの上限(単 位:バイト)', + 'enable_csrf_protection' => 'CSRF対策を行う', +); + +$LANG_configsubgroups['themedit'] = array( + 'sg_main' => 'メイン' +); + +$LANG_fs['themedit'] = array( + 'fs_main' => 'テーマエディタのメイン設定', +); + +// Note: entries 0, 1, 9, and 12 are the same as in $LANG_configselects['Core'] +$LANG_configselects['themedit'] = array( + 0 => array('はい' => true, 'いいえ' => false), + 1 => array( + '手動で同期' => 'manual', '自動で同期' => 'auto', '同期しない' => 'ignore' + ), + +); Added: trunk/plugins/themedit/templates/admin.thtml ============================================================================== --- (empty file) +++ trunk/plugins/themedit/templates/admin.thtml Tue Sep 9 07:24:06 2008 @@ -0,0 +1,34 @@ +<img src="{temp_site_url}/admin/plugins/themedit/images/themedit.gif" alt="" border="0"> + <b><font size="4"> {temp_header} </font></b> +{temp_preview_code} +<noscript> + {temp_lang_script_disabled} +</noscript> +<form name="theme_editor" id="theme_editor" method="post" action=""> + {temp_sys_message} + <p style="border: solid 1px #7F9DB9; padding: 5px;"> + {temp_lang_theme_edited}: + <select name="thm_theme" onChange="this.form.submit()">{temp_themes}</select> + <noscript> + <input name="dummy" type="submit" value="{temp_lang_select}"{xhtml}> + </noscript> + + {temp_lang_file_edited}: + <select name="thm_file" onChange="this.form.submit()">{temp_files}</select> + <noscript> + <input name="dummy" type="submit" value="{temp_lang_select}"{xhtml}> + </noscript> + </p> + {temp_vars} + <hr{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_preview}"{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_save}"{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_image}"{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_init}"{xhtml}> + <textarea name="theme_contents" id="theme_contents" rows="30" style="width:99%;"{xhtml}>{temp_contents}</textarea><br> + <input name="thm_op" type="submit" value="{temp_lang_preview}"{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_save}"{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_image}"{xhtml}> + <input name="thm_op" type="submit" value="{temp_lang_init}"{xhtml}> + <input name="{temp_token_name}" type="hidden" value="{temp_token_value}"{xhtml}> +</form> Added: trunk/plugins/themedit/templates/cell.thtml ============================================================================== --- (empty file) +++ trunk/plugins/themedit/templates/cell.thtml Tue Sep 9 07:24:06 2008 @@ -0,0 +1,12 @@ +<table style="width: {temp_cell_width}px; height: {temp_cell_height}px; border: solid 1px #9999ff; padding: 0px; border-collapse: collapse;"> + <tr> + <td style="border: none; margin: 0px; padding: 0px; text-align: center; vertical-align: middle; background-color: #ccccff;"> + <a href="{temp_getimage_url}"><img src="{temp_img_src}" style="border: none; margin: 0px; padding: 0px; height: {temp_img_height}px; width: {temp_img_width}px;" title="{temp_filename}" alt=""></a> + </td> + </tr> + <tr> + <td style="border: none; margin: 0px; padding: 0px; height: 12px; color: black; background-color: white; text-align: center;"> + <input name="ch[]" type="checkbox" value="{temp_filename}"{xhtml}>{temp_filename} + </td> + </tr> +</table> Added: trunk/plugins/themedit/templates/install.thtml ============================================================================== --- (empty file) +++ trunk/plugins/themedit/templates/install.thtml Tue Sep 9 07:24:06 2008 @@ -0,0 +1,10 @@ +<a href="{admin_url}"><img src="{img}" border="0"></a> + <b><font size="4"> {install_header} </font></b> +<p>{installmsg1}</p> +<p>{installmsg2}</p> +<p>{readme}<a href="{site_admin_url}/plugins/themedit/readme.html" target="_blank">{installdoc}</a> + <a href="{site_admin_url}/plugins/themedit/readme_ja.html" target="_blank">{installdoc_ja}</a> +<form method='post' action='{cgiurl}'> + <input type='submit' value='{btnmsg}' name='B1'{xhtml}> + <input type='hidden' value='{action}' name='action'{xhtml}> +</form> Added: trunk/plugins/themedit/templates/topmenu.thtml ============================================================================== --- (empty file) +++ trunk/plugins/themedit/templates/topmenu.thtml Tue Sep 9 07:24:06 2008 @@ -0,0 +1,10 @@ +<div class="admin-menu"> + <img src="{icon}" class="admin-menu-icon"{xhtml}> + <div class="admin-menu-items"> + {menu_fields} + </div> + <div class="admin-menu-text"> + {lang_instructions} + </div> + <div class="clearboth"></div> +</div> Added: trunk/plugins/themedit/templates/upload.thtml ============================================================================== --- (empty file) +++ trunk/plugins/themedit/templates/upload.thtml Tue Sep 9 07:24:06 2008 @@ -0,0 +1,36 @@ +<img src="{temp_site_admin_url}/plugins/themedit/images/themedit.gif" alt="" border="0"{xhtml}> + <b><font size="4"> {temp_header} </font></b> <a href="{site_admin_url}/plugins/themedit/index.php?thm_theme={temp_theme}">{temp_lang_return_to_editor}</a> +<noscript> + {temp_lang_script_disabled} +</noscript> + +<form name="theme_uploader" enctype="multipart/form-data" method="post" action=""> + <p style="border: solid 1px #7f9db9; padding: 5px;"> + <input name="MAX_FILE_SIZE" type="hidden" value="{max_upload_size}"{xhtml}> + {temp_lang_file}: <input name="thmfile" type="file"{xhtml}> <input name="submit" type="submit" value="{temp_lang_submit}"{xhtml}> + <input name="thm_theme" type="hidden" value="{thm_theme}"{xhtml}> + <input name="thm_dir" type="hidden" value="{thm_dir}"{xhtml}> {temp_sys_message} + </p> +</form> + +<form name="theme_browser" method="post" action=""> + <p style="border: solid 1px #7f9db9; padding: 5px;"> + {temp_lang_dest}: + <select name="thm_theme" onChange="this.form.submit()">{temp_themes}</select> + <noscript> + <input name="dummy" type="submit" value="{temp_lang_change}"{xhtml}> + </noscript> + {temp_lang_dir}: + <select name="thm_dir" onChange="this.form.submit()">{temp_dirs}</select> + <noscript> + <input name="dummy" type="submit" value="{temp_lang_change}"{xhtml}> + </noscript> + </p> + <hr{xhtml}> + <table id="thm_window" style="color: black; background-color: #cccc99; border: solid 1px #ff9933; width: 100%; padding: 10px;"> + {temp_images} + </table> + <p style="border: solid 1px #7f9db9; padding: 5px;"> + <input name="thm_delete" type="submit" value="{temp_lang_delete}"{xhtml}> + </p> +</form>