diff --git a/class2.php b/class2.php index fa6894a6c..13a94df84 100644 --- a/class2.php +++ b/class2.php @@ -2220,19 +2220,21 @@ class error_handler // global $_E107; - if(isset($_E107['debug'])) + + if(!empty($_E107['debug'])) { $this->debug = true; error_reporting(E_ALL); return; } - if(isset($_E107['cli'])) + + if(!empty($_E107['cli'])) { - error_reporting(E_ALL ^ E_NOTICE); + error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE); return; } - if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== FALSE) || isset($_COOKIE['e107_debug_level']) && strpos($_SERVER['QUERY_STRING'], 'debug=-') !== TRUE ) + if ((isset($_SERVER['QUERY_STRING']) && strpos($_SERVER['QUERY_STRING'], 'debug=') !== false) || isset($_COOKIE['e107_debug_level']) && strpos($_SERVER['QUERY_STRING'], 'debug=-') === false ) { $this->debug = true; error_reporting(E_ALL); diff --git a/comment.php b/comment.php index 8e298d09d..0b406ece6 100644 --- a/comment.php +++ b/comment.php @@ -62,9 +62,9 @@ if(e_AJAX_REQUEST) // TODO improve security } - if(varset($_GET['mode']) == 'delete' && vartrue($_POST['itemid']) && ADMIN) + if(varset($_GET['mode']) == 'delete' && !empty($_POST['id']) && ADMIN) { - $status = e107::getComment()->deleteComment($_POST['itemid']); + $status = e107::getComment()->deleteComment($_POST['id'],$_POST['table'],$_POST['itemid']); $ret['msg'] = ($status) ? 'Ok' : COMLAN_332; $ret['error'] = ($status) ? false : true; echo json_encode($ret); diff --git a/contact.php b/contact.php index 00063b86b..757202ce4 100644 --- a/contact.php +++ b/contact.php @@ -102,7 +102,7 @@ if(isset($_POST['send-contactus'])) } // Check subject line. - if(strlen(trim($subject)) < 2) + if(isset($_POST['subject']) && strlen(trim($subject)) < 2) { $error .= LANCONTACT_13."\\n"; } diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 86cf3ad19..ca4fb2a44 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -103,12 +103,19 @@ class admin_start private $allowed_types = null; private $refresh = false; + private $exit = false; private $deprecated = array(); function __construct() { + if(!getperms('0')) // don't display this tuff to regular admins only main admin. + { + return null; + } + + // Files that can cause comflicts and problems. $this->deprecated = array( e_ADMIN."ad_links.php", e_PLUGIN."tinymce4/e_meta.php", @@ -127,7 +134,10 @@ class admin_start e_PLUGIN."forum/forum_update_check.php", e_PLUGIN."online_extended_menu/online_extended_menu.php", e_PLUGIN."online_extended_menu/images/user.png", - e_PLUGIN."online_extended_menu/languages/English.php" + e_PLUGIN."online_extended_menu/languages/English.php", + e_PLUGIN."pm/sendpm.sc", + e_PLUGIN."pm/shortcodes/", + e_PLUGIN."social/e_header.php" ); @@ -138,18 +148,55 @@ class admin_start $this->deleteDeprecated(); } - $this->checkNewInstall(); + + + + e107::getDb()->db_Mark_Time('Check Paths'); $this->checkPaths(); + e107::getDb()->db_Mark_Time('Check Timezone'); $this->checkTimezone(); + e107::getDb()->db_Mark_Time('Check Writable'); $this->checkWritable(); - $this->checkHtmlarea(); + + e107::getDb()->db_Mark_Time('Check Incompatible Plugins'); $this->checkIncompatiblePlugins(); + + e107::getDb()->db_Mark_Time('Check Filetypes'); $this->checkFileTypes(); + + e107::getDb()->db_Mark_Time('Check Suspect Files'); $this->checkSuspiciousFiles(); + + e107::getDb()->db_Mark_Time('Check Deprecated'); $this->checkDeprecated(); - $this->checkPasswordEncryption(); + + e107::getDb()->db_Mark_Time('Check HTMLArea'); + $this->checkHtmlarea(); + + e107::getDb()->db_Mark_Time('Check Htaccess'); $this->checkHtaccess(); + e107::getDb()->db_Mark_Time('Check Core Update'); + $this->checkCoreUpdate(); + + if($this->exit === true) + { + return null; + } + + e107::getDb()->db_Mark_Time('Check New Install'); + $this->checkNewInstall(); + + e107::getDb()->db_Mark_Time('Check Plugin Update'); + $this->checkPluginUpdate(); + + e107::getDb()->db_Mark_Time('Check Theme Update'); + $this->checkThemeUpdate(); + + e107::getDb()->db_Mark_Time('Check Password Encryption'); + $this->checkPasswordEncryption(); + + if($this->refresh == true) { e107::getRedirect()->go(e_SELF); @@ -197,6 +244,125 @@ class admin_start } + private function checkCoreUpdate() + { + // auto db update + if ('0' != ADMINPERMS) + { + return null; + } + + //$sc = e107::getScBatch('admin'); + //echo $tp->parseTemplate('{ADMIN_COREUPDATE=alert}',true, $sc); + + global $dont_check_update, $e107info; + global $dbupdate, $dbupdatep, $e107cache; + + require_once(e_ADMIN.'update_routines.php'); + + if(update_check() === true) + { + if(e_DEBUG !== true) + { + $this->exit = true; + } + } + + + + } + + + private function checkPluginUpdate() + { + require_once(e_HANDLER.'e_marketplace.php'); + $mp = new e_marketplace(); // autodetect the best method + + $versions = $mp->getVersionList('plugin'); + + $plugins = e107::getPref('plug_installed'); + + if(empty($plugins)) + { + return null; + } + + + $tp = e107::getParser(); + + foreach($plugins as $folder=>$version) + { + + if(!empty($versions[$folder]['version']) && version_compare( $version, $versions[$folder]['version'], '<')) + { + $link = "".$versions[$folder]['name'].""; + + $dl = $mp->getDownloadModal('plugin', $versions[$folder]); + + $caption = LAN_DOWNLOAD.": ".$versions[$folder]['name']." ".$versions[$folder]['version']; + + $lans = array('x'=>$link, 'y'=>LAN_PLUGIN); + $message = $tp->lanVars(LAN_NEWER_VERSION_OF_X, $lans); + $message .= " ".$tp->toGlyph('fa-cloud-download').""; + + + e107::getMessage()->addInfo($message); + e107::getMessage()->addDebug("Local version: ".$version." Remote version: ".$versions[$folder]['version']); + } + + } + + + } + + private function checkThemeUpdate() + { + require_once(e_HANDLER.'e_marketplace.php'); + $mp = new e_marketplace(); // autodetect the best method + + $versions = $mp->getVersionList('theme'); + + $themes = scandir(e_THEME); + + if(empty($themes)) + { + return null; + } + + $tp = e107::getParser(); + + $list = e107::getTheme()->getThemeList(); + + foreach($list as $data) + { + + $folder = $data['path']; + $version = $data['version']; + + if(!empty($versions[$folder]['version']) && version_compare( $version, $versions[$folder]['version'], '<')) + { + $link = "".$versions[$folder]['name'].""; + + $lans = array('x'=>$link, 'y'=>LAN_THEME); + + $dl = $mp->getDownloadModal('theme', $versions[$folder]); + + $caption = LAN_DOWNLOAD.": ".$versions[$folder]['name']." ".$versions[$folder]['version']; + + $message = $tp->lanVars(LAN_NEWER_VERSION_OF_X, $lans); + $message .= " ".$tp->toGlyph('fa-cloud-download').""; + + + e107::getMessage()->addInfo($message); + e107::getMessage()->addDebug("Local version: ".$version." Remote version: ".$versions[$folder]['version']); + } + + } + + + + } + /** * */ @@ -477,15 +643,7 @@ class admin_start // --------------------------------------------------------- -// auto db update -if ('0' == ADMINPERMS) -{ - $sc = e107::getScBatch('admin'); - echo $tp->parseTemplate('{ADMIN_COREUPDATE=alert}',true, $sc); - - require_once(e_ADMIN.'update_routines.php'); - update_check(); -} + diff --git a/e107_admin/cron.php b/e107_admin/cron.php index 5e15af631..d8bc114de 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -2,23 +2,12 @@ /* * e107 website system * - * Copyright (C) 2008-2012 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * Cron Administration + * Cron Administration - Scheduled Tasks * - * $URL$ - * $Id$ - * - */ - -/** - * - * @package e107 - * @subpackage admin - * @version $Id$ - * Admin-related functions for cron (Scheduler) management */ require_once('../class2.php'); @@ -194,7 +183,9 @@ class cron_admin_ui extends e_admin_ui $this->cronImport(e107::getAddonConfig('e_cron')); // Import plugin Crons $this->cronImportLegacy(); // Import Legacy Cron Tab Settings } - + + $this->renderHelp(); + } @@ -393,10 +384,10 @@ class cron_admin_ui extends e_admin_ui $setpwd_message .= "". LAN_CRON_16.""; if(e_DOMAIN && file_exists("/usr/local/cpanel/version")) { - $setpwd_message .= "
Go to cPanel
"; + $setpwd_message .= "
".LAN_CRON_60."
"; } - $setpwd_message .= "

".$frm->admin_button('generate_pwd', 1, 'delete', 'Generate new cron password',array('class'=>'btn btn-small')); + $setpwd_message .= "

".$frm->admin_button('generate_pwd', 1, 'delete', LAN_CRON_61 ,array('class'=>'btn btn-small')); $setpwd_message .= $frm->close(); $mes->add($setpwd_message, E_MESSAGE_INFO); @@ -448,7 +439,7 @@ class cron_admin_ui extends e_admin_ui $obj = new $class_name; if (method_exists($obj, $method_name)) { - $message = str_replace('[x]', $class_name." : ".$method_name, "Executing config function [b][x][/b]"); + $message = str_replace('[x]', $class_name." : ".$method_name, LAN_CRON_62);//Executing config function [b][x][/b] $mes->add($message, E_MESSAGE_DEBUG); if ($return == 'boolean') { @@ -462,12 +453,17 @@ class cron_admin_ui extends e_admin_ui } else { - $message = str_replace('[x]', $method_name."()", "Config function [b][x][/b] NOT found."); + $message = str_replace('[x]', $method_name."()", LAN_CRON_63 );//Config function [b][x][/b] NOT found. $mes->add($message, E_MESSAGE_DEBUG); } } return FALSE; } + + function renderHelp() + { + return array('caption'=>LAN_HELP, 'text'=>e107::getParser()->toHTML(LAN_CRON_64, true)); + } } @@ -575,7 +571,7 @@ class cron_admin_form_ui extends e_admin_form_ui { $text = "
"; $text .= $this->renderValue('options',$value,'',$id); - $text .= $this->submit_image('cron_execute['.$id.']', 1, 'execute', 'Execute'); + $text .= $this->submit_image('cron_execute['.$id.']', 1, 'execute', LAN_RUN); $text .= "
"; return $text; } @@ -860,7 +856,7 @@ class cron function cronExecute($class_func) { - //TODO LANs + //TO/ DO L/ANs list($class_name, $method_name) = explode("__", $class_func); $mes = e107::getMessage(); @@ -1276,4 +1272,4 @@ function cron_adminmenu() */ -?> \ No newline at end of file +?> diff --git a/e107_admin/db.php b/e107_admin/db.php index e7a893da8..6513fd5bc 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -68,7 +68,9 @@ if(isset($_POST['db_execute'])) if(isset($_POST['exportXmlFile'])) { - if(exportXmlFile($_POST['xml_prefs'],$_POST['xml_tables'],$_POST['package_images'])) + + + if(exportXmlFile($_POST['xml_prefs'],$_POST['xml_tables'],$_POST['xml_plugprefs'], $_POST['package_images'], false)) { $mes = e107::getMessage(); $mes->add(LAN_SUCCESS, E_MESSAGE_SUCCESS); @@ -192,7 +194,7 @@ class system_tools if(isset($_POST['delplug'])) { - $this->delete_plugin_entry($_POST['pref_type']); + $this->delete_plugin_entry(); // $_POST['pref_type'] } if(isset($_POST['upload'])) @@ -1057,6 +1059,8 @@ class system_tools e107::getCache()->clear(); } + return null; + } private function delete_plugin_entry() @@ -1066,7 +1070,7 @@ class system_tools $sql = e107::getDb(); $del = array_keys($_POST['delplug']); - if($sql->db_Delete("plugin", "plugin_id='".intval($del[0])."'")) + if($sql->delete("plugin", "plugin_id='".intval($del[0])."'")) { $mes->add(LAN_DELETED, E_MESSAGE_SUCCESS); } @@ -1080,11 +1084,11 @@ class system_tools /** * Render Options - * @return none + * @return null */ private function render_options() { - $frm = e107::getForm(); + $mes = e107::getMessage(); $text = " @@ -1124,12 +1128,14 @@ class system_tools "; */ e107::getRender()->tablerender(DBLAN_10, $mes->render().$text); + + return null; } /** * Import XML Form - * @return none + * @return null */ private function importForm() { @@ -1173,11 +1179,12 @@ class system_tools e107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_59, $mes->render().$text); + return null; } /** * Export XML Dump - * @return none + * @return null */ private function exportXmlForm() { @@ -1202,7 +1209,6 @@ class system_tools "; - //TODO Add support for plugin Prefs. $pref_types = e107::getConfig()->aliases; unset($pref_types['core_old'], $pref_types['core_backup']); @@ -1211,17 +1217,58 @@ class system_tools foreach($pref_types as $key=>$description) { + $data = e107::getConfig($key)->getPref(); + + $rows = count($data); + $checked = (vartrue($_POST['xml_prefs'][$key]) == $key) ? 1: 0; $text .= " ".$frm->checkbox("xml_prefs[".$key."]", $key, $checked, array('label'=>LAN_PREFS.": ".$key))." -   + ".intval($rows)." "; } + + + // Plugin Preferences ---------------------------- + $pluglist = e107::pref('core','plug_installed'); + + $text .= " + ".$frm->checkbox_toggle('check-all-verify', 'xml_plugprefs')."  Plugin ".LAN_PREFS." + ".DBLAN_98." + + "; + + ksort($pluglist); + + foreach($pluglist as $plug=>$ver) + { + $data = e107::getPlugConfig($plug)->getPref(); + + $key = $plug; + + $checked = false; + + if(!empty($data)) + { + $rows = count($data); + + $text .= " + + ".$frm->checkbox("xml_plugprefs[".$key."]",$key, $checked, array('label'=>LAN_PREFS.": ".$key))." + + ".$rows." + + "; + } + } + + + $text .= " @@ -1284,14 +1331,40 @@ class system_tools "; + // display differences between default and core prefs. +/* + $corePrefs = e107::pref('core'); + + $defaultArray = e107::getXml()->loadXMLfile(e_CORE."xml/default_install.xml", 'advanced'); + $defaultPrefs = e107::getXml()->e107ImportPrefs($defaultArray); + + $text .= "
"; + foreach($defaultPrefs as $k=> $val) + { + if($val == $corePrefs[$k] || substr($k,-5) === '_list' || substr($k,0,9) == 'sitetheme') + { + continue; + } + + + $text .= " + + + "; + + } + $text .= "
".$k."".print_a($val,true)."".print_a($corePrefs[$k],true)."
"; +*/ + + e107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_102,$mes->render(). $text); - + return null; } /** * Import XML Dump - * @return none + * @return null */ private function importXmlFile() { @@ -1306,11 +1379,14 @@ class system_tools { e107::getMessage()->addError(DBLAN_104." $table"); } + + return null; } /** * Optimize SQL - * @return none + * @param $mySQLdefaultdb + * @return null */ private function optimizesql($mySQLdefaultdb) { @@ -1324,10 +1400,13 @@ class system_tools $mes->addSuccess(e107::getParser()->lanVars(DBLAN_11, $mySQLdefaultdb)); e107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_7, $mes->render()); + + return null; } /** * Preferences Editor + * @param string $type * @return string text for display */ private function pref_editor($type='core') @@ -1629,12 +1708,14 @@ function db_adminmenu() //FIXME - has problems when navigation is on the LEFT in * @param object $debug [optional] * @return none */ -function exportXmlFile($prefs,$tables,$package=FALSE,$debug=FALSE) +function exportXmlFile($prefs,$tables=array(),$plugPrefs, $package=FALSE,$debug=FALSE) { $xml = e107::getXml(); $tp = e107::getParser(); $mes = e107::getMessage(); + $desinationFolder = null; + if(vartrue($package)) { @@ -1652,12 +1733,13 @@ function exportXmlFile($prefs,$tables,$package=FALSE,$debug=FALSE) { $message = str_replace('[folder]', $desinationFolder, DBLAN_107); $mes->add($message, E_MESSAGE_ERROR); - return ; + return false ; } } + $mode = ($debug === true) ? "debug" : false; - if($xml->e107Export($prefs,$tables,$debug)) + if($xml->e107Export($prefs,$tables,$plugPrefs, $mode)) { $mes->add(DBLAN_108." ".$desinationFolder."install.xml", E_MESSAGE_SUCCESS); if(varset($xml->fileConvertLog)) @@ -1676,8 +1758,10 @@ function exportXmlFile($prefs,$tables,$package=FALSE,$debug=FALSE) } } } + } + return null; } @@ -1697,10 +1781,12 @@ function table_list() $exclude[] = "user_extended_country"; $exclude[] = "plugin"; - $coreTables = e107::getDb()->db_TableList('nolan'); + $coreTables = e107::getDb()->tables('nolan'); $tables = array_diff($coreTables,$exclude); + $tabs = array(); + foreach($tables as $e107tab) { $count = e107::getDb()->gen("SELECT * FROM #".$e107tab); diff --git a/e107_admin/e107_update.php b/e107_admin/e107_update.php index b7202832e..7daf35be3 100644 --- a/e107_admin/e107_update.php +++ b/e107_admin/e107_update.php @@ -24,183 +24,9 @@ $e_sub_cat = 'database'; require_once ("auth.php"); require_once ("update_routines.php"); - - -// - -// Carry out CORE updates -/* -function run_updates($dbupdate) -{ - global $mes; - - foreach($dbupdate as $func => $rmks) - { - if(function_exists('update_'.$func)) // Legacy Method. - { - $installed = call_user_func("update_".$func); - //?! (LAN_UPDATE == $_POST[$func]) - if(varsettrue($_POST['update_core'][$func]) && !$installed) - { - if(function_exists("update_".$func)) - { - $message = LAN_UPDATE_7." {$rmks}"; - $error = call_user_func("update_".$func, "do"); - if($error != '') - { - $mes->add($message, E_MESSAGE_ERROR); - $mes->add($error, E_MESSAGE_ERROR); - } - else $mes->add($message, E_MESSAGE_SUCCESS); - } - } - } - - - - } -} - -function run_updates_plugin($func,$check=TRUE) // New for {plugin}_setup.php -{ - if(class_exists($func.'_setup')) - { - $class = $func.'_setup'; - $setObj = new $class; - - if(method_exists($setObj,'upgrade_post')) - { - return $setObj->upgrade_post($check); - } - // print_a($setObj); - // echo "
Found: ".$func; - } -} - - - - -function show_updates($dbupdate, $what) -{ - global $frm; - $mes = e107::getMessage(); - - $caption = constant('LAN_UPDATE_CAPTION_'.strtoupper($what)); - $text = " -
-
- {$caption} - - - - - - - - - - - - - "; - - $updates = 0; - - // asort($dbupdate); - - foreach($dbupdate as $func => $rmks) - { - if(function_exists("update_".$func)) - { - $text .= ""; - - if(call_user_func("update_".$func)) - { - $text .= ""; - } - else - { - $updates ++; - $text .= ""; - } - $text .= "\n"; - } - - if(class_exists($func.'_setup')) // plugin_setup.php - { - $text .= ""; - - $reason = run_updates_plugin($func,TRUE); // TRUE = Just check if needed. - if(!$reason) - { - $text .= ""; - } - else - { - $updates ++; - $mes->addDebug($reason); - $text .= ""; - } - $text .= "\n"; - } - } - - $text .= " - -
".LAN_UPDATE_55."".LAN_UPDATE_2."
{$rmks}".LAN_UPDATE_3."".$frm->admin_button('update_core['.$func.']', LAN_UPDATE, 'warning', '', "id=e-{$func}")."
{$rmks}".LAN_UPDATE_3."".$frm->admin_button('update['.$func.']', LAN_UPDATE, 'warning')."
-
-
- "; - - echo $text; - return $updates; // Number of updates to do -} -*/ - - - new e107Update($dbupdate); - require_once ("footer.php"); - -/* - -if(varset($_POST['update_core']) && is_array($_POST['update_core'])) -{ - $message = run_updates($dbupdate); -} - -if(varset($_POST['update']) && is_array($_POST['update'])) // Do plugin updates -{ - $func = key($_POST['update']); - run_updates_plugin($func,FALSE); -} - -$total_updates = 0; - -ob_start(); - if(isset($dbupdatep)) - { // Show plugin updates done - $total_updates += show_updates($dbupdatep, 'plugin'); - } - // Show core updates done - $total_updates += show_updates($dbupdate, 'core'); - $text = ob_get_contents(); -ob_end_clean(); - -$e107->ns->tablerender(LAN_UPDATE_56, $mes->render().$text); - -if($total_updates == 0) -{ // No updates needed - clear the cache to be sure - $e107cache->set_sys("nq_admin_updatecheck", time().', 1, '.$e107info['e107_version'], TRUE); -} - * - * - */ - - - ?> \ No newline at end of file diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php index b58792ee0..b543f3485 100644 --- a/e107_admin/fileinspector.php +++ b/e107_admin/fileinspector.php @@ -2,7 +2,7 @@ /* * e107 website system * - * Copyright (C) 2008-2013 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -1250,7 +1250,7 @@ class file_inspector { $data .= "| e107 website system\n"; $data .= "|\n"; $data .= "| Copyright (C) 2001-2002 Steve Dunstan (jalist@e107.org)\n"; - $data .= "| Copyright (C) 2008-2010 e107 Inc (e107.org)\n"; + $data .= "| Copyright (C) 2008-2016 e107 Inc (e107.org)\n"; $data .= "|\n"; $data .= "| Released under the terms and conditions of the\n"; $data .= "| GNU General Public License (http://gnu.org).\n"; @@ -1356,15 +1356,15 @@ class file_inspector { $gb = 1024 * $mb; $tb = 1024 * $gb; if ($size < $kb) { - return $size." b"; + return $size." ".CORE_LAN_B; } else if($size < $mb) { - return round($size/$kb)." kB"; + return round($size/$kb)." ".CORE_LAN_KB; } else if($size < $gb) { - return round($size/$mb, $dec)." MB"; + return round($size/$mb, $dec)." ".CORE_LAN_MB; } else if($size < $tb) { - return round($size/$gb, $dec)." GB"; + return round($size/$gb, $dec)." ".CORE_LAN_GB; } else { - return round($size/$tb, $dec)." TB"; + return round($size/$tb, $dec)." ".CORE_LAN_TB; } } diff --git a/e107_admin/header.php b/e107_admin/header.php index 873da70bf..14c6c5d77 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -25,33 +25,42 @@ if(!defined('USER_AREA')) { define("USER_AREA", FALSE); } + e107::getDb()->db_Mark_Time('(Header Top)'); -// Admin template -if (defined('THEME') && file_exists(THEME.'admin_template.php')) -{ - require_once (THEME.'admin_template.php'); -} -else -{ - require_once (e_CORE.'templates/admin_template.php'); -} +if(!deftrue('e_MENUMANAGER_ACTIVE')) +{ + + if (defined('THEME') && file_exists(THEME.'admin_template.php')) // Admin template + { + require_once (THEME.'admin_template.php'); + } + else + { + require_once (e_CORE.'templates/admin_template.php'); + } + + + // FIXME - remove ASAP + if (isset($pref['del_unv']) && $pref['del_unv'] && $pref['user_reg_veri'] != 2) + { + $threshold = (time() - ($pref['del_unv'] * 60)); + e107::getDb()->delete("user", "user_ban = 2 AND user_join < '{$threshold}' "); + } +} function loadJSAddons() { - if(e_PAGE == 'menus.php' && vartrue($_GET['configure'])) // Quick fix for Menu Manager inactive drop-down problem. + if(deftrue('e_MENUMANAGER_ACTIVE')) { return; } // e107::js('core', 'bootstrap/js/bootstrap-modal.js', 'jquery', 2); // Special Version see: https://github.com/twitter/bootstrap/pull/4224 - - - e107::css('core', 'bootstrap-select/bootstrap-select.min.css', 'jquery'); e107::js('core', 'bootstrap-select/bootstrap-select.min.js', 'jquery', 2); @@ -99,7 +108,6 @@ loadJSAddons(); - // e107::js("core", "core/admin.js","prototype",3); // Load all default functions. @@ -138,12 +146,6 @@ loadJSAddons(); // A: Admin Defines and Links // -// FIXME - remove ASAP -if (isset($pref['del_unv']) && $pref['del_unv'] && $pref['user_reg_veri'] != 2) -{ - $threshold = (time() - ($pref['del_unv'] * 60)); - e107::getDb()->db_Delete("user", "user_ban = 2 AND user_join < '{$threshold}' "); -} // // B: Send HTTP headers (these come before ANY html) @@ -156,35 +158,13 @@ if (isset($pref['del_unv']) && $pref['del_unv'] && $pref['user_reg_veri'] != 2) // // C: Send start of HTML // - -// HTML 5 default. -//if(!defined('XHTML4')) -{ - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -} -/* -else // XHTML -{ - echo(defined("STANDARDS_MODE") ? "" : "\n")."\n"; - echo "\n"; - echo " - - \n"; - echo(defined("CORE_LC")) ? "\n" : ""; - echo "\n"; -} - * -*/ - +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; // Works better for iOS but still has some issues. -// echo (defined("VIEWPORT")) ? "\n" : ""; - echo "".(defined("e_PAGETITLE") ? e_PAGETITLE." - " : (defined("PAGE_NAME") ? PAGE_NAME." - " : "")).LAN_HEADER_04." :: ".SITENAME."\n"; -// print_a(get_included_files()); // // D: Send CSS // @@ -198,8 +178,10 @@ if (!isset($no_core_css) || !$no_core_css) $e_js->otherCSS('{e_WEB_CSS}e107.css'); } -// Register Plugin specific CSS -// DEPRECATED, use $e_js->pluginCSS('myplug', 'style/myplug.css'[, $media = 'all|screen|...']); + + + +// Register Plugin specific CSS (BC) if (isset($eplug_css) && $eplug_css) { e107::getMessage()->addDebug('Deprecated $eplug_css method detected. Use e107::css() in an e_header.php file instead.'.print_a($eplug_css,true)); @@ -211,55 +193,60 @@ if (isset($eplug_css) && $eplug_css) foreach($eplug_css as $kcss) { - // echo ($kcss[0] == "<") ? $kcss : "\n"; $e_js->otherCSS($kcss); } } - if(e107::getPref('admincss') == "admin_dark.css" && !vartrue($_GET['configure']) && e107::getPref('admintheme')!='bootstrap3') - { - - $e_js->coreCSS('bootstrap/css/darkstrap.css'); - - } -//NEW - Iframe mod -if (!deftrue('e_IFRAME') && isset($pref['admincss']) && $pref['admincss'] && !vartrue($_GET['configure'])) -{ - $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss']; - //echo "\n"; - $e_js->themeCSS($css_file); - -} -elseif (isset($pref['themecss']) && $pref['themecss']) -{ - $css_file = (file_exists(THEME.'admin_'.$pref['themecss']) && !vartrue($_GET['configure'])) ? 'admin_'.$pref['themecss'] : $pref['themecss']; - //echo "\n"; - // $e_js->themeCSS($css_file); // Test with superhero.css for frontend bootstrap and 'dark' for backend bootstrap. -} -else -{ - $css_file = (file_exists(THEME.'admin_style.css') && !vartrue($_GET['configure'])) ? 'admin_style.css' : 'style.css'; - //echo "\n"; - $e_js->themeCSS($css_file); -} -if(e_PAGE == 'menus.php' && vartrue($_GET['configure'])) // Quick fix for Menu Manager inactive drop-down problem. +if(deftrue('e_MENUMANAGER_ACTIVE')) // load frontend style.css { $css_file = $pref['themecss']; - $e_js->themeCSS($css_file); // Test with superhero.css for frontend bootstrap and 'dark' for backend bootstrap. -// return; + $e_js->themeCSS($css_file); // Test with superhero.css for frontend bootstrap and 'dark' for backend bootstrap. + } -else +else // backend css. { - // $e_js->coreCSS('font-awesome/css/font-awesome.min.css'); + + $custom = e107::getThemeGlyphs(); + foreach($custom as $val) + { + $e_js->otherCSS($val['path']); + } + + //NEW - Iframe mod + if(!deftrue('e_IFRAME') && !empty($pref['admincss'])) + { + $css_file = file_exists(THEME.'admin_'.$pref['admincss']) ? 'admin_'.$pref['admincss'] : $pref['admincss']; + //echo "\n"; + $e_js->themeCSS($css_file); + + } + elseif(isset($pref['themecss']) && $pref['themecss']) + { + $css_file = (file_exists(THEME.'admin_'.$pref['themecss'])) ? 'admin_'.$pref['themecss'] : $pref['themecss']; + //echo "\n"; + // $e_js->themeCSS($css_file); // Test with superhero.css for frontend bootstrap and 'dark' for backend bootstrap. + } + else + { + $css_file = (file_exists(THEME.'admin_style.css')) ? 'admin_style.css' : 'style.css'; + //echo "\n"; + $e_js->themeCSS($css_file); + } + + + } + + + // FIXME: TEXTDIRECTION compatibility CSS (marj?) // TODO: probably better to externalise along with some other things above // possibility to overwrite some CSS definition according to TEXTDIRECTION @@ -267,19 +254,17 @@ else // see _blank theme for examples if(defined('TEXTDIRECTION') && file_exists(THEME.'/'.strtolower(TEXTDIRECTION).'.css')) { - //echo ' - //'; $e_js->themeCSS(strtolower(TEXTDIRECTION).'.css'); } // --- Load plugin Header files before all CSS nad JS zones. -------- -if (vartrue($pref['e_header_list']) && is_array($pref['e_header_list'])) +if (!empty($pref['e_header_list']) && is_array($pref['e_header_list'])) { foreach($pref['e_header_list'] as $val) { // no checks fore existing file - performance - e107_include(e_PLUGIN.$val."/e_header.php"); + e107_include_once(e_PLUGIN.$val."/e_header.php"); } } unset($e_headers); @@ -355,11 +340,14 @@ if (!empty($eplug_js)) } //FIXME - theme.js/user.js should be registered/rendered through e_jsmanager +// BC Fix. if (file_exists(THEME.'theme.js')) { e107::js('theme','theme.js',null,3); // echo "\n"; } + + if (is_readable(e_FILE.'user.js') && filesize(e_FILE.'user.js')) { echo "\n"; @@ -404,8 +392,7 @@ if (!USER && ($pref['user_tracking'] == "session") && varset($pref['password_CHA } -//XXX - do we still need it? Now we have better way of doing this - admin tools (see below) -if (function_exists('headerjs')) +if (function_exists('headerjs'))// required for BC. { echo headerjs(); } @@ -458,6 +445,12 @@ if (defined('THEME_ONLOAD')) $js_body_onload[] = THEME_ONLOAD; $body_onload=''; if (count($js_body_onload)) $body_onload = " onload=\"".implode(" ",$js_body_onload)."\""; + +if(deftrue('e_MENUMANAGER_ACTIVE')) +{ + $body_onload .= " id=\"layout-".e107::getForm()->name2id(THEME_LAYOUT)."\" "; +} + // // J: Send end of and start of // diff --git a/e107_admin/image.php b/e107_admin/image.php index 76d5157a3..d78e73227 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -38,7 +38,7 @@ if($_GET['action'] == 'youtube' ) } - +// TODO use library manager e107::js('core', 'plupload/plupload.full.js', 'jquery', 2); e107::css('core', 'plupload/jquery.plupload.queue/css/jquery.plupload.queue.css', 'jquery'); e107::js('core', 'plupload/jquery.plupload.queue/jquery.plupload.queue.min.js', 'jquery', 2); @@ -272,7 +272,7 @@ class media_cat_ui extends e_admin_ui // XXX temporary disable when there is no owners, discuss if(!$new_data['media_cat_owner']) { - e107::getMessage()->addError(IMALAN_173); // FIXME LAN + e107::getMessage()->addError(IMALAN_173); return false; } //$replace = array("_"," ","'",'"',"."); //FIXME Improve @@ -1405,8 +1405,8 @@ class media_admin_ui extends e_admin_ui 'close' => 'true' ); - - //TODO FIXME Upgrade to bs3 when Bootstrap3 Admin is ready. + + $items = array(); $bs2 = e107::getMedia()->getGlyphs('bs3','glyphicon-'); @@ -1426,6 +1426,7 @@ class media_admin_ui extends e_admin_ui $fa4 = e107::getMedia()->getGlyphs('fa4'); + foreach($fa4 as $val) { $items[] = array( @@ -1438,20 +1439,66 @@ class media_admin_ui extends e_admin_ui ); } + + + + $custom = e107::getThemeGlyphs(); + + if(!empty($custom)) + { + foreach($custom as $glyphConfig) + { + + $tmp = e107::getMedia()->getGlyphs($glyphConfig,$glyphConfig['prefix']); + + if(!empty($tmp)) + { + foreach($tmp as $val) + { + $items[] = array( + 'previewUrl' => $val, + 'saveValue' => $val.'.glyph', + 'thumbUrl' => $val, + 'title' => $val, + 'slideCaption' => ucfirst($glyphConfig['name']), + 'slideCategory' => $glyphConfig['name'] + ); + + } + + + } + + + + + + } + + + + } + + + + + if(vartrue($parm['search'])) { $filtered = array(); - foreach($items as $v) + if(!empty($items)) { - if(strpos($v['title'], $parm['search'])!==false) + foreach($items as $v) { - $v['slideCaption'] = ''; - $filtered[] = $v; - - } - } - + if(strpos($v['title'], $parm['search'])!==false) + { + $v['slideCaption'] = ''; + $filtered[] = $v; + + } + } + } $items = $filtered; } @@ -1671,13 +1718,13 @@ class media_admin_ui extends e_admin_ui list($fileName,$bla) = explode("?", $fileName); } - + $uploadCaption = !empty($_POST['upload_caption']) ? $tp->filter($_POST['upload_caption'],'str') : ''; $fileName = str_replace(array('%','+'),'',$fileName); // remove script extensions. if(substr($fileName,-4) == ".php" || substr($fileName,-4) == ".htm" || substr($fileName,-5) == ".html" || substr($fileName,-4) == ".asp") { - $fileName = empty($_POST['upload_caption']) ? str_replace(array(".php",".html",".asp",".htm"),'',$fileName)."_".time() : eHelper::dasherize(strtolower($_POST['upload_caption'])); + $fileName = empty($uploadCaption) ? str_replace(array(".php",".html",".asp",".htm"),'',$fileName)."_".time() : eHelper::dasherize(strtolower($uploadCaption)); } if(!$fl->getRemoteFile($tp->filter($_POST['upload_url'], 'file'), $fileName, 'import')) @@ -1686,8 +1733,8 @@ class media_admin_ui extends e_admin_ui } elseif($import == true) { - $data = array('media_caption' => e107::getParser()->filter($_POST['upload_caption'],'str')); - $result = e107::getMedia()->importFile($fileName,$cat, null, $data); + $data = array('media_caption' => $uploadCaption); + e107::getMedia()->importFile($fileName,$cat, null, $data); } } } @@ -2391,7 +2438,7 @@ class media_admin_ui extends e_admin_ui $mes->add(IMALAN_113." ".e_IMPORT."", E_MESSAGE_INFO); } - if(!count($files)) + if(!count($files) ) { if(!vartrue($_POST['batch_import_selected'])) { @@ -2403,6 +2450,7 @@ class media_admin_ui extends e_admin_ui return; } + $text = "
@@ -2431,8 +2479,16 @@ class media_admin_ui extends e_admin_ui "; // $c = 0; + foreach($files as $f) { + if(empty($f)) + { + e107::getMessage()->addWarning("0 byte file found in: ".e_IMPORT."
Please remove before proceeding."); + ////rename(e_IMPORT.$f['path'].$f['fname'],e_IMPOT.$f['path'].$f['fname']."-bad"); + continue; + } + $default = $this->getFileXml($f['fname']); $f = $fl->cleanFileName($f,true); @@ -2576,6 +2632,8 @@ class media_admin_ui extends e_admin_ui function batchDelete() { + $tp = e107::getParser(); + foreach($_POST['batch_selected'] as $key=>$file) { if(trim($file) == '') @@ -2584,7 +2642,7 @@ class media_admin_ui extends e_admin_ui } // $oldpath = e_MEDIA."temp/".$file; - $oldpath = e_IMPORT.e107::getParser()->filter($file, 'file'); + $oldpath = e_IMPORT . $tp->filter($file, 'file'); if(file_exists($oldpath)) { unlink($oldpath); @@ -2890,14 +2948,18 @@ if (isset($_POST['submit_avdelete_multi'])) $avList = array(); $tmp = array(); $uids = array(); + + $tp = e107::getParser(); + $sql = e107::getDb(); + //Sanitize - $_POST['multiaction'] = $tp->filter($_POST['multiaction'], 'int'); + $multiaction = $tp->filter($_POST['multiaction'], 'int'); //sql queries significant reduced - if(!empty($_POST['multiaction']) && $sql->db_Select("user", 'user_id, user_name, user_image', "user_id IN (".implode(',', $_POST['multiaction']).")")) + if(!empty($multiaction) && $sql->db_Select("user", 'user_id, user_name, user_image', "user_id IN (".implode(',', $multiaction).")")) { $search_users = $sql->db_getList('ALL', FALSE, FALSE, 'user_id'); - foreach($_POST['multiaction'] as $uid) + foreach($multiaction as $uid) { if (vartrue($search_users[$uid])) { diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index 580013b73..cf245d751 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -2,14 +2,12 @@ /* * e107 website system * - * Copyright (C) 2008-2013 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * * Info panel admin view * - * $URL$ - * $Id$ */ if (!defined('e107_INIT')) @@ -160,7 +158,6 @@ class adminstyle_infopanel '; */ - //TODO LANs throughout. $user_pref = $this->getUserPref(); @@ -624,7 +621,7 @@ class adminstyle_infopanel - function render_infopanel_options($render = false) //TODO LAN + function render_infopanel_options($render = false) { $frm = e107::getForm(); $mes = e107::getMessage(); @@ -771,27 +768,34 @@ class adminstyle_infopanel { $data = array(); - $data['labels'] = array("January","February","March","April","May","June","July"); - + $months = e107::getDate()->terms('month'); + + $data['labels'] = array($months[0], //"January", + $months[1], //"February", + $months[2], //"March", + $months[3], //"April", + $months[4], //"May", + $months[5], //"June", + $months[6] //"July" + ); $data['datasets'][] = array( - 'fillColor' => "rgba(220,220,220,0.5)", - 'strokeColor' => "rgba(220,220,220,1)", - 'pointColor ' => "rgba(220,220,220,1)", - 'pointStrokeColor' => "#fff", - 'data' => array(65,59,90,81,56,55,40), - 'title' => "Visits" - + 'fillColor' => "rgba(220,220,220,0.5)", + 'strokeColor' => "rgba(220,220,220,1)", + 'pointColor ' => "rgba(220,220,220,1)", + 'pointStrokeColor' => "#fff", + 'data' => array(65,59,90,81,56,55,40), + 'title' => ADLAN_168// "Visits" ); $data['datasets'][] = array( - 'fillColor' => "rgba(151,187,205,0.5)", - 'strokeColor' => "rgba(151,187,205,1)", - 'pointColor ' => "rgba(151,187,205,1)", - 'pointStrokeColor' => "#fff", - 'data' => array(28,48,40,19,96,27,100), - 'title' => "Unique Visits" - ); + 'fillColor' => "rgba(151,187,205,0.5)", + 'strokeColor' => "rgba(151,187,205,1)", + 'pointColor ' => "rgba(151,187,205,1)", + 'pointStrokeColor' => "#fff", + 'data' => array(28,48,40,19,96,27,100), + 'title' => ADLAN_169 //"Unique Visits" + ); return $data; } @@ -955,21 +959,21 @@ class adminstyle_infopanel if($type == 'demo') { - $text .= "
These stats are for demonstration purposes only. Install Site Stats Plugin
"; + $text .= "
".ADLAN_170."".ADLAN_171."
"; } else { $text .= "
- Visitors    - Unique Visitors + ".ADLAN_168."   + ".ADLAN_169."
"; } - return $text; - + return $text; } } ?> + diff --git a/e107_admin/includes/layouts/flexpanel_default.php b/e107_admin/includes/layouts/flexpanel_default.php index fec95d300..fa4159ffb 100644 --- a/e107_admin/includes/layouts/flexpanel_default.php +++ b/e107_admin/includes/layouts/flexpanel_default.php @@ -1,9 +1,14 @@ @@ -14,7 +19,7 @@ $FLEXPANEL_LAYOUT = '
diff --git a/e107_admin/includes/layouts/flexpanel_wider_sidebar.php b/e107_admin/includes/layouts/flexpanel_wider_sidebar.php index 65a0b857b..3c547ecbf 100644 --- a/e107_admin/includes/layouts/flexpanel_wider_sidebar.php +++ b/e107_admin/includes/layouts/flexpanel_wider_sidebar.php @@ -1,9 +1,15 @@ @@ -14,7 +20,7 @@ $FLEXPANEL_LAYOUT = '
diff --git a/e107_admin/menus.php b/e107_admin/menus.php index b8d282838..1d5e78cb9 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -25,46 +25,127 @@ if(isset($_GET['configure'])) @ini_set('display_errors', 0); error_reporting(0); + define('e_MENUMANAGER_ACTIVE', true); + +} +else +{ + define('e_ADMIN_AREA', true); + define('e_MENUMANAGER_ACTIVE', false); } require_once("../class2.php"); + + +if(e_MENUMANAGER_ACTIVE === false ) +{ + if(e_DEBUG_MENUMANAGER === true) + { + e107::css('inline', ' + + body { overflow:hidden } + + + + + + + '); + } + else + { + e107::js('footer-inline'," + + $('#menu_iframe').attr('scrolling','no'); + $('#menu_iframe').load(function() { + // $('#menu_iframe').bind('load', function() { + + var height = this.contentWindow.document.body.offsetHeight + 400 + 'px'; + + // $(this).css('overflow-y','visible'); + $(this).css('height',height); + // alert(this.style.height); + + }); + + + "); + + } + + e107::css('inline'," + + .menu-manager-items { padding-right:15px} + .menu-manager-items div.item { padding:5px; margin:5px 0; border:1px solid rgba(255,255,255,0.3); border-radius:3px; cursor: move } + .menu-manager-sticky { + position: fixed; + padding-left: 15px; + padding-right: 15px; + left: 0; + top: 60px; + z-index: 100; + border-top: 0; + -moz-transition: fadeIn .4s; + -o-transition: fadeIn .4s; + -webkit-transition: fadeIn .4s; + transition: fadeIn .4s; + } + + iframe#menu_iframe { overflow-x:hidden; width: 100%; height: 90vh; border-width: 3px; padding:0 } + + .menu-selector ul li { + background-color: rgba(255,255,255,0.1); + padding: 5px 30px; + padding-right:2px; + margin-bottom:2px; + } + + .menu-selector ul li:nth-child(odd){ background-color:rgba(0,0,0,0.2) } + + .menu-selector { height:330px; display:block; padding-bottom:50px; overflow-y:scroll; margin-bottom:10px } + + .menu-selector input:checked + span { color: white; } + + @media all and (min-height: 1000px) { + + .menu-selector { height:550px } + } + + @media all and (max-height: 800px) { + + .menu-selector { height:250px } + iframe#menu_iframe { height: 87vh } + .menu-selector ul li { font-size: 0.8em } + } + + ul.dropdown-menu.e-mm-selector { padding: 10px; margin-top: -2px; margin-right:-2px; } + + "); + +} + + + + if (!getperms("2")) { e107::redirect('admin'); exit; } -define('e_DEBUG', false); + e107::coreLan('menus', true); e107::coreLan('admin', true); -e107::css('inline'," - -.menu-manager-items { padding-right:15px} -.menu-manager-items div.item { padding:5px; margin:5px 0; border:1px solid rgba(255,255,255,0.3); border-radius:3px; cursor: move } -.menu-manager-sticky { - position: fixed; -padding-left: 15px; -padding-right: 15px; -left: 0; -top: 60px; - z-index: 100; - border-top: 0; - -moz-transition: fadeIn .4s; - -o-transition: fadeIn .4s; - -webkit-transition: fadeIn .4s; - transition: fadeIn .4s; -} - -"); -if(strpos(e_QUERY, 'configure') !== FALSE || vartrue($_GET['enc'])) + +if(e_MENUMANAGER_ACTIVE === true || vartrue($_GET['enc'])) { @@ -232,8 +313,21 @@ TEMPL; .portlet-content { padding: 7px; } .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important; } .ui-sortable-placeholder * { visibility: hidden; } - - [class^='icon-'], [class*=' icon-'] { + + i.S16 { + background: url(".e_THEME."bootstrap3/images/adminicons_16.png) no-repeat top left; + display:inline-block; width:17px; height:16px; + *margin-right: .3em; + line-height: 14px; + vertical-align: text-top; + } + + i.e-search-16 { background-position: -1344px 0; width: 16px; height: 16px; } + i.e-delete-16 { background-position: -525px 0; width: 16px; height: 16px; } + i.e-configure-16 { background-position: -378px 0; width: 16px; height: 16px; } + i.e-edit-16 { background-position: -609px 0; width: 16px; height: 16px; } + + .e-mm-icon-search { display: inline-block; width: 14px; height: 14px; @@ -245,13 +339,15 @@ TEMPL; background-repeat: no-repeat; } - .icon-search { + .e-mm-icon-search { background-position: -48px 0; } - .icon-align-justify { + + /* + .e-mm-icon-align-justify { background-position: -336px -48px; } - + */ /* A little bit of bootstrap styling - loading /bootstrap.css could break some themes */ @@ -333,12 +429,11 @@ TEMPL; .menuOptions > select { max-width:100% } - .menu-options-buttons { } + .menu-options-buttons { display:block; text-align:right; } + select.menu-btn { text-align:left; display:block; width:100%; margin-left:3px } #menu-manage-actions { width:50%; vertical-align:top; text-align:center; padding:15px } - select.menu-btn { text-align:left } - label { font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; color:black; line-height:14px } label.input { margin-right:10px; } @@ -382,8 +477,8 @@ TEMPL; color: #2F2F2F; font-size: 13px; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; -} - + } + .menu-panel-header { display: block; @@ -415,7 +510,7 @@ TEMPL; .sortable li { border-radius: 4px } .sortable li:hover { background-color: silver; box-shadow:3px 3px 3px silver } - .regularMenu { cursor:move; border-bottom:1px dotted silver; margin-bottom:6px; padding-left:3px; padding-right:3px; padding-top:10px; padding-bottom:10px;background-color: #E0EBF1; border-radius: 5px; } + .regularMenu { border-bottom:1px dotted silver; margin-bottom:6px; padding-left:3px; padding-right:3px; padding-top:10px; padding-bottom:10px;background-color: #E0EBF1; border-radius: 5px; } .regularMenu span {padding:3px; font-weight:bold; color:#2F2F2F;text-align:left; } .ui-draggable { background-color: rgb(245, 245, 245); min-width:100px;} @@ -425,8 +520,8 @@ TEMPL; ",'jquery'); - e107::js('footer',"http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"); - e107::js('url', "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/jquery-ui.css"); +// e107::js('footer',"http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"); +// e107::css('url', "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/jquery-ui.css"); e107::js('footer-inline',' $(function() @@ -453,7 +548,7 @@ TEMPL; - +/* $(".sortable").sortable({ connectWith: $("#area-1,#area-2,#area-3,#area-4,#area-5"), @@ -469,12 +564,14 @@ TEMPL; }); -/* + $( ".draggable", window.top.document).click(function() { alert("hi there"); - });*/ + }); + + // http://jsfiddle.net/DT764/2/ @@ -498,7 +595,7 @@ TEMPL; } }); - +*/ // $( "ul, li", window.top.document ).disableSelection(); @@ -554,7 +651,13 @@ else $(window).scroll(function() { // and run it again every time you scroll stickyNav(); }); -}); + + + + + + + }); @@ -575,7 +678,7 @@ else - +/* if($_SERVER['E_DEV_MENU'] == 'true') { if(isset($_GET['configure']) || isset($_GET['iframe'])) @@ -589,21 +692,35 @@ if($_SERVER['E_DEV_MENU'] == 'true') require_once("auth.php"); require_once("footer.php"); exit; -} +}*/ // if($_SERVER['E_DEV_MENU'] == 'true') //{ + + + function e_help() { - if(e_DEBUG === false) + if(e_DEBUG_MENUMANAGER !== true) { return null; } - - $p = e107::getPref('e_menu_list'); // new storage for xxxxx_menu.php list. - $sql = e107::getDb(); + return e_menu_layout::menuSelector(); + + + + + + + + + + + + + $text = '
"; - return array('caption'=>'DragNDrop Items','text'=>$text); + return array('caption'=>MENLAN_57,'text'=>$text); } //} +// new v2.1.4 +class e_menu_layout +{ + function __construct() + { + + } + + static function getLayouts($theme=null) + { + if(empty($theme)) + { + $theme = e107::pref('core','sitetheme'); + } + + $HEADER = null; + $FOOTER = null; + $LAYOUT = null; + $CUSTOMHEADER = null; + $CUSTOMFOOTER = null; + + $file = e_THEME.$theme."/theme.php"; + + if(!is_readable($file)) + { + return false; + } + + e107::set('css_enabled',false); + e107::set('js_enabled',false); + + require($file); + + e107::set('css_enabled',true); + e107::set('js_enabled',true); + + $head = array(); + $foot = array(); + + + if(isset($LAYOUT) && is_array($LAYOUT)) // $LAYOUT is a combined $HEADER,$FOOTER. + { + foreach($LAYOUT as $key=>$template) + { + if($key == '_header_' || $key == '_footer_' || $key == '_modal_') + { + continue; + } + + if(strpos($template,'{---}') !==false) + { + list($hd,$ft) = explode("{---}",$template); + $head[$key] = isset($LAYOUT['_header_']) ? $LAYOUT['_header_'] . $hd : $hd; + $foot[$key] = isset($LAYOUT['_footer_']) ? $ft . $LAYOUT['_footer_'] : $ft ; + } + else + { + e107::getMessage()->addDebug('Missing "{---}" in $LAYOUT["'.$key.'"] '); + } + } + unset($hd,$ft); + } + + + if(is_string($CUSTOMHEADER)) + { + $head['legacyCustom'] = $CUSTOMHEADER; + } + elseif(is_array($CUSTOMHEADER)) + { + foreach($CUSTOMHEADER as $k=>$v) + { + $head[$k] = $v; + } + } + + if(is_string($HEADER)) + { + $head['legacyDefault'] = $HEADER; + } + elseif(is_array($HEADER)) + { + foreach($HEADER as $k=>$v) + { + $head[$k] = $v; + } + + } + + if(is_string($CUSTOMFOOTER)) + { + $foot['legacyCustom'] = $CUSTOMFOOTER; + } + elseif(is_array($CUSTOMFOOTER)) + { + foreach($CUSTOMFOOTER as $k=>$v) + { + $foot[$k] = $v; + } + } + + + if(is_string($FOOTER)) + { + $foot['legacyDefault'] = $FOOTER; + } + elseif(is_array($FOOTER)) + { + foreach($FOOTER as $k=>$v) + { + $foot[$k] = $v; + } + } + + $layout = array(); + + foreach($head as $k=>$v) + { + $template = $head[$k]."\n{---}".$foot[$k]; + $layout['templates'][$k] = $template; + $layout['menus'][$k] = self::countMenus($template); + } + + + return $layout; + + + } + + + private static function countMenus($template) + { + if(preg_match_all("/\{MENU=([\d]{1,3})(:[\w\d]*)?\}/", $template, $matches)) + { + sort($matches[1]); + return $matches[1]; + } + + return array(); + } + + + + static function menuSelector() + { + + // $p = e107::getPref('e_menu_list'); // new storage for xxxxx_menu.php list. + $sql = e107::getDb(); + $frm = e107::getForm(); + + $done = array(); + + $pageMenu = array(); + $pluginMenu = array(); + + $sql->select("menus", "menu_name, menu_id, menu_pages, menu_path", "1 ORDER BY menu_name ASC"); + while ($row = $sql->fetch()) + { + + if(in_array($row['menu_name'],$done)) + { + continue; + } + + $done[] = $row['menu_name']; + + if(is_numeric($row['menu_path'])) + { + $pageMenu[] = $row; + } + else + { + $pluginMenu[] = $row; + } + + } + + $tab1 = ''; + + $tab2 = ''; + + $tabs = array( + 'custom' => array('caption'=>'', 'text'=>$tab1), + 'plugin' => array('caption'=>'', 'text'=>$tab2) + + ); + + + $defLayout =e107::getRegistry('core/e107/menu-manager/curLayout');; + + $text = ''; + + $text .= ""; + + + //TODO FIXME parse the theme file (or store it somewhere) to get the number of menu areas for each layout. ie. $menu_areas below. + + $layouts = self::getLayouts(); + + // $text .= print_a($layouts['menus'],true); + + $text .= ' + + '; + + + $text .= $frm->tabs($tabs); + + + + + + $text .= ''; + + $tp = e107::getParser(); + + $caption = MENLAN_22; + + ; + + $diz = "The Menu-Manager allows you to place and arrange your menus within your theme template. Hover over the sub-areas to modify existing menu items. "; + + $caption .= "toAttribute($diz)."\">".ADMIN_INFO_ICON.""; + + + return array('caption'=>$caption,'text'=>$text); + + + + + + + } + + + +} + + // XXX Menu Manager Re-Write with drag and drop and multi-dimensional array as storage. ($pref) // TODO Get Drag & Drop Working with the iFrame @@ -770,7 +1161,7 @@ class e_layout */ $this->curLayout = vartrue($_GET['configure'], $pref['sitetheme_deflayout']); - $this->renderLayout($this->curLayout); + $this->renderLayout($this->curLayout); @@ -1143,7 +1534,7 @@ class e_layout @@ -1314,7 +1705,7 @@ class e_layout // $ns->frontend = false; - $ns->tablerender("Menu Layout",$text); + $ns->tablerender(MENLAN_55,$text); } @@ -1377,21 +1768,19 @@ class e_layout //include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); -// FIXME - quick temporarry fix for missing icons on menu administration. We need different core style to be included (forced) here - e.g. e107_web/css/admin/sprite.css -if(e_IFRAME) //<-- Check config and delete buttons if modifying + + + +if (!empty($pref['e_header_list']) && is_array($pref['e_header_list'])) { - -//e107::js('core','bootstrap/js/bootstrap.min.js'); -//e107::css('core','bootstrap/css/bootstrap.min.css'); - e107::css('url','{e_THEME}/bootstrap3/admin_style.css'); - + foreach($pref['e_header_list'] as $val) + { + // no checks fore existing file - performance + e107_include_once(e_PLUGIN.$val."/e_header.php"); + } } - - - - $e_sub_cat = 'menus'; require_once(e_HANDLER."file_class.php"); @@ -1462,8 +1851,7 @@ if($_POST) - - + @@ -1486,6 +1874,7 @@ if($_POST) } else // Within the IFrame. { + $men->menuRenderPage(); } @@ -1505,7 +1894,7 @@ if($_POST) // ----------------------------------------------------------------------------- -require_once("footer.php"); + require_once("footer.php"); // ----------------------------------------------------------------------- diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 11347fb61..54c73e7df 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -162,6 +162,7 @@ class pluginmanager_form extends e_form if ($this->plug['plugin_version'] != $this->plug_vars['@attributes']['version'] && $this->plug['plugin_installflag']) { // $text .= "
plug['plugin_id']}'\" title='".EPL_UPGRADE." to v".$this->plug_vars['@attributes']['version']."' value='".EPL_UPGRADE."' />"; + e107::getMessage()->addInfo("".$tp->toHtml($this->plug['plugin_name'],false,'TITLE')." is ready to be upgraded. (see below)"); // TODO LAN $text .= "plug_vars['@attributes']['version']."\" >".ADMIN_UPGRADEPLUGIN_ICON.""; } @@ -616,7 +617,13 @@ class pluginManager{ if($total > $amount) { - $parms = $total.",".$amount.",".$from.",".e_SELF.'?mode='.$_GET['mode'].'&frm=[FROM]'; + $parms = $total.",".$amount.",".$from.",".e_SELF.'?mode=online&frm=[FROM]'; + + if(!empty($srch)) + { + $parms .= '&srch='.$srch; + } + $text .= "
".$tp->parseTemplate("{NEXTPREV=$parms}",TRUE)."
"; } @@ -686,13 +693,14 @@ class pluginManager{ define('e_IFRAME', true); $frm = e107::getForm(); $mes = e107::getMessage(); + $tp = e107::getParser(); // print_a($_GET); $string = base64_decode($_GET['src']); parse_str($string, $data); - if(e_DEBUG === true) + if(deftrue('e_DEBUG_MARKETPLACE')) { echo "DEBUG MODE ACTIVE (no downloading)
"; echo '$_GET[src]: '; @@ -703,10 +711,14 @@ class pluginManager{ return false; } + $pluginFolder = !empty($data['plugin_folder']) ? $tp->filter($data['plugin_folder']) : ''; + $pluginUrl = !empty($data['plugin_url']) ? $tp->filter($data['plugin_url']) : ''; + $pluginID = !empty($data['plugin_id']) ? $tp->filter($data['plugin_id']) : ''; + $pluginMode = !empty($data['plugin_mode']) ? $tp->filter($data['plugin_mode']) : ''; if(!empty($data['plugin_price'])) { - e107::getRedirect()->go($data['plugin_url']); + e107::getRedirect()->go($pluginUrl); return true; } @@ -718,10 +730,10 @@ class pluginManager{ // Server flush useless. It's ajax ready state 4, we can't flush (sadly) before that (at least not for all browsers) $mes->addSuccess(EPL_ADLAN_94); - if($mp->download($data['plugin_id'], $data['plugin_mode'], 'plugin')) + if($mp->download($pluginID, $pluginMode, 'plugin')) { $this -> pluginCheck(true); // rescan the plugin directory - $text = e107::getPlugin()->install($data['plugin_folder']); + $text = e107::getPlugin()->install($pluginFolder); $mes->addInfo($text); echo $mes->render('default', 'success'); @@ -737,7 +749,7 @@ class pluginManager{ - $text =""; + $text =""; // print_a($data); $text .= $frm->open('upload-url-form','post'); @@ -1460,7 +1472,7 @@ class pluginManager{ $pgf->plug = $plug; $text .= $pgf->renderTableRow($this->fields, $this->fieldpref, $data, 'plugin_id'); - +/* $folder = $plug['plugin_path']; if(!empty($versions[$folder]['version']) && version_compare( $plug['plugin_version'], $versions[$folder]['version'], '<')) { @@ -1469,7 +1481,7 @@ class pluginManager{ $lan = "A newer version of [x] is available for download."; e107::getMessage()->addInfo($tp->lanVars($lan,$link)); e107::getMessage()->addDebug("Local version: ".$plug['plugin_version']." Remote version: ".$versions[$folder]['version']); - } + }*/ } } diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 180588451..17ea06d6f 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -1263,7 +1263,11 @@ $text .= " - + "; + + if(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') // Only allow if an SSL login has been made. + { + $text .=" @@ -1272,10 +1276,9 @@ $text .= "
".PRFLAN_61."
- - -"; - + "; + } + // Secure Image/ Captcha $secureImage = array('signcode'=>PRFLAN_76, 'logcode'=>PRFLAN_81, "fpwcode"=>PRFLAN_138,'admincode'=>PRFLAN_222); foreach($secureImage as $key=>$label) @@ -1363,7 +1366,18 @@ $text .= " - + + + + + + + + + diff --git a/e107_admin/theme.php b/e107_admin/theme.php index b3933ad48..9ec2f1ee5 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -74,10 +74,13 @@ if(!empty($_GET['action'])) */ case 'info': - $string = base64_decode($_GET['src']); - parse_str($string,$p); - echo $themec->renderThemeInfo($p); - + if(!empty($_GET['src'])) + { + $string = base64_decode($_GET['src']); + parse_str($string,$p); + $themeInfo = e107::getSession()->get('thememanager/online/'.intval($p['id'])); + echo $themec->renderThemeInfo($themeInfo); + } break; case 'preview': @@ -164,7 +167,7 @@ if($mode == 'download' && !empty($_GET['src'])) return true; } - if(e_DEBUG === true) + if(deftrue('e_DEBUG_MARKETPLACE')) { echo "DEBUG MODE ACTIVE (no downloading)
"; echo '$_GET: '; diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index f5a0d4317..bb54550b9 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -59,7 +59,7 @@ $dbupdate = array(); // Array of core upgrade actions global $e107cache; -if (is_readable(e_ADMIN.'ver.php')) +if(is_readable(e_ADMIN.'ver.php')) { include(e_ADMIN.'ver.php'); } @@ -168,7 +168,7 @@ class e107Update if(varset($_POST['update_core']) && is_array($_POST['update_core'])) { $func = key($_POST['update_core']); - $message = $this->updateCore($func); + $this->updateCore($func); } if(varset($_POST['update']) && is_array($_POST['update'])) // Do plugin updates @@ -176,11 +176,7 @@ class e107Update $func = key($_POST['update']); $this->updatePlugin($func); } - - if(vartrue($message)) - { - $mes->addSuccess($message); - } + $this->renderForm(); } @@ -246,16 +242,20 @@ class e107Update { if(!$list = e107::getPlugin()->updateRequired()) { - return; + return false; } $frm = e107::getForm(); - + + $tp = e107::getParser(); + $text = ""; foreach($list as $path=>$val) { + $name = !empty($val['@attributes']['lan']) ? $tp->toHtml($val['@attributes']['lan'],false,'TITLE') : $val['@attributes']['name']; + $text .= " - + "; } @@ -425,18 +425,27 @@ function update_check() if ($update_needed === TRUE) { $frm = e107::getForm(); + $label = LAN_UPDATE." ".e107::getParser()->toGlyph('fa-arrow-right'); + - $txt = " + $text = "
- ".ADLAN_120." - ".$frm->admin_button('e107_system_update', LAN_UPDATE, 'other')." -
+

".ADLAN_120."

+ ".$frm->admin_button('e107_system_update', 'update', 'other', $label)." +
"; - - $mes->addInfo($txt); + + + // $text = ADLAN_120. "". e107::getParser()->toGlyph('fa-chevron-circle-right').""; + // $text .= "
"; + $mes->addInfo($text); + } + + + return $update_needed; } @@ -601,9 +610,9 @@ function update_706_to_800($type='') $sql2 = e107::getDb('sql2'); $tp = e107::getParser(); $ns = e107::getRender(); - + e107::getCache()->clearAll('db'); - e107::getCache()->clearAll('system'); + e107::getCache()->clear_sys('Config'); e107::getMessage()->setUnique(); @@ -779,7 +788,7 @@ function update_706_to_800($type='') // Move the maximum online counts from menu prefs to a separate pref - 'history' - e107::getCache()->clearAll('system'); + e107::getCache()->clear_sys('Config'); $menuConfig = e107::getConfig('menu',true,true); if ($menuConfig->get('most_members_online') || $menuConfig->get('most_guests_online') || $menuConfig->get('most_online_datestamp')) @@ -1184,9 +1193,7 @@ function update_706_to_800($type='') // $notify_prefs = $sysprefs -> get('notify_prefs'); // $notify_prefs = $eArrayStorage -> ReadArray($notify_prefs); - e107::getCache()->clearAll('system'); - - + e107::getCache()->clear_sys('Config'); $notify_prefs = e107::getConfig('notify',true,true)->getPref(); @@ -1961,5 +1968,18 @@ function convert_serialized($serializedData, $type='') return $data; } +function theme_foot() +{ + global $pref; + + if(!empty($_POST['update_core']['706_to_800'])) + { + $data = array('name'=>SITENAME, 'theme'=>$pref['sitetheme'], 'language'=>e_LANGUAGE, 'url'=>SITEURL, 'type'=>'upgrade'); + $base = base64_encode(http_build_query($data, null, '&')); + $url = "http://e107.org/e-install/".$base; + return ""; + } + +} ?> diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php index 165772d08..afbffbb5f 100755 --- a/e107_admin/users_extended.php +++ b/e107_admin/users_extended.php @@ -32,14 +32,16 @@ if(varset($_GET['mode']) == "ajax") if($tableName) { $sql = e107::getDb(); + $tp = e107::getParser(); $sub_action = ''; if(e_QUERY) { $tmp = explode(".", e_QUERY); - $action = $tmp[0]; + $action = $tp->filter($tmp[0]); $sub_action = varset($tmp[1], ''); + $sub_action = $tp->filter($sub_action); $id = varset($tmp[2], 0); unset($tmp); } @@ -1147,6 +1149,7 @@ $user = new users_ext; $frm = e107::getForm(); $mes = e107::getMessage(); +$tp = e107::getParser(); require_once(e_HANDLER.'user_extended_class.php'); require_once(e_HANDLER.'userclass_class.php'); @@ -1159,15 +1162,17 @@ $message_type = E_MESSAGE_SUCCESS; if (e_QUERY) { $tmp = explode(".", e_QUERY); - $action = $tmp[0]; + $action = $tp->filter($tmp[0]); $sub_action = varset($tmp[1],''); + $sub_action = $tp->filter($sub_action); $id = varset($tmp[2],0); unset($tmp); } // TODO $_POST['up_x'] check for the evil IE -$tmp = isset($_POST['up']) ? $_POST['up'] : false; -if ($tmp) +$tmp = isset($_POST['up']) ? $tp->filter($_POST['up']) : false; + +if (is_array($tmp)) { $tmp = array_values($tmp); $qs = explode(".", $tmp[0]); @@ -1184,8 +1189,9 @@ if ($tmp) } // TODO $_POST['down_x'] check for the evil IE -$tmp = isset($_POST['down']) ? $_POST['down'] : false; -if ($tmp) +$tmp = isset($_POST['down']) ? $tp->filter($_POST['down']) : false; + +if (is_array($tmp)) { $tmp = array_values($tmp); $qs = explode(".", $tmp[0]); @@ -1240,7 +1246,12 @@ if (isset($_POST['add_field'])) { if($_POST['user_type']==EUF_DB_FIELD) { - $_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']); + $_POST['user_values'] = array( + $tp->filter($_POST['table_db']), + $tp->filter($_POST['field_id']), + $tp->filter($_POST['field_value']), + $tp->filter($_POST['field_order']), + ); } if(!empty($_POST['sort_user_values'])) @@ -1287,7 +1298,12 @@ if (isset($_POST['update_field'])) { if($_POST['user_type']==EUF_DB_FIELD) { - $_POST['user_values'] = array($_POST['table_db'],$_POST['field_id'],$_POST['field_value'],$_POST['field_order']); + $_POST['user_values'] = array( + $tp->filter($_POST['table_db']), + $tp->filter($_POST['field_id']), + $tp->filter($_POST['field_value']), + $tp->filter($_POST['field_order']), + ); } if(!empty($_POST['sort_user_values'])) @@ -1412,10 +1428,10 @@ if($message) if(isset($_POST['table_db']) && !$_POST['add_field'] && !$_POST['update_field']) { $action = "continue"; - $current['user_extended_struct_name'] = $_POST['user_field']; - $current['user_extended_struct_parms'] = $_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']; - $current['user_extended_struct_text'] = $_POST['user_text']; - $current['user_extended_struct_type'] = $_POST['user_type']; + $current['user_extended_struct_name'] = $tp->filter($_POST['user_field']); + $current['user_extended_struct_parms'] = $tp->filter($_POST['user_include']."^,^".$_POST['user_regex']."^,^".$_POST['user_regexfail']."^,^".$_POST['user_hide']); + $current['user_extended_struct_text'] = $tp->filter($_POST['user_text']); + $current['user_extended_struct_type'] = $tp->filter($_POST['user_type']); $user->show_extended($current); } diff --git a/e107_admin/ver.php b/e107_admin/ver.php index c430e8881..edfec51af 100644 --- a/e107_admin/ver.php +++ b/e107_admin/ver.php @@ -16,6 +16,6 @@ if (!defined('e107_INIT')) { exit; } -$e107info['e107_version'] = "2.1.3 (git)"; +$e107info['e107_version'] = "2.1.4 (git)"; ?> \ No newline at end of file diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 0753695b9..dc566ab39 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -29,11 +29,11 @@ class admin_shortcodes if($parm=='alert') - { - $text = 'A new update is ready to install! Click to unzip and install v'.$cacheData.'. - Install'; + { //TODO LANVARS + $text = ADLAN_122.' v'.$cacheData.'. + '.ADLAN_121.''; //Install - $mes->addInfo($text); + $mes->addInfo($text); return; // $mes->render(); } @@ -41,17 +41,17 @@ class admin_shortcodes { return ' - '; + + + '; } @@ -1162,7 +1162,7 @@ class admin_shortcodes if($emls = $sql->count('mail_recipients', '(*)', "WHERE mail_status = 13")) { //$text .= "\n\t\t\t\t\t
".E_16_FAILEDLOGIN." ".ADLAN_146.": $flo
"; - $oldconfigs['e-mailout'][0] = array('icon'=>E_16_MAIL, 'title'=>"Pending Mailshots", 'url'=>e_ADMIN_ABS."mailout.php?mode=pending&action=list", 'total'=>$emls); + $oldconfigs['e-mailout'][0] = array('icon'=>E_16_MAIL, 'title'=>ADLAN_167, 'url'=>e_ADMIN_ABS."mailout.php?mode=pending&action=list", 'total'=>$emls); } @@ -1319,61 +1319,66 @@ Inverse 10 10 function sc_admin_update() { - if (!ADMIN) { return ''; } + if (!ADMIN) { return null; } - global $e107cache,$ns, $pref; - if (!varset($pref['check_updates'], FALSE)) { return ''; } + $pref = e107::getPref(); - if (is_readable(e_ADMIN.'ver.php')) + if(empty($pref['check_updates'])) { - include(e_ADMIN.'ver.php'); + return null; } - $feed = "http://sourceforge.net/export/rss2_projfiles.php?group_id=63748&rss_limit=5"; - $e107cache->CachePageMD5 = md5($e107info['e107_version']); + $cacheTag = 'Update_core'; - if($cacheData = $e107cache->retrieve('updatecheck', 3600, TRUE)) + if(!$cached = e107::getCache()->retrieve($cacheTag, 1440, true, true)) { - return $ns -> tablerender(LAN_NEWVERSION, $cacheData); + e107::getDebug()->log("Checking for Core Update"); + $status = e107::coreUpdateAvailable(); + + if($status === false) + { + $status = array('status'=>'not needed'); + } + + $cached = e107::serialize($status,'json'); + e107::getCache()->set_sys($cacheTag, $cached,true,true); } + else + { + e107::getDebug()->log("Using Cached Core Update Data"); + + } + + $data = e107::unserialize($cached); + + if($data === false || isset($data['status'])) + { + return null; + } + // Don't check for updates if running locally (comment out the next line to allow check - but // remember it can cause delays/errors if its not possible to access the Internet - if ((strpos(e_SELF,'localhost') !== FALSE) || (strpos(e_SELF,'127.0.0.1') !== FALSE)) { return ''; } - - $xml = e107::getXml(); - - require_once(e_HANDLER."magpie_rss.php"); - - $ftext = ''; - if($rawData = $xml -> getRemoteFile($feed)) + if(e_DEBUG !== true) { - $rss = new MagpieRSS( $rawData ); - list($cur_version,$tag) = explode(" ",$e107info['e107_version']); - $c = 0; - foreach($rss->items as $val) - { - $search = array((strstr($val['title'], '(')), 'e107', 'released', ' v'); - $version = trim(str_replace($search, '', $val['title'])); - - if(version_compare($version,$cur_version)==1) - { - $ftext = "e107 v".$version."
\n"; - break; - } - $c++; - } - } - else - { // Error getting data - $ftext = ADLAN_154; + if ((strpos(e_SELF,'localhost') !== false) || (strpos(e_SELF,'127.0.0.1') !== false)) { return null; } } - $e107cache->set('updatecheck', $ftext, TRUE); - if($ftext) - { - return $ns -> tablerender(LAN_NEWVERSION, $ftext); - } + + return ''; + + } // Does actually the same than ADMIN_SEL_LAN @@ -1887,7 +1892,7 @@ Inverse 10 10 $var[$key]['link'] = '#'.$key; $var[$key]['link_class'] = ' menuManagerSelect'; $var[$key]['active'] = ($key==$pref['sitetheme_deflayout']) ? true: false; - $var[$key]['include'] = "data-url='".$url = e_SELF."?configure=".$key."'"; + $var[$key]['include'] = " data-url='". e_SELF."?configure=".$key."' data-layout='".$key."' "; } $action = $pref['sitetheme_deflayout']; @@ -1895,7 +1900,9 @@ Inverse 10 10 $var = array($defLayout => $var[$defLayout]) + $var; - e107::getNav()->admin(ADLAN_6,$action, $var); + e107::setRegistry('core/e107/menu-manager/curLayout',$action); + + return e107::getNav()->admin(ADLAN_6,$action, $var); diff --git a/e107_core/shortcodes/batch/comment_shortcodes.php b/e107_core/shortcodes/batch/comment_shortcodes.php index be169ffcd..ee13f69c5 100644 --- a/e107_core/shortcodes/batch/comment_shortcodes.php +++ b/e107_core/shortcodes/batch/comment_shortcodes.php @@ -194,8 +194,11 @@ class comment_shortcodes extends e_shortcode return; } - // TODO put into a
    drop-down format. - $text = "".LAN_DELETE." "; + // TODO put into a
      drop-down format. + + e107::getDebug()->log($this->var); + + $text = "".LAN_DELETE." "; if($this->var['comment_blocked'] == 2) // pending approval. { diff --git a/e107_core/shortcodes/batch/contact_shortcodes.php b/e107_core/shortcodes/batch/contact_shortcodes.php index 1d65cb32e..fb425bff8 100644 --- a/e107_core/shortcodes/batch/contact_shortcodes.php +++ b/e107_core/shortcodes/batch/contact_shortcodes.php @@ -112,22 +112,29 @@ class contact_shortcodes extends e_shortcode function sc_contact_subject($parm='') { - return ""; + return ""; } - function sc_contact_body($parm='') + function sc_contact_body($parm=null) { - parse_str($parm, $parm); + if(is_string($parm)) + { + parse_str($parm, $parm); + } + $rows = vartrue($parm['rows'],10); $cols = vartrue($parm['cols'],70); + $placeholder = !empty($parm['placeholder']) ? "placeholder=\"".$parm['placeholder']."\"" : ""; if($cols > 60) { $size = 'input-xxlarge'; } + + - return ""; + return ""; } diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 62ea0855c..dfdac3578 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -357,6 +357,11 @@ class news_shortcodes extends e_shortcode return $this->sc_newsimage($parm); } + public function sc_news_related($parm=null) + { + return $this->sc_newsrelated($parm); + } + public function sc_news_visibility($parm=null) { $string= e107::getUserClass()->getIdentifier($this->news_item['news_class']); @@ -496,6 +501,7 @@ class news_shortcodes extends e_shortcode $tp = e107::getParser(); if (ADMIN && getperms('H')) { + //TODO - discuss - a pref for 'new browser window' loading, or a parm or leave 'new browser window' as default? $default = (deftrue('BOOTSTRAP')) ? $tp->toGlyph('icon-edit',false) : "\"".LAN_EDIT."\""; @@ -504,7 +510,7 @@ class news_shortcodes extends e_shortcode $class = varset($parm['class']); - return "".$adop_icon."\n"; + return "".$adop_icon."\n"; } else { @@ -848,6 +854,7 @@ class news_shortcodes extends e_shortcode { $src = $tp->thumbUrl($srcPath); $dimensions = $tp->thumbDimensions(); + $srcset = $tp->thumbSrcSet($srcPath,array('size'=>'2x')); } else @@ -876,6 +883,15 @@ class news_shortcodes extends e_shortcode $style = !empty($this->param['thumbnail']) ? $this->param['thumbnail'] : ''; + $imgParms = array( + 'class'=>$class, + 'alt'=>basename($src), + 'style'=>$style + ); + + + $imgTag = $tp->toImage($srcPath,$imgParms); + switch(vartrue($parm['type'])) { case 'src': @@ -883,12 +899,12 @@ class news_shortcodes extends e_shortcode break; case 'tag': - return ""; + return $imgTag; // ""; break; case 'url': default: - return "news_item)."'>"; + return "news_item)."'>".$imgTag.""; break; } } diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index b39f12075..be293d22a 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -268,7 +268,14 @@ class cpage_shortcodes extends e_shortcode return ""; } - parse_str($parm,$options); + if(is_string($parm)) + { + parse_str($parm,$options); + } + else + { + $options= $parm; + } $buttonText = (empty($this->var['menu_button_text'])) ? LAN_READ_MORE : $this->var['menu_button_text']; $buttonUrl = (empty($this->var['menu_button_url'])) ? $url : $tp->replaceConstants($this->var['menu_button_url']); @@ -341,6 +348,11 @@ class cpage_shortcodes extends e_shortcode function sc_cmenuicon($parm='') { + if($parm === 'css') + { + return str_replace(".glyph", "", $this->var['menu_icon']); + } + return e107::getParser()->toIcon($this->var['menu_icon'], array('space'=>' ')); } diff --git a/e107_core/shortcodes/batch/signup_shortcodes.php b/e107_core/shortcodes/batch/signup_shortcodes.php index c7eb75921..172b2e7d2 100755 --- a/e107_core/shortcodes/batch/signup_shortcodes.php +++ b/e107_core/shortcodes/batch/signup_shortcodes.php @@ -2,7 +2,7 @@ /* * e107 website system * - * Copyright (C) 2008-2012 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -32,8 +32,9 @@ class signup_shortcodes extends e_shortcode return "
      \n

      - ".LAN_NO." - ".LAN_YES."
      + + +

      @@ -88,7 +89,7 @@ class signup_shortcodes extends e_shortcode // 'signup' Creates a new XUP user if not found, otherwise it logs the person in. - $button = (defset('FONTAWESOME') === 4) ? $tp->toGlyph('fa-'.$ic, array('size'=>$size)) : ""; + $button = (defset('FONTAWESOME') === 4) ? $tp->toGlyph('fa-'.$ic, array('size'=>$size)) : ""; $text .= " "; } //TODO different icon options. see: http://zocial.smcllns.com/ @@ -103,7 +104,8 @@ class signup_shortcodes extends e_shortcode function sc_signup_xup_signup($parm) { $pref = e107::getPref('social_login_active'); - $tp = e107::getParser(); + $tp = e107::getParser(); + if(!empty($pref)) { $text = ""; @@ -129,7 +131,7 @@ class signup_shortcodes extends e_shortcode $ic = 'windows'; } - $button = (defset('FONTAWESOME') === 4) ? "".$tp->toGlyph('fa-'.$ic, array('size'=>$size))."" : ""; + $button = (defset('FONTAWESOME') === 4) ? "".$tp->toGlyph('fa-'.$ic, array('size'=>$size))."" : ""; $text .= " "; } @@ -359,7 +361,7 @@ class signup_shortcodes extends e_shortcode if ($pref) { - return $rs->form_radio("hideemail", 1, $default_email_setting==1)." ".LAN_YES."  ".$rs->form_radio("hideemail", 0,$default_email_setting==0)." ".LAN_NO; + return $rs->form_radio("hideemail", 1, $default_email_setting==1)."   ".$rs->form_radio("hideemail", 0,$default_email_setting==0)." "; } } @@ -555,7 +557,8 @@ class signup_shortcodes extends e_shortcode // allow main admin to view signup page for design/testing. function sc_signup_adminoptions() { - + + if(getperms('0')) { $pref = e107::getPref(); @@ -564,17 +567,17 @@ class signup_shortcodes extends e_shortcode if(intval($pref['user_reg']) !== 1) { - $adminMsg .= "
      User registration is currently disabled.
      "; + $adminMsg .= "
      ".LAN_SIGNUP_114."
      "; } $adminMsg .= " "; - $adminMsg .= $frm->checkbox('simulation',1, false, "Don't send email"); + $adminMsg .= $frm->checkbox('simulation',1, false, LAN_SIGNUP_119); return "
      ".$adminMsg."
      "; diff --git a/e107_core/shortcodes/single/wmessage.php b/e107_core/shortcodes/single/wmessage.php index 4de4f08c3..724d9498a 100644 --- a/e107_core/shortcodes/single/wmessage.php +++ b/e107_core/shortcodes/single/wmessage.php @@ -4,7 +4,7 @@ function wmessage_shortcode($parm='') { if($parm == 'hide') { - return; + return null; } $e107 = e107::getInstance(); @@ -43,6 +43,8 @@ function wmessage_shortcode($parm='') if (strpos($front_url, 'http') === FALSE) $front_url = SITEURL.$front_url; + + if (deftrue('e_FRONTPAGE') || ($parm == 'force') || ((e_SELF == $front_url) && (($parm == 'ignore_query') || (e_QUERY == $front_qry)))) { // Actually want to display a welcome message here @@ -52,8 +54,7 @@ function wmessage_shortcode($parm='') if($cacheData = $e107cache->retrieve('wmessage')) { - echo $cacheData; - return; + return $cacheData; } if (!defined('WMFLAG')) @@ -80,7 +81,7 @@ function wmessage_shortcode($parm='') if (isset($wmessage) && $wmessage) { - ob_start(); + $cache_data = ''; if(intval($pref['wm_enclose']) === 2) // carousel { $carousel= array(); @@ -89,22 +90,24 @@ function wmessage_shortcode($parm='') $carousel['slide-'.$k] = array('caption'=>$wmessageCaption[$k], 'text'=>$ns->tablerender($wmessageCaption[$k],$v, 'wm',true)); } - echo e107::getForm()->carousel('wmessage-carousel',$carousel); + $cache_data = e107::getForm()->carousel('wmessage-carousel',$carousel); } elseif(intval($pref['wm_enclose']) === 1) { - $ns->tablerender($wmcaption, implode("
      ",$wmessage), 'wm'); + $cache_data = $ns->tablerender($wmcaption, implode("
      ",$wmessage), 'wm', true); } else { - echo "
      "; - echo ($wmcaption) ? $wmcaption.'
      ' : ''; - echo implode('
      ',$wmessage); - echo "
      "; + $text = "
      "; + $text .= ($wmcaption) ? $wmcaption.'
      ' : ''; + $text .= implode('
      ',$wmessage); + $text .= "
      "; + $cache_data = $text; } - $cache_data = ob_get_flush(); + $e107cache->set('wmessage', $cache_data); + return $cache_data; } } } diff --git a/e107_core/templates/menu_template.php b/e107_core/templates/menu_template.php index c4d8635e1..dd1efd2a9 100644 --- a/e107_core/templates/menu_template.php +++ b/e107_core/templates/menu_template.php @@ -12,15 +12,15 @@ if (!defined('e107_INIT')) { exit; } $MENU_TEMPLATE['button']['body'] = '
      {CMENUBODY}
      {CPAGEBUTTON}'; $MENU_TEMPLATE['button']['end'] = ''; - $MENU_TEMPLATE['buttom-image']['start'] = '
      '; + $MENU_TEMPLATE['buttom-image']['start'] = '
      {SETIMAGE: w=360}'; $MENU_TEMPLATE['buttom-image']['body'] = '
      {CMENUIMAGE}
      {CPAGEBUTTON}'; $MENU_TEMPLATE['buttom-image']['end'] = '
      '; - $MENU_TEMPLATE['image-only']['start'] = '
      '; + $MENU_TEMPLATE['image-only']['start'] = '
      {SETIMAGE: w=360}'; $MENU_TEMPLATE['image-only']['body'] = '{CMENUIMAGE}'; $MENU_TEMPLATE['image-only']['end'] = '
      '; - $MENU_TEMPLATE['image-text-button']['start'] = '
      '; + $MENU_TEMPLATE['image-text-button']['start'] = '
      {SETIMAGE: w=360}'; $MENU_TEMPLATE['image-text-button']['body'] = '{CMENUIMAGE}{CMENUBODY}{CPAGEBUTTON}'; $MENU_TEMPLATE['image-text-button']['end'] = '
      '; ?> \ No newline at end of file diff --git a/e107_core/templates/navigation_template.php b/e107_core/templates/navigation_template.php index 79d80cc48..ab0520b51 100644 --- a/e107_core/templates/navigation_template.php +++ b/e107_core/templates/navigation_template.php @@ -54,7 +54,7 @@ $NAVIGATION_TEMPLATE['main']['end'] = '
    '; // Sub menu $NAVIGATION_TEMPLATE['main']['submenu_start'] = ' - '; // TEMPLATE FOR {NAVIGATION=side} diff --git a/e107_core/templates/signup_template.php b/e107_core/templates/signup_template.php index 54c69d51b..78b34cfa1 100755 --- a/e107_core/templates/signup_template.php +++ b/e107_core/templates/signup_template.php @@ -2,7 +2,7 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -21,8 +21,8 @@ define("REQUIRED_FIELD_MARKER", " *"); $sc_style['SIGNUP_DISPLAYNAME']['pre'] = "
- - - + - + @@ -136,7 +136,7 @@ $sc_style['SIGNUP_IMAGES']['post'] = " $sc_style['SIGNUP_IMAGECODE']['pre'] = " - + @@ -144,7 +144,7 @@ $sc_style['SIGNUP_IMAGECODE']['post'] = " $sc_style['SIGNUP_LOGINNAME']['pre'] = " - + @@ -160,7 +160,7 @@ $sc_style['SIGNUP_HIDE_EMAIL']['post'] = " $sc_style['SIGNUP_EMAIL_CONFIRM']['pre'] = " - + @@ -170,13 +170,13 @@ $sc_style['SIGNUP_XUP']['pre'] = "
* +
"; $sc_style['SIGNUP_PASSWORD2']['pre'] = " - + "; @@ -229,7 +229,7 @@ if(!defined($SIGNUP_BODY)) {SIGNUP_LOGINNAME} {SIGNUP_REALNAME} - + diff --git a/e107_core/templates/user_template.php b/e107_core/templates/user_template.php index d663e7a96..b9bab11c0 100644 --- a/e107_core/templates/user_template.php +++ b/e107_core/templates/user_template.php @@ -128,7 +128,7 @@ $sc_style['USER_SENDPM']['post'] = "
".LAN_USER_62."parseTemplate("{USER_SENDPM}", FALSE, $user_shortcodes)) $span++; +if (e107::getParser()->parseTemplate("{USER_SENDPM}", FALSE, $user_shortcodes)) $span++; $span = " rowspan='".$span."' "; //$sc_style['USER_PICTURE']['pre']="
"; + $text .= ""; } else { - $menuName = substr($row['menu_name'],0,-5); } - + $menuName = varset($menuName); $fields = e107::callMethod($obj,'config',$menuName); if(!$form = e107::getAddon($plug,'e_menu',$plug."_menu_form")) @@ -613,7 +667,7 @@ class e_menuManager { } else { - $text .= ""; + $text .= ""; } } @@ -656,7 +710,6 @@ class e_menuManager { if(!vartrue($_GET['vis'])) return; $sql = e107::getDb(); - $ns = e107::getRender(); $frm = e107::getForm(); $tp = e107::getParser(); @@ -665,7 +718,7 @@ class e_menuManager { if(!$sql->select("menus", "*", "menu_id=".intval($_GET['vis']))) { - $this->menuAddMessage("Couldn't Load Menu",E_MESSAGE_ERROR); + $this->menuAddMessage(MENLAN_48,E_MESSAGE_ERROR); return; } @@ -683,7 +736,7 @@ class e_menuManager { @@ -691,12 +744,12 @@ class e_menuManager { "; $checked = ($listtype == 1) ? " checked='checked' " : ""; - $text .= $frm->radio('listtype', 1, $checked, array('label'=>$tp->toHtml(MENLAN_26,true), 'class'=> 'e-save')); + $text .= $frm->radio('listtype', 1, $checked, array('label'=>$tp->toHTML(MENLAN_26,true), 'class'=> 'e-save')); $text .= "
"; // $text .= " ".MENLAN_26."
"; $checked = ($listtype == 2) ? " checked='checked' " : ""; - $text .= $frm->radio('listtype', 2, $checked, array('label'=> $tp->toHtml(MENLAN_27,true), 'class'=> 'e-save')); + $text .= $frm->radio('listtype', 2, $checked, array('label'=> $tp->toHTML(MENLAN_27,true), 'class'=> 'e-save')); // $text .= " ".MENLAN_27."
"; @@ -706,7 +759,7 @@ class e_menuManager {
- +
".MENLAN_28."
@@ -742,8 +795,6 @@ class e_menuManager { function menuActivate() // Activate Multiple Menus. { - global $admin_log; - $pref = e107::getPref(); $sql = e107::getDb(); $location = $this->menuActivateLoc; @@ -833,7 +884,7 @@ class e_menuManager { } - return $menuArea; + return varset($menuArea, array()); } @@ -862,18 +913,21 @@ class e_menuManager { function menuSaveParameters() { $sql = e107::getDb(); + $tp = e107::getParser(); $id = intval($_POST['menu_id']); if(isset($_POST['menu_parms'])) { - $parms = $sql->escape(strip_tags($_POST['menu_parms'])); + $parms = $tp->filter($_POST['menu_parms']); + $parms = $sql->escape(strip_tags($parms)); } else { unset($_POST['menu_id'], $_POST['mode'], $_POST['menuActivate'], $_POST['menuSetCustomPages']); - $parms = $sql->escape(e107::serialize($_POST)); + $parms = $tp->filter($_POST); + $parms = $sql->escape(e107::serialize($parms)); if(e_DEBUG == true) { @@ -907,18 +961,22 @@ class e_menuManager { function menuSaveVisibility() // Used by Ajax { - + $tp = e107::getParser(); $sql = e107::getDb(); - $pagelist = explode("\r\n", $_POST['pagelist']); + $pageList = $tp->filter($_POST['pagelist']); + $listType = $tp->filter($_POST['listtype']); + + $pagelist = explode("\r\n", $pageList); + for ($i = 0 ; $i < count($pagelist) ; $i++) { $pagelist[$i] = trim($pagelist[$i]); } $plist = implode("|", $pagelist); - $pageparms = $_POST['listtype'].'-'.$plist; + $pageparms = $listType.'-'.$plist; $pageparms = preg_replace("#\|$#", "", $pageparms); - $pageparms = (trim($_POST['pagelist']) == '') ? '' : $pageparms; + $pageparms = (trim($pageList) == '') ? '' : $pageparms; if($sql->update("menus", "menu_class='".intval($_POST['menu_class'])."', menu_pages='{$pageparms}' WHERE menu_id=".intval($_POST['menu_id']))) { @@ -1007,8 +1065,12 @@ class e_menuManager { if(!$sql->select('menus', 'menu_id', "menu_name='{$row['menu_name']}' AND menu_location = ".$this->menuNewLoc." AND menu_layout='".$this->dbLayout ."' LIMIT 1")) { $menu_count = $sql->count("menus", "(*)", " WHERE menu_location=".$this->menuNewLoc); - $sql->db_Update("menus", "menu_location='{$this->menuNewLoc}', menu_order=".($menu_count+1)." WHERE menu_id=".$this->menuId); - $sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout='".$this->dbLayout ."' "); + $sql->update("menus", "menu_location='{$this->menuNewLoc}', menu_order=".($menu_count+1)." WHERE menu_id=".$this->menuId); + + if(isset($location) && isset($position)) + { + $sql->update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout='".$this->dbLayout ."' "); + } } e107::getLog()->add('MENU_03',$row['menu_name'].'[!br!]'.$this->menuNewLoc.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,''); } @@ -1020,22 +1082,20 @@ class e_menuManager { function renderOptionRow($row) { - $sql = e107::getDb(); - $tp = e107::getParser(); - $ns = e107::getRender(); $frm = e107::getForm(); $text = ""; $pdeta = ""; - $color = ($color == "white") ? "#DDDDDD" : "white"; + $color = (varset($color) == "white") ? "#DDDDDD" : "white"; if($row['menu_pages'] == "dbcustom") { - $pdeta = MENLAN_42; + $pdeta = LAN_CUSTOM; } else { + $menuPreset = varset($menuPreset); $row['menu_name'] = preg_replace("#_menu$#i", "", $row['menu_name']); if($pnum = $this->checkMenuPreset($menuPreset,$row['menu_name'].'_menu')) { @@ -1060,6 +1120,7 @@ class e_menuManager { } else { + $menu_count = varset($menu_count); // Menu Choices box. $text .= "
"; $text .= $this->menuRenderMenu($row, $menu_count,true); @@ -1079,18 +1140,15 @@ class e_menuManager { global $HEADER, $FOOTER, $rs; $pref = e107::getPref(); $sql = e107::getDb(); - $tp = e107::getParser(); - $ns = e107::getRender(); - $frm = e107::getForm(); + $tp = e107::getParser(); - - - //FIXME - XHTML cleanup, front-end standards (elist, forms etc) - echo "
"; + + + // echo "
"; $this->parseheader($HEADER); // $layouts_str; $layout = ($this->curLayout); - $menuPreset = $this->getMenuPreset($layout); + $menuPreset = $this->getMenuPreset(); echo "
"; @@ -1119,8 +1177,7 @@ class e_menuManager { // $text .= "
\n"; } - $color = ""; - + $pageMenu = array(); $pluginMenu = array(); @@ -1148,14 +1205,14 @@ class e_menuManager { } - $text .= "
"; + $text .= ""; foreach($pageMenu as $row) { $text .= $this->renderOptionRow($row); } - $text .= ""; + $text .= ""; foreach($pluginMenu as $row) { $text .= $this->renderOptionRow($row); @@ -1188,18 +1245,27 @@ class e_menuManager { if(!count($this->menu_areas)) { $text = "
"; - $text .= "This layout does NOT contain any dynamic {MENU} areas.
"; + $text .= MENLAN_51."
"; - if(count($this->customMenu)) + if(isset($this->customMenu) && count($this->customMenu)) { - $text .= "

It DOES contain the following custom menus:

  • ".implode("
  • ",$this->customMenu)."

"; - $text .= "

Go to Custom-Menu area

"; + $text .= "

".MENLAN_52."

  • ".implode("
  • ",$this->customMenu)."

"; + $text .= "

".MENLAN_53."

"; } $text .= "
"; } // $ns -> tablerender(MENLAN_22.'blabla', $text); - echo $this->renderPanel(MENLAN_22, $text); + if(e_DEBUG_MENUMANAGER === true) + { + echo ""; + } + else + { + echo $this->renderPanel(MENLAN_22, $text); + } + + // echo $rs->form_close(); echo ""; @@ -1210,7 +1276,7 @@ class e_menuManager { { echo "
 
"; } - echo ""; + // echo ""; } @@ -1220,13 +1286,12 @@ class e_menuManager { //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------// function menuSelectLayout() { - global $rs; $pref = e107::getPref(); // onchange=\"urljump(this.options[selectedIndex].value);\" $text = ""; - $text .= "
Theme Layout: "; + $text .= "
".MENLAN_54.": "; $text .= "".$menu_id." {$pdeta}
+ $text .= "
".$menu_id." " . varset($pdeta) . "
- ".MENLAN_4." ". + ".LAN_VISIBLE_TO." ". r_userclass('menu_class', intval($_GET['class']), "off", "public,member,guest,admin,main,classes,nobody")."
".$frm->text('cookie_name', $pref['cookie_name'], 20)."
".PRFLAN_263.".
+ ".$frm->number('session_lifetime', $pref['session_lifetime'],6)." +
".PRFLAN_273."
+
".$val['@attributes']['name']."".$name." ".$frm->admin_button('update['.$path.']', LAN_UPDATE, 'warning', '', 'disabled='.$this->disabled)."
" - .LAN_SIGNUP_89." *
".LAN_SIGNUP_90." +
"; $sc_style['SIGNUP_DISPLAYNAME']['post'] = " @@ -31,8 +31,8 @@ $sc_style['SIGNUP_DISPLAYNAME']['post'] = " $sc_style['SIGNUP_REALNAME']['pre'] = "
" - .LAN_SIGNUP_91."".req($pref['signup_option_realname'])." + "; $sc_style['SIGNUP_REALNAME']['post'] = " @@ -119,7 +119,7 @@ $SIGNUP_SIGNATURE_END = " $sc_style['SIGNUP_SIGNATURE']['pre'] = "
".LAN_SIGNUP_93." ".req($pref['signup_option_signature'])." "; $sc_style['SIGNUP_SIGNATURE']['post'] = " @@ -128,7 +128,7 @@ $sc_style['SIGNUP_SIGNATURE']['post'] = " $sc_style['SIGNUP_IMAGES']['pre'] = "
".LAN_SIGNUP_94.req($pref['signup_option_image'])." "; $sc_style['SIGNUP_IMAGES']['post'] = "
".e107::getSecureImg()->renderLabel().req(2)." "; $sc_style['SIGNUP_IMAGECODE']['post'] = "
".LAN_SIGNUP_81.req(2)." "; $sc_style['SIGNUP_LOGINNAME']['post'] = "
".LAN_SIGNUP_39." "; $sc_style['SIGNUP_EMAIL_CONFIRM']['post'] = " "; $sc_style['SIGNUP_PASSWORD1']['post'] = "
".LAN_SIGNUP_84." * "; $sc_style['SIGNUP_PASSWORD2']['post'] = "
".LAN_USER_60."{SIGNUP_IS_MANDATORY=email} {SIGNUP_EMAIL} "; diff --git a/e107_core/url/news/url.php b/e107_core/url/news/url.php index 13e82db9a..d3fc8962f 100644 --- a/e107_core/url/news/url.php +++ b/e107_core/url/news/url.php @@ -79,7 +79,7 @@ class core_news_url extends eUrlConfig * - list/year?id=xxx -> ?year-id * - list/nextprev?route=xxx -> PARSED_ROUTE.[FROM] (recursive parse() call) */ - public function create($route, $params = array()) + public function create($route, $params = array(),$options = array()) { if(!$params) return 'news.php'; @@ -175,7 +175,7 @@ class core_news_url extends eUrlConfig return $url; } - public function parse($request) + public function parse($pathInfo, $params = array(), eRequest $request = null, eRouter $router = null, $config = array()) { // this config doesn't support parsing, it's done by the module entry script (news.php) // this means News are not available via single entry point if this config is currently active diff --git a/e107_core/url/page/url.php b/e107_core/url/page/url.php index 411846d96..ca8d117eb 100644 --- a/e107_core/url/page/url.php +++ b/e107_core/url/page/url.php @@ -116,7 +116,7 @@ class core_page_url extends eUrlConfig return $admin; } - public function parse($pathInfo) + public function parse($pathInfo, $params = array(), eRequest $request = null, eRouter $router = null, $config = array()) { // this config doesn't support parsing, it's done by the module entry script (news.php) // this means News are not available via single entry point if this config is currently active diff --git a/e107_core/url/user/url.php b/e107_core/url/user/url.php index dbe030d0a..32b5a0ded 100644 --- a/e107_core/url/user/url.php +++ b/e107_core/url/user/url.php @@ -116,7 +116,7 @@ class core_user_url extends eUrlConfig return $admin; } - public function parse($pathInfo, $params = array(), $request = NULL, $router = NULL, $config = array()) + public function parse($pathInfo, $params = array(), eRequest $request = NULL, eRouter $router = NULL, $config = array()) { // this config doesn't support parsing, it's done by the module entry script (news.php) // this means News are not available via single entry point if this config is currently active diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index 18fd42cdf..355aa62a8 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -243,6 +243,7 @@ 1 0 + 86400 %d %b %Y : %H:%M 0 diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 755a43a5e..820691e7a 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -4512,8 +4512,8 @@ class e_admin_ui extends e_admin_controller_ui { $this->getTreeModel()->setMessages(); // FIXME lan - if($delcount) e107::getMessage()->addSuccess($tp->lanVars(RL_LAN_085, $delcount, true)); - if($nfcount) e107::getMessage()->addError($tp->lanVars(RL_LAN_086, $nfcount,true)); + if($delcount) e107::getMessage()->addSuccess($tp->lanVars(LAN_UI_DELETED, $delcount, true)); + if($nfcount) e107::getMessage()->addError($tp->lanVars(LAN_UI_DELETED_FAILED, $nfcount,true)); } //$this->redirect(); @@ -6287,19 +6287,21 @@ class e_admin_form_ui extends e_form $text = "
{$plug} object not found. Try re-scanning plugin directories in Tools > Database.
".e107::getParser()->lanVars(MENLAN_46, $plug)."
No Fields Set in ".$row['menu_path']."e_menu.php
".MENLAN_47.": ".$row['menu_path']."e_menu.php
- ".MENLAN_4." ". + ".LAN_VISIBLE_TO." ". $frm->userclass('menu_class', $row['menu_class'], 'dropdown', array('options'=>"public,member,guest,admin,main,classes,nobody", 'class'=>'e-save'))."
Your Menus
".MENLAN_49."
Plugin Menus
".MENLAN_50."
+ // + //
oldnew parser
".print_a($oldvars,true)."".print_a($vars,true)."
"; + } + + + $vars['name'] = varset($vars['@attributes']['name']); + $vars['version'] = varset($vars['@attributes']['version']); + $vars['date'] = varset($vars['@attributes']['date']); + $vars['compatibility'] = varset($vars['@attributes']['compatibility']); + $vars['releaseUrl'] = varset($vars['@attributes']['releaseUrl']); + $vars['email'] = varset($vars['author']['@attributes']['email']); + $vars['website'] = varset($vars['author']['@attributes']['url']); + $vars['author'] = varset($vars['author']['@attributes']['name']); + $vars['info'] = varset($vars['description']); + $vars['category'] = self::getThemeCategory(varset($vars['category'])); + $vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']); + $vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']); + $vars['path'] = $path; + $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0; + $vars['preview'] = varset($vars['screenshots']['image']); + $vars['thumbnail'] = varset($vars['preview'][0]); + + if(!empty($vars['themePrefs'])) + { + + foreach($vars['themePrefs']['pref'] as $k=>$val) + { + $name = $val['@attributes']['name']; + $vars['preferences'][$name] = $val['@value']; + } + } + + + unset($vars['authorEmail'], $vars['authorUrl'], $vars['xhtmlCompliant'], $vars['cssCompliant'], $vars['description'],$vars['screenshots']); + + // Compile layout information into a more usable format. + + + $custom = array(); + /* + foreach ($vars['layouts'] as $layout) + { + foreach ($layout as $key=>$val) + { + $name = $val['@attributes']['name']; + unset($val['@attributes']['name']); + $lays[$name] = $val; + + + if(isset($val['customPages'])) + { + $cusArray = explode(" ", $val['customPages']); + $custom[$name] = array_filter($cusArray); + } + if(isset($val['custompages'])) + { + $cusArray = explode(" ", $val['custompages']); + $custom[$name] = array_filter(explode(" ", $val['custompages'])); + } + } + } + */ + + $lays = array(); + + foreach($vars['layouts']['layout'] as $k=>$val) + { + $name = $val['@attributes']['name']; + unset($val['@attributes']['name']); + $lays[$name] = $val; + + + if(isset($val['custompages'])) + { + if(is_string($val['custompages'])) + { + $custom[$name] = array_filter(explode(" ", $val['custompages'])); + } + elseif(is_array($val['custompages'])) + { + $custom[$name] = $val['custompages']; + } + } + } + + + $vars['layouts'] = $lays; + $vars['path'] = $path; + $vars['custompages'] = $custom; + + if(!empty($vars['stylesheets']['css'])) + { + $vars['css'] = array(); + + foreach($vars['stylesheets']['css'] as $val) + { + $notadmin = vartrue($val['@attributes']['admin']) ? false : true; + + $vars['css'][] = array("name" => $val['@attributes']['file'], "info"=> $val['@attributes']['name'], "nonadmin"=>$notadmin, 'scope'=> vartrue($val['@attributes']['scope'])); + } + + unset($vars['stylesheets']); + } + + + $vars['glyphs'] = array(); + if(!empty($vars['glyphicons']['glyph'])) + { + + foreach($vars['glyphicons']['glyph'] as $val) + { + $vars['glyphs'][] = array( + 'name' => $val['@attributes']['name'], + 'pattern' => $val['@attributes']['pattern'], + 'path' => $val['@attributes']['path'], + 'prefix' => $val['@attributes']['prefix'], + 'tag' => $val['@attributes']['tag'], + ); + + } + + unset($vars['glyphicons']); + + } + + + if($path == "landingzero" ) + { + + // e107::getMessage()->addDebug("

".$path."

"); + // e107::getMessage()->addDebug(print_a($vars,true)); + // $mes->addDebug("
"); + } + + if($path == "bootstrap3" ) + { + // print_a($vars); + // echo "
".print_a($vars,true)."".print_a($adv,true)."
"; + } + + + return $vars; + } + + + /** + * Validate and return the name of the categories. + * + * @param string [optional] $categoryfromXML + * @return string + */ + private static function getThemeCategory($categoryfromXML = '') + { + if(!$categoryfromXML) + { + return 'generic'; + } + + $tmp = explode(",", $categoryfromXML); + $category = array(); + foreach ($tmp as $cat) + { + $cat = trim($cat); + if(in_array($cat, self::$allowedCategories)) + { + $category[] = $cat; + } + else + { + $category[] = 'generic'; + } + } + + return implode(', ', $category); + + } + + +} + + + + + class themeHandler { @@ -520,7 +996,7 @@ class themeHandler $srch = preg_replace('/[^\w]/','', vartrue($_GET['srch'])); // check for cURL - if(!function_exists(curl_init)) + if(!function_exists('curl_init')) { $mes->addWarning(TPVLAN_79); } @@ -818,28 +1294,43 @@ class themeHandler function renderThemeInfo($theme) { - + + if(empty($theme)) + { + return null; + } + + if(!empty($theme['compatibility']) && $theme['compatibility'] == 2) + { + $theme['compatibility'] = '2.0'; + } + + global $pref; - $author = ($theme['email'] ? "".$theme['author']."" : $theme['author']); - $website = ($theme['website'] ? "".$theme['website']."" : ""); - $preview = "".($theme['preview'] ? "" : "").""; + $author = !empty($theme['email']) ? "".$theme['author']."" : $theme['author']; + $website = !empty($theme['website']) ? "".$theme['website']."" : ""; +// $preview = "".($theme['preview'] ? "" : "").""; $description = vartrue($theme['description'],''); - $compat = (intval($theme['compatibility']) == 2) ? "".number_format($theme['compatibility'], 1, '.','')." ".TPVLAN_78."": vartrue(number_format($theme['compatibility'], 1, '.',''),'1.0'); - $price = (!empty($theme['price'])) ? " ".$theme['price']."" : "".TPVLAN_77.""; - + $compat = (version_compare(1.9,$theme['compatibility'],'<')) ? "".$theme['compatibility']." ".TPVLAN_77."": vartrue($theme['compatibility'],'1.0'); + $price = (!empty($theme['price'])) ? " ".$theme['price']."" : "".TPVLAN_76.""; + + $text = ""; - // $text .= ""; - $text .= $author ? "" : ""; - $text .= $website ? "" : ""; - $text .= $theme['date'] ? "" : ""; - $text .= $compat ? "" : ""; + + + // $text .= ""; $text .= ""; - - $text .= $description ? "" : ""; - - + + $text .= ($author) ? "" : ""; + $text .= ($website) ? "" : ""; + $text .= !empty($theme['date']) ? "" : ""; + $text .= $compat ? "" : ""; + + $text .= !empty($description) ? "" : ""; + + // $text .= " // "; - if(vartrue($theme['category'])) + if(!empty($theme['category'])) { $text .= ""; } - + $itext = ''; - - // New in 0.8 WORK IN PROGRESS ---- - if($theme['layouts']) + if(!empty($theme['layouts'])) { $itext .= "

".$theme['name']." ".$theme['version']."

".LAN_AUTHOR.":".$author."
".TPVLAN_5.":".$website."
".TPVLAN_6.":".$theme['date']."
".TPVLAN_57.":".$compat."

".$theme['name']." ".$theme['version']."

".TPVLAN_75.":".$price."
".LAN_DESCRIPTION.":".$description."
".LAN_AUTHOR.":".$author."
".TPVLAN_5.":".$website."
".TPVLAN_6.":".$theme['date']."
".TPVLAN_57.":".$compat."
".LAN_DESCRIPTION.":".$description."
".TPVLAN_49.":XHTML "; // $text .= ($theme['xhtmlcompliant']) ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON; @@ -847,25 +1338,23 @@ class themeHandler // $text .= ($theme['csscompliant']) ? ADMIN_TRUE_ICON : ADMIN_FALSE_ICON; // $text .= "
".LAN_CATEGORY."".$theme['category']."
".TPVLAN_50.": "; - $itext .= ($mode == 1) ? "" : ""; + // $itext .= ($mode == 1) ? "" : ""; $itext .= " @@ -876,7 +1365,7 @@ class themeHandler { $itext .= " "; - if($mode == 1) + /* if($mode == 1) { if(!$pref['sitetheme_deflayout']) { @@ -887,17 +1376,17 @@ class themeHandler "; - } + }*/ $itext .= " - + "; } @@ -948,7 +1437,7 @@ class themeHandler if(E107_DEBUG_LEVEL > 0) { - $text .= print_a($theme, true); + // $text .= print_a($theme, true); } @@ -961,11 +1450,11 @@ class themeHandler $newConfile = e_THEME.$this->id."/theme_config.php"; - $legacyConfile = e_THEME.$this->id."/".$this->id."_config.php"; // @Deprecated - + $legacyConfile = e_THEME.$this->id."/".$this->id."_config.php"; // @Deprecated + if(is_readable($newConfile)) { - $confile = $newConfile; + $confile = $newConfile; } elseif(is_readable($legacyConfile))// TODO Eventually remove it. { @@ -983,13 +1472,18 @@ class themeHandler $mes->addDebug("Loading : ".$confile); include ($confile); $className = 'theme_'.$this->id; - if(class_exists($className)) + + if(class_exists('theme_config')) // new v2.1.4 theme_config is the class name. + { + $this->themeConfigObj = new theme_config(); + } + elseif(class_exists($className)) // old way. { $this->themeConfigObj = new $className(); } else { - $this->themeConfigObj = FALSE; + $this->themeConfigObj = false; } } @@ -1000,19 +1494,35 @@ class themeHandler { $mes = e107::getMessage(); - $mes->addDebug(TPVLAN_87); + $frm = e107::getForm(); + $mes->addDebug("Rendering Theme Config"); $this->loadThemeConfig(); - + + $value = e107::getThemeConfig($this->id)->getPref(); + if($this->themeConfigObj) { $var = call_user_func(array(&$this->themeConfigObj, 'config')); - vartrue($text); // avoid notice + $text = ''; // avoid notice - foreach ($var as $val) + foreach ($var as $field=>$val) { - $text .= ""; + } + else + { + if(!empty($val['multilan']) && isset($value[$field][e_LANGUAGE])) + { + $value[$field] = varset($value[$field][e_LANGUAGE],''); + } + + $text .= ""; + } } return $text; @@ -1020,6 +1530,8 @@ class themeHandler } + + function renderThemeHelp() { @@ -1033,9 +1545,28 @@ class themeHandler function setThemeConfig() { $this->loadThemeConfig(); + if($this->themeConfigObj) { - return call_user_func(array(&$this->themeConfigObj, 'process')); + $name = get_class($this->themeConfigObj); + + if($name === 'theme_config') // v2.1.4 - don't use process() method. + { + $pref = e107::getThemeConfig(); + + $theme_pref = array(); + + $fields = call_user_func(array(&$this->themeConfigObj, 'config')); + + foreach($fields as $field=>$data) + { + $theme_pref[$field] = $_POST[$field]; + } + + return $pref->setPref($theme_pref)->save(true,true,false); + } + + return call_user_func(array(&$this->themeConfigObj, 'process')); //pre v2.1.4 } } @@ -1066,7 +1597,7 @@ class themeHandler $thumbPath = $theme['thumbnail']; $previewPath = $theme['preview'][0]; } - elseif(vartrue($theme['preview'][0])) + elseif(!empty($theme['preview'][0])) { $thumbPath = e_THEME.$theme['path'] ."/".$theme['preview'][0]; $previewPath = e_THEME.$theme['path'] ."/".$theme['preview'][0]; @@ -1089,6 +1620,9 @@ class themeHandler 'price' => $theme['price'] ); + + e107::getSession()->set('thememanager/online/'.$theme['id'], $theme); + $d = http_build_query($srcData,false,'&'); $base64 = base64_encode($d); // e107::getDebug()->log($theme['name'].': '.strlen($base64)); @@ -1260,15 +1794,11 @@ class themeHandler "; @@ -1709,10 +2239,12 @@ class themeHandler global $frm,$sql; // if there is 1 entry, then it's not the same array. - $tmp = (varset($pluginOpts['plugin'][1])) ? $pluginOpts['plugin'] : $pluginOpts; + // $tmp = (varset($pluginOpts['plugin'][1])) ? $pluginOpts['plugin'] : $pluginOpts; $text = ""; + + - foreach ($tmp as $p) + foreach ($pluginOpts as $p) { $plug = trim($p['@attributes']['name']); @@ -1782,12 +2314,14 @@ class themeHandler $deflayout = $this->findDefault($name); $customPages = $this->themeArray[$name]['custompages']; $version = $this->themeArray[$name]['version']; + $glyphs = $this->themeArray[$name]['glyphs']; $core->set('sitetheme', $name); $core->set('themecss', 'style.css'); $core->set('sitetheme_layouts', $layout); $core->set('sitetheme_deflayout', $deflayout); $core->set('sitetheme_custompages', $customPages); + $core->set('sitetheme_glyphicons', $glyphs); $core->set('sitetheme_version', $version); @@ -1811,10 +2345,8 @@ class themeHandler if($core->save()) { - //TODO LANs - - $mes->addDebug("Default Layout: ".$deflayout); - $mes->addDebug("Custom Pages: ".print_a($customPages,true)); + $mes->addDebug(MENLAN_31.": ".$deflayout); + $mes->addDebug(MENLAN_56.": ".print_a($customPages,true)); $med = e107::getMedia(); $med->import('_common_image', e_THEME.$name, "^.*?logo.*?(\.png|\.jpeg|\.jpg|\.JPG|\.GIF|\.PNG)$"); @@ -2064,257 +2596,19 @@ class themeHandler function parse_theme_php($path) { - $CUSTOMPAGES = ""; - $tp = e107::getParser(); - $fp = fopen(e_THEME.$path."/theme.php", "r"); - $themeContents = fread($fp, filesize(e_THEME.$path."/theme.php")); - fclose($fp); - - - preg_match('/themename(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['name'] = varset($match[3], ''); - preg_match('/themeversion(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['version'] = varset($match[3], ''); - preg_match('/themeauthor(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['author'] = varset($match[3], ''); - preg_match('/themeemail(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['email'] = varset($match[3], ''); - preg_match('/themewebsite(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['website'] = varset($match[3], ''); - preg_match('/themedate(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['date'] = varset($match[3], ''); - preg_match('/themeinfo(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['info'] = varset($match[3], ''); - preg_match('/xhtmlcompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); - $xhtml = strtolower($match[2]); - $themeArray['xhtmlcompliant'] = ($xhtml == "true" ? "1.1" : false); - - preg_match('/csscompliant(\s*?=\s*?)(\S*?);/si', $themeContents, $match); - $css = strtolower($match[2]); - $themeArray['csscompliant'] = ($css == "true" ? "2.1" : false); - - /* preg_match('/CUSTOMPAGES(\s*?=\s*?)("|\')(.*?)("|\');/si', $themeContents, $match); - $themeArray['custompages'] = array_filter(explode(" ",$match[3]));*/ - - $themeContentsArray = explode("\n", $themeContents); - - preg_match_all("#\\$"."CUSTOMHEADER\[(\"|')(.*?)('|\")\].*?#",$themeContents,$match); - $customHeaderArray = $match[2]; - - preg_match_all("#\\$"."CUSTOMFOOTER\[(\"|')(.*?)('|\")\].*?#",$themeContents,$match); - $customFooterArray = $match[2]; - - if(!$themeArray['name']) - { - unset($themeArray); - } - - - $lays['legacyDefault']['@attributes'] = array('title'=>'Default', - 'plugins'=>'', - 'default'=>'true'); - - // load custompages from theme.php only when theme.xml doesn't exist. - if(!file_exists(e_THEME.$path."theme.xml")) - { - foreach ($themeContentsArray as $line) - { - if(strstr($line, "CUSTOMPAGES")) - { - eval(str_replace("$", "\$", $line)); // detect arrays also. - } - } - - if(is_array($CUSTOMPAGES)) - { - foreach ($CUSTOMPAGES as $key=>$val) - { - $themeArray['custompages'][$key] = explode(" ", $val); - } - } - elseif($CUSTOMPAGES) - { - $themeArray['custompages']['legacyCustom'] = explode(" ", $CUSTOMPAGES); - $lays['legacyCustom']['@attributes'] = array('title'=>'Custom', - 'plugins'=>''); - } - - - foreach($customHeaderArray as $tm) - { - $lays[$tm]['@attributes'] = array('title'=>str_replace("_"," ",$tm), - 'plugins'=>''); - } - - foreach($customFooterArray as $tm) - { - $lays[$tm]['@attributes'] = array('title'=>str_replace("_"," ",$tm), - 'plugins'=>''); - } - } - - $themeArray['path'] = $path; - $themeArray['layouts'] = $lays; - - if(file_exists(e_THEME.$path."/preview.jpg")) - { - $themeArray['preview'] = array("preview.jpg"); - $themeArray['thumbnail'] = "preview.jpg"; - } - - if(file_exists(e_THEME.$path."/preview.png")) - { - $themeArray['preview'] = array("preview.png"); - $themeArray['thumbnail'] = "preview.png"; - } - // echo "

".$themeArray['name']."

"; - // print_a($lays); - - return $themeArray; + return e_theme::parse_theme_php($path); } function parse_theme_xml($path) { - $tp = e107::getParser(); - $xml = e107::getXml(); - - // loadLanFiles($path, 'admin'); // Look for LAN files on default paths - // layout should always be an array. - $xml->setOptArrayTags('layout,screenshots/image'); - $xml->setOptStringTags('menuPresets,customPages,custompages'); - - - // $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', true, true); - // $oldvars = - $vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', 'advanced', true); // must be 'advanced' - - if($path == "bootstrap3" ) - { - // echo "
".TPVLAN_55."".TPVLAN_55."".LAN_TITLE." ".TPVLAN_78."
"; - $itext .= ($val['@attributes']['previewFull']) ? "" : ""; + $itext .= !empty($val['@attributes']['previewFull']) ? "" : ""; $itext .= $val['@attributes']['title']; - $itext .= ($val['@attributes']['previewFull']) ? "" : ""; + $itext .= !empty($val['@attributes']['previewFull']) ? "" : ""; $itext .= ($pref['sitetheme_deflayout'] == $key) ? " (default)" : ""; $itext .= "".$val['@attributes']['plugins']." ".varset($val['@attributes']['plugins'])."  "; - $itext .= ($val['menuPresets']) ? ADMIN_TRUE_ICON : " "; + $itext .= !empty($val['menuPresets']) ? ADMIN_TRUE_ICON : " "; $itext .= "
".$val['caption'].":".$val['html']."
".$val['help']."
+ if(is_numeric($field)) + { + $text .= "
".$val['caption'].":".$val['html']."
".$val['help']."
".$val['title'].":".$frm->renderElement($field, $value[$field], $val)."
".$val['help']."
+
".TPVLAN_53." "; - - if(varset($theme['plugins'])) - { - foreach ($theme['plugins'] as $key=>$val) + + if(!empty($theme['plugins']['plugin'])) { - $text .= $this->renderPlugins($theme['plugins']); - $text .= " "; + $text .= $this->renderPlugins($theme['plugins']['plugin']); } - } $text .= " 
- // - //
oldnew parser
".print_a($oldvars,true)."".print_a($vars,true)."
"; - } - - - $vars['name'] = varset($vars['@attributes']['name']); - $vars['version'] = varset($vars['@attributes']['version']); - $vars['date'] = varset($vars['@attributes']['date']); - $vars['compatibility'] = varset($vars['@attributes']['compatibility']); - $vars['releaseUrl'] = varset($vars['@attributes']['releaseUrl']); - $vars['email'] = varset($vars['author']['@attributes']['email']); - $vars['website'] = varset($vars['author']['@attributes']['url']); - $vars['author'] = varset($vars['author']['@attributes']['name']); - $vars['info'] = varset($vars['description']); - $vars['category'] = $this->getThemeCategory(varset($vars['category'])); - $vars['xhtmlcompliant'] = varset($vars['compliance']['@attributes']['xhtml']); - $vars['csscompliant'] = varset($vars['compliance']['@attributes']['css']); - $vars['path'] = $path; - $vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0; - $vars['preview'] = varset($vars['screenshots']['image']); - $vars['thumbnail'] = varset($vars['preview'][0]); - - if(!empty($vars['themePrefs'])) - { - - foreach($vars['themePrefs']['pref'] as $k=>$val) - { - $name = $val['@attributes']['name']; - $vars['preferences'][$name] = $val['@value']; - } - } + return e_theme::parse_theme_xml($path); - - unset($vars['authorEmail'], $vars['authorUrl'], $vars['xhtmlCompliant'], $vars['cssCompliant'], $vars['description'],$vars['screenshots']); - - // Compile layout information into a more usable format. - - - $custom = array(); - /* - foreach ($vars['layouts'] as $layout) - { - foreach ($layout as $key=>$val) - { - $name = $val['@attributes']['name']; - unset($val['@attributes']['name']); - $lays[$name] = $val; - - - if(isset($val['customPages'])) - { - $cusArray = explode(" ", $val['customPages']); - $custom[$name] = array_filter($cusArray); - } - if(isset($val['custompages'])) - { - $cusArray = explode(" ", $val['custompages']); - $custom[$name] = array_filter(explode(" ", $val['custompages'])); - } - } - } - */ - - foreach($vars['layouts']['layout'] as $k=>$val) - { - $name = $val['@attributes']['name']; - unset($val['@attributes']['name']); - $lays[$name] = $val; - - - if(isset($val['custompages'])) - { - if(is_string($val['custompages'])) - { - $custom[$name] = array_filter(explode(" ", $val['custompages'])); - } - elseif(is_array($val['custompages'])) - { - $custom[$name] = $val['custompages']; - } - } - } - - - $vars['layouts'] = $lays; - $vars['path'] = $path; - $vars['custompages'] = $custom; - - if(vartrue($vars['stylesheets']['css'])) - { - $vars['css'] = array(); - - foreach($vars['stylesheets']['css'] as $val) - { - $notadmin = vartrue($val['@attributes']['admin']) ? false : true; - - $vars['css'][] = array("name" => $val['@attributes']['file'], "info"=> $val['@attributes']['name'], "nonadmin"=>$notadmin, 'scope'=> vartrue($val['@attributes']['scope'])); - } - - unset($vars['stylesheets']); - } - - // - - $mes = e107::getMessage(); // DEBUG - - if($path == "leasure" ) - { - - // $mes->addDebug("

".$path."

"); - // $mes->addDebug(print_a($vars,true)); - // $mes->addDebug("
"); - } - - if($path == "bootstrap3" ) - { - // print_a($vars); - // echo "
".print_a($vars,true)."".print_a($adv,true)."
"; - } - - - return $vars; } + + + + } interface e_theme_config @@ -2323,17 +2617,17 @@ interface e_theme_config * Triggered on theme settings submit * Catch and save theme configuration */ - public function process(); +// public function process(); /** * Theme configuration user interface * Print out config fields */ - public function config(); + public function config(); // only config() is absolutely required. /** * Theme help tab * Print out theme help content */ - public function help(); +// public function help(); } diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php index 667615046..e07ea0ccf 100644 --- a/e107_handlers/xml_class.php +++ b/e107_handlers/xml_class.php @@ -872,9 +872,9 @@ class xmlClass * @param boolean $debug [optional] * @return string text / file for download */ - public function e107Export($xmlprefs, $tables, $debug = FALSE) + public function e107Export($xmlprefs, $tables, $plugPrefs, $mode = false) { - error_reporting(0); + // error_reporting(0); $e107info = array(); require_once(e_ADMIN."ver.php"); @@ -904,7 +904,7 @@ class xmlClass { continue; } - elseif($debug == true) + elseif($mode === 'debug') { echo "
Original/Modiied ".$key.""; var_dump($default[$key],$val); @@ -921,6 +921,32 @@ class xmlClass $text .= "\t\n"; } + + if(!empty($plugPrefs)) + { + $text .= "\t\n"; + + foreach($plugPrefs as $plug) + { + $prefs = e107::getPlugConfig($plug)->getPref(); + + foreach($prefs as $key=>$val) + { + if(isset($val)) + { + $text .= "\t\t<".$plug." name=\"".$key."\">".$this->e107ExportValue($val)."\n"; + } + + } + + } + + $text .= "\t\n"; + } + + + + if(varset($tables)) { $text .= "\t\n"; @@ -958,10 +984,16 @@ class xmlClass $text .= ""; - if($debug==TRUE) + + if($mode === 'return') + { + return $text; + } + + if($mode === 'debug') { echo "
".htmlentities($text)."
"; - return TRUE; + return null; } else { @@ -991,12 +1023,16 @@ class xmlClass * Return an Array of core preferences from e107 XML Dump data * * @param array $XMLData Raw XML e107 Export Data - * @param string $prefType [optional] the type of core pref: core|emote|ipool|menu etc. + * @param string $prefType [optional] the type of core pref: core|emote|ipool|menu etc or plugin-folder name + * @param string $mode core|plugin * @return array preference array equivalent to the old $pref global; */ - public function e107ImportPrefs($XMLData, $prefType='core') + public function e107ImportPrefs($XMLData, $prefType='core', $mode='core') { - if(!vartrue($XMLData['prefs'][$prefType])) + + $key = ($mode === 'core') ? 'prefs' : 'pluginPrefs'; + + if(!vartrue($XMLData[$key][$prefType])) { return array(); } @@ -1004,7 +1040,7 @@ class xmlClass //$mes = eMessage::getInstance(); $pref = array(); - foreach($XMLData['prefs'][$prefType] as $val) + foreach($XMLData[$key][$prefType] as $val) { $name = $val['@attributes']['name']; // if(strpos($val['@value'], 'array (') === 0) @@ -1051,8 +1087,10 @@ class xmlClass } $ret = array(); - - if(vartrue($xmlArray['prefs'])) // Save Core Prefs + + // ----------------- Save Core Prefs --------------------- + + if(!empty($xmlArray['prefs'])) { foreach($xmlArray['prefs'] as $type=>$array) { @@ -1080,6 +1118,40 @@ class xmlClass } } + + // --------------- Save Plugin Prefs --------------------- + + if(!empty($xmlArray['pluginPrefs'])) + { + foreach($xmlArray['pluginPrefs'] as $type=>$array) + { + + $pArray = $this->e107ImportPrefs($xmlArray,$type, 'plugin'); + + if($mode == 'replace') // merge with existing, add new + { + e107::getPlugConfig($type)->setPref($pArray); + } + else // 'add' only new prefs + { + foreach ($pArray as $pname => $pval) + { + e107::getPlugConfig($type)->add($pname, $pval); // don't parse x/y/z + } + } + + if($debug == false) + { + e107::getPlugConfig($type) + ->setParam('nologs', $noLogs) + ->save(FALSE,TRUE); + } + } + } + + + + if(vartrue($xmlArray['database'])) { foreach($xmlArray['database']['dbTable'] as $val) diff --git a/e107_images/logoHD.png b/e107_images/logoHD.png new file mode 100644 index 000000000..cc8559e0f Binary files /dev/null and b/e107_images/logoHD.png differ diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php index 439d3ac9e..e493d06f6 100644 --- a/e107_languages/English/English.php +++ b/e107_languages/English/English.php @@ -1,6 +1,10 @@ \ No newline at end of file + +?> diff --git a/e107_languages/English/admin/lan_image.php b/e107_languages/English/admin/lan_image.php index be2466c5e..7b4a462be 100644 --- a/e107_languages/English/admin/lan_image.php +++ b/e107_languages/English/admin/lan_image.php @@ -43,7 +43,7 @@ define("IMALAN_15", "Show nothing"); // define("IMALAN_17", "Click here"); define("IMALAN_18", "Uploaded Avatar Images"); // define("IMALAN_19", "Show 'disabled' message"); -define('IMALAN_20', "Nothing changed"); +define("IMALAN_20", "Nothing changed"); define("IMALAN_21", "Used by"); define("IMALAN_22", "Image not in use"); define("IMALAN_23", "Avatars"); @@ -77,123 +77,127 @@ define("IMALAN_51", "Avatar for "); define("IMALAN_52", "Path to ImageMagick appears to be incorrect"); define("IMALAN_53", "Path to ImageMagick appears to be correct, but convert file may not be valid"); define("IMALAN_54", "GD version installed:"); -define('IMALAN_55', "Not installed"); +define("IMALAN_55", "Not installed"); //v0.8 //uploaded avatar list -define('IMALAN_56', "Click to select"); -define('IMALAN_57', "Image too big - click to enlarge"); +define("IMALAN_56", "Click to select"); +define("IMALAN_57", "Image too big - click to enlarge"); //avatar check -// define('IMALAN_61', "Options"); -define('IMALAN_62', "Reason"); -define('IMALAN_65', "Nothing found"); -define('IMALAN_66', "Filename"); -define('IMALAN_68', "Close"); -define('IMALAN_69', "Folder"); -define('IMALAN_70', "Non-system folder is found!"); +// define("IMALAN_61", "Options"); +define("IMALAN_62", "Reason"); +define("IMALAN_65", "Nothing found"); +define("IMALAN_66", "Filename"); +define("IMALAN_68", "Close"); +define("IMALAN_69", "Folder"); +define("IMALAN_70", "Non-system folder is found!"); // define("IMALAN_72", "Icons"); -define('IMALAN_73', "Thumbnail Quality"); -define('IMALAN_74', "Set this as low as possible before quality loss is apparent. Max. 100"); -define('IMALAN_75', "Avatar Width"); -define('IMALAN_76', "Avatar images will be constrained to these dimensions (in pixels)"); -define('IMALAN_77', "Avatar Height"); -define('IMALAN_78', "General"); -define('IMALAN_79', "Resize-Image Dimensions"); -define('IMALAN_80', "Watermark Activation"); -define('IMALAN_81', "All images with a width or height greater than this value will be given a watermark during resizing."); -define('IMALAN_82', "Watermark Text"); -define('IMALAN_83', "Optional Watermark Text"); -define('IMALAN_84', "Watermark Font"); -define('IMALAN_85', "Optional Watermark Font. Upload more .ttf fonts to the /fonts folder in your theme directory."); -define('IMALAN_86', "Watermark Size"); -define('IMALAN_87', "Size of the font in pts"); -define('IMALAN_88', "Watermark Position"); -define('IMALAN_89', "Watermark"); -define('IMALAN_90', "Watermark Margin"); -define('IMALAN_91', "The distance that watermark will appear from the edge of the image."); -define('IMALAN_92', "Watermark Color"); -define('IMALAN_93', "Color of the watermark eg. 000000"); -define('IMALAN_94', "Watermark Shadow-Color"); -define('IMALAN_95', "Shadow Color of the watermark eg. ffffff"); -define('IMALAN_96', "Watermark Opacity"); -define('IMALAN_97', "Enter a number between 1 and 100"); -define('IMALAN_98', "Default YouTube account"); -define('IMALAN_99', "Used by the Media-Manager Youtube browser. Enter account name. eg. e107inc"); -define('IMALAN_100', "Show Related Videos"); -define('IMALAN_101', "Show Video Info"); -define('IMALAN_102', "Show Closed-Captions by default"); -define('IMALAN_103', "Use Modest Branding"); -define('IMALAN_104', "Make the YouTube bbcode responsive"); -define('IMALAN_105', "Resize images during media import"); -define('IMALAN_106', "Leave empty to disable"); -define('IMALAN_107', "Couldn't generated path from upload data"); -define('IMALAN_108', "Couldn't move file from [x] to [y]"); -define('IMALAN_109', "Couldn't get path"); -define('IMALAN_110', "Path"); -define('IMALAN_111', "Couldn't detect mime-type([x]). Upload failed."); -define('IMALAN_112', "Couldn't create folder ([x])."); -define('IMALAN_113', "Scanning for new media (images, videos, files) in folder:"); -define('IMALAN_114', "No media Found! Please upload some files."); -define('IMALAN_115', "Title (internal use)"); -define('IMALAN_116', "Caption (seen by public)"); -//define('IMALAN_117', "Author"); // use LAN_AUTHOR -define('IMALAN_118', "Mime Type"); -define('IMALAN_119', "File Size"); -define('IMALAN_120', "Dimensions"); -define('IMALAN_121', "Preview"); // use LAN_PREVIEW -define('IMALAN_122', "[x] couldn't be renamed. Check file perms."); -define('IMALAN_123', "Import into Category:"); -define('IMALAN_124', "Import Selected Files"); -define('IMALAN_125', "Delete Selected Files"); -define('IMALAN_126', "Please check at least one file."); -define('IMALAN_127', "Couldn't get file info from:"); -define('IMALAN_128', "Importing Media:"); -define('IMALAN_129', "You are about to delete [x] records and ALL CORRESPONDING FILES! Please confirm to continue!"); -define('IMALAN_130', "Previous page"); -define('IMALAN_131', "Next page"); -define('IMALAN_132', "Tags/Keywords"); -define('IMALAN_133', "Bottom Right"); -define('IMALAN_134', "Bottom Left"); -define('IMALAN_135', "Top Right"); -define('IMALAN_136', "Top Left"); -define('IMALAN_137', "Center"); -define('IMALAN_138', "Right"); -define('IMALAN_139', "Left"); -define('IMALAN_140', "Top"); -define('IMALAN_141', "Bottom"); -define('IMALAN_142', "Tile"); -define('IMALAN_143', "Image"); -define('IMALAN_144', "File"); -define('IMALAN_145', "From your computer"); -define('IMALAN_146', "No HTML5 support."); -define('IMALAN_147', "From a remote location"); -define('IMALAN_148', "Image/File URL"); -define('IMALAN_149', "Start Upload"); -define('IMALAN_150', "Upload a File"); -define('IMALAN_151', "Choose from Library"); -define('IMALAN_152', "Appearance"); -define('IMALAN_153', "Image in use"); -define('IMALAN_154', "Not in use"); -define('IMALAN_155', "Avatar Pre-selection Folder"); -define('IMALAN_156', "Delete all unused images"); -define('IMALAN_157', "Text flow"); -define('IMALAN_158', "Margin-Left"); -define('IMALAN_159', "Margin-Right"); -define('IMALAN_160', "Margin-Top"); -define('IMALAN_161', "Margin-Bottom"); -define('IMALAN_162', "Displaying [x] - [y] of [z] images."); -define('IMALAN_163', "Video"); -define('IMALAN_164', "Deleted Icons from Media-Manager"); -define('IMALAN_165', "No images"); -define('IMALAN_166', "Upload images or files"); -define('IMALAN_167', "No file"); -define('IMALAN_168', "Click on the avatar to change it"); -define('IMALAN_169', "No Avatars Available"); -define('IMALAN_170', "Choose this avatar"); -define('IMALAN_171', "Admin-Only Notice: The folder"); -define('IMALAN_172', "is empty. Upload some default avatars images to this folder for users to choose avatars from."); -define('IMALAN_173', "No media owner found."); -define('IMALAN_174', "Youtube search requires a (free) YouTube v3 api key.[br]This key is not required unless you wish to perform a keyword, playlist or channel search.[br]Entering a Youtube video URL directly into the box above will still work without having an api key.[br][x]"); -define('IMALAN_175', "Search Youtube. Paste any YouTube URL here for a specific video/playlist/channel"); -define('IMALAN_176', "There was a problem grabbing the file"); -define('IMALAN_177', "Click here for more information and to enter your api key"); -?> +define("IMALAN_73", "Thumbnail Quality"); +define("IMALAN_74", "Set this as low as possible before quality loss is apparent. Max. 100"); +define("IMALAN_75", "Avatar Width"); +define("IMALAN_76", "Avatar images will be constrained to these dimensions (in pixels)"); +define("IMALAN_77", "Avatar Height"); +define("IMALAN_78", "General"); +define("IMALAN_79", "Resize-Image Dimensions"); +define("IMALAN_80", "Watermark Activation"); +define("IMALAN_81", "All images with a width or height greater than this value will be given a watermark during resizing."); +define("IMALAN_82", "Watermark Text"); +define("IMALAN_83", "Optional Watermark Text"); +define("IMALAN_84", "Watermark Font"); +define("IMALAN_85", "Optional Watermark Font. Upload more .ttf fonts to the /fonts folder in your theme directory."); +define("IMALAN_86", "Watermark Size"); +define("IMALAN_87", "Size of the font in pts"); +define("IMALAN_88", "Watermark Position"); +define("IMALAN_89", "Watermark"); +define("IMALAN_90", "Watermark Margin"); +define("IMALAN_91", "The distance that watermark will appear from the edge of the image."); +define("IMALAN_92", "Watermark Color"); +define("IMALAN_93", "Color of the watermark eg. 000000"); +define("IMALAN_94", "Watermark Shadow-Color"); +define("IMALAN_95", "Shadow Color of the watermark eg. ffffff"); +define("IMALAN_96", "Watermark Opacity"); +define("IMALAN_97", "Enter a number between 1 and 100"); +define("IMALAN_98", "Default YouTube account"); +define("IMALAN_99", "Used by the Media-Manager Youtube browser. Enter account name. eg. e107inc"); +define("IMALAN_100", "Show Related Videos"); +define("IMALAN_101", "Show Video Info"); +define("IMALAN_102", "Show Closed-Captions by default"); +define("IMALAN_103", "Use Modest Branding"); +define("IMALAN_104", "Make the YouTube bbcode responsive"); +define("IMALAN_105", "Resize images during media import"); +define("IMALAN_106", "Leave empty to disable"); +define("IMALAN_107", "Couldn't generated path from upload data"); +define("IMALAN_108", "Couldn't move file from [x] to [y]"); +define("IMALAN_109", "Couldn't get path"); +define("IMALAN_110", "Path"); +define("IMALAN_111", "Couldn't detect mime-type([x]). Upload failed."); +define("IMALAN_112", "Couldn't create folder ([x])."); +define("IMALAN_113", "Scanning for new media (images, videos, files) in folder:"); +define("IMALAN_114", "No media Found! Please upload some files."); +define("IMALAN_115", "Title (internal use)"); +define("IMALAN_116", "Caption (seen by public)"); +//define("IMALAN_117", "Author"); // use LAN_AUTHOR +define("IMALAN_118", "Mime Type"); +define("IMALAN_119", "File Size"); +define("IMALAN_120", "Dimensions"); +define("IMALAN_121", "Preview"); // use LAN_PREVIEW +define("IMALAN_122", "[x] couldn't be renamed. Check file perms."); +define("IMALAN_123", "Import into Category:"); +define("IMALAN_124", "Import Selected Files"); +define("IMALAN_125", "Delete Selected Files"); +define("IMALAN_126", "Please check at least one file."); +define("IMALAN_127", "Couldn't get file info from:"); +define("IMALAN_128", "Importing Media:"); +define("IMALAN_129", "You are about to delete [x] records and ALL CORRESPONDING FILES! Please confirm to continue!"); +define("IMALAN_130", "Previous page"); +define("IMALAN_131", "Next page"); +define("IMALAN_132", "Tags/Keywords"); +define("IMALAN_133", "Bottom Right"); +define("IMALAN_134", "Bottom Left"); +define("IMALAN_135", "Top Right"); +define("IMALAN_136", "Top Left"); +define("IMALAN_137", "Center"); +define("IMALAN_138", "Right"); +define("IMALAN_139", "Left"); +define("IMALAN_140", "Top"); +define("IMALAN_141", "Bottom"); +define("IMALAN_142", "Tile"); +define("IMALAN_143", "Image"); +define("IMALAN_144", "File"); +define("IMALAN_145", "From your computer"); +define("IMALAN_146", "No HTML5 support."); +define("IMALAN_147", "From a remote location"); +define("IMALAN_148", "Image/File URL"); +define("IMALAN_149", "Start Upload"); +define("IMALAN_150", "Upload a File"); +define("IMALAN_151", "Choose from Library"); +define("IMALAN_152", "Appearance"); +define("IMALAN_153", "Image in use"); +define("IMALAN_154", "Not in use"); +define("IMALAN_155", "Avatar Pre-selection Folder"); +define("IMALAN_156", "Delete all unused images"); +define("IMALAN_157", "Text flow"); +define("IMALAN_158", "Margin-Left"); +define("IMALAN_159", "Margin-Right"); +define("IMALAN_160", "Margin-Top"); +define("IMALAN_161", "Margin-Bottom"); +define("IMALAN_162", "Displaying [x] - [y] of [z] images."); +define("IMALAN_163", "Video"); +define("IMALAN_164", "Deleted Icons from Media-Manager"); +define("IMALAN_165", "No images"); +define("IMALAN_166", "Upload images or files"); +define("IMALAN_167", "No file"); +define("IMALAN_168", "Click on the avatar to change it"); +define("IMALAN_169", "No Avatars Available"); +define("IMALAN_170", "Choose this avatar"); +define("IMALAN_171", "Admin-Only Notice: The folder"); +define("IMALAN_172", "is empty. Upload some default avatars images to this folder for users to choose avatars from."); +define("IMALAN_173", "No media owner found."); +define("IMALAN_174", "Youtube search requires a (free) YouTube v3 api key.[br]This key is not required unless you wish to perform a keyword, playlist or channel search.[br]Entering a Youtube video URL directly into the box above will still work without having an api key.[br][x]"); +define("IMALAN_175", "Search Youtube. Paste any YouTube URL here for a specific video/playlist/channel"); +define("IMALAN_176", "There was a problem grabbing the file"); +define("IMALAN_177", "Click here for more information and to enter your api key"); + +define("IMALAN_178", "Avatars Folder (user selectable)"); +define("IMALAN_179", "Avatars Folder (private)"); + + diff --git a/e107_languages/English/admin/lan_menus.php b/e107_languages/English/admin/lan_menus.php index f9f9cf244..35ea84c60 100644 --- a/e107_languages/English/admin/lan_menus.php +++ b/e107_languages/English/admin/lan_menus.php @@ -1,27 +1,27 @@ \ No newline at end of file +define("MENLAN_46", "[x] object not found. Try re-scanning plugin directories in Tools > Database."); +define("MENLAN_47", "No Fields Set in"); +define("MENLAN_48", "Menu could not be loaded"); +define("MENLAN_49", "Your Menus"); +define("MENLAN_50", "Plugin Menus"); +define("MENLAN_51", "This layout does NOT contain any dynamic {MENU} areas."); +define("MENLAN_52", "It DOES contain the following custom menus: "); +define("MENLAN_53", "Go to Custom-Menu Area"); +define("MENLAN_54", "Theme Layout"); +define("MENLAN_55", "Menu Layout"); +define("MENLAN_56", "Custom Pages"); +define("MENLAN_57", "Drag-and-Drop Menus"); + +?> diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index 97a06866a..f59d89012 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -58,8 +58,8 @@ define("PRFLAN_55", "Cookie/Session name"); define("PRFLAN_56", "Timezone"); define("PRFLAN_58", "Restrict website to members only"); define("PRFLAN_59", "ticking will restrict all areas apart from the front page and signup page to members only"); -define("PRFLAN_60", "Enable SSL"); -define("PRFLAN_61", "Only enable SSL if you are sure you know what you are doing!"); +define("PRFLAN_60", "Use SSL only"); +define("PRFLAN_61", "Redirect all traffic through SSL (https)"); define("PRFLAN_76", "Display CAPTCHA on signup page."); define("PRFLAN_77", "Admin Display Options "); define("PRFLAN_78", "Leave blank to disable"); @@ -289,3 +289,6 @@ define("PRFLAN_268", "Frontend Inline-Editing"); define("PRFLAN_269", "Admins with this userclass (and the appropriate admin permissions) will be able to edit html directly via the frontend area."); define("PRFLAN_270", "Contact Form Filtering"); define("PRFLAN_271", "Ignore form submissions containing these words or phrases. One per line."); + +define("PRFLAN_272", "Session Lifetime"); +define("PRFLAN_273", "Lifetime in seconds. 0 = until the browser is closed. "); \ No newline at end of file diff --git a/e107_languages/English/admin/lan_theme.php b/e107_languages/English/admin/lan_theme.php index daaa94988..cf6b08c70 100644 --- a/e107_languages/English/admin/lan_theme.php +++ b/e107_languages/English/admin/lan_theme.php @@ -119,7 +119,7 @@ define("TPVLAN_83","Automated download not possible!"); define("TPVLAN_84","[Please Download Manually]"); define("TPVLAN_85","Connecting..."); define("TPVLAN_86","Could not change site theme."); -define("TPVLAN_87","Rendering Theme Config"); +// define("TPVLAN_87","Rendering Theme Config"); //XXX Debug info define("TPVLAN_88","Converter"); define("TPVLAN_89", "Apply dashboard preferences to all administrators"); diff --git a/e107_languages/English/lan_contact.php b/e107_languages/English/lan_contact.php index da6852ce5..fb0c02047 100644 --- a/e107_languages/English/lan_contact.php +++ b/e107_languages/English/lan_contact.php @@ -26,7 +26,7 @@ define("LANCONTACT_07", "Email a copy of this message to your own address "); define("LANCONTACT_08", "Send"); define("LANCONTACT_09", "Your message was sent."); define("LANCONTACT_10", "There was a problem sending your message."); -define("LANCONTACT_11", "Your email address does not appear to be valid.\\nPlease check it and try again."); +define("LANCONTACT_11", "Please check your email address and resubmit the contact form."); define("LANCONTACT_12", "Your message is too short."); define("LANCONTACT_13", "Please include a subject."); diff --git a/e107_languages/English/lan_form_handler.php b/e107_languages/English/lan_form_handler.php new file mode 100644 index 000000000..d9124a5b0 --- /dev/null +++ b/e107_languages/English/lan_form_handler.php @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/e107_languages/English/lan_rate.php b/e107_languages/English/lan_rate.php index de2bd63ac..aa118b161 100644 --- a/e107_languages/English/lan_rate.php +++ b/e107_languages/English/lan_rate.php @@ -1,13 +1,12 @@ \ No newline at end of file +?> diff --git a/e107_languages/English/lan_signup.php b/e107_languages/English/lan_signup.php index d1a6548c6..aa0e447ae 100644 --- a/e107_languages/English/lan_signup.php +++ b/e107_languages/English/lan_signup.php @@ -2,7 +2,7 @@ /* * e107 website system * - * Copyright (C) 2008-2015 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -50,7 +50,7 @@ define("LAN_SIGNUP_13", "You can now log in from the Login box, or from [here]." define("LAN_SIGNUP_14", "here"); define("LAN_SIGNUP_15", "Please contact the main site admin"); define("LAN_SIGNUP_16", "if you require assistance."); -define("LAN_SIGNUP_17", "Please certify you are 13 or over the age of 13."); +define("LAN_SIGNUP_17", "Please confirm that you are age 13 or over."); define("LAN_SIGNUP_18", "Your registration has been received and created with the following login information:"); //define("LAN_SIGNUP_19", "Username:"); // now LAN_LOGINNAME //define("LAN_SIGNUP_20", "Password:"); // now LAN_PASSWORD @@ -140,7 +140,6 @@ define("LAN_SIGNUP_103", "Too many users already using IP address: "); define("LAN_SIGNUP_105", "Unable to action your request - please contact the site administrator"); // Two people with same password. define("LAN_SIGNUP_106", "Unable to action your request - do you already have an account here?"); // Trying to set email same as existing - define("LAN_LOGINNAME", "Username"); //define("LAN_PASSWORD", "Password"); define("LAN_USERNAME", "Display Name"); @@ -154,3 +153,10 @@ define("LAN_SIGNUP_112", "You are currently logged in as Main Admin."); define("LAN_SIGNUP_113", "Subscription(s)"); +define("LAN_SIGNUP_114", "User registration is currently disabled."); +define("LAN_SIGNUP_115", "Preview Activation Email"); +define("LAN_SIGNUP_116", "Preview After Form Submit"); +define("LAN_SIGNUP_117", "Send a Test Activation"); +define("LAN_SIGNUP_118", "To [x]"); +define("LAN_SIGNUP_119", "Don't send email"); + diff --git a/e107_plugins/banner/banner.php b/e107_plugins/banner/banner.php index 974ac3a82..530f1c46d 100644 --- a/e107_plugins/banner/banner.php +++ b/e107_plugins/banner/banner.php @@ -21,11 +21,11 @@ if (!e107::isInstalled('banner')) } e107::includeLan(e_PLUGIN."banner/languages/".e_LANGUAGE."_banner.php"); // TODO -e107::lan('banner'); - +e107::lan('banner'); +$sql = e107::getDb(); $mes = e107::getMessage(); $frm = e107::getForm(); diff --git a/e107_plugins/chatbox_menu/chatbox_menu.php b/e107_plugins/chatbox_menu/chatbox_menu.php index dc7a0fd73..57cacfcc5 100644 --- a/e107_plugins/chatbox_menu/chatbox_menu.php +++ b/e107_plugins/chatbox_menu/chatbox_menu.php @@ -15,7 +15,7 @@ * @subpackage chatbox */ -error_reporting(E_ALL); + if(isset($_POST['chatbox_ajax'])) { define('e_MINIMAL',true); diff --git a/e107_plugins/download/request.php b/e107_plugins/download/request.php index 50a49acd1..d739d0e79 100644 --- a/e107_plugins/download/request.php +++ b/e107_plugins/download/request.php @@ -76,7 +76,7 @@ if(strstr(e_QUERY, "mirror")) exit(); } - $goUrl = e107::getUrl()->create('download/index')."?action=error&id=".$download_id; + $goUrl = e107::getUrl()->create('download/index')."?action=error&id=1"; e107::redirect($goUrl); //header("Location: ".e_BASE."download.php?error.{$download_id}.1"); exit; @@ -249,7 +249,7 @@ if ($type == "file") (strpos($pref['download_denied'],"signup.php") && USER == TRUE) )) { - $goUrl = e107::getUrl()->create('download/index')."?action=error&id=".$id; + $goUrl = e107::getUrl()->create('download/index')."?action=error&id=1"; e107::redirect($goUrl); exit(); } @@ -317,21 +317,24 @@ else if ($table == "download") { require_once(HEADERF); - $imagecaption = ''; // TODO ?name or text Screenshot + $imagecaption = ''; // TODO ?name or text Screenshot + if (file_exists(e_FILE."download/{$image}")) { - $disp = "
"; + $disp = "
"; } else if(file_exists(e_FILE."downloadimages/{$image}")) { - $disp = "
"; + $disp = "
"; } else { - $image = $tp->replaceConstants($image); - $disp = "
"; + $image = $tp->replaceConstants($image); + $disp = "
"; } + $disp .= "
"; + $ns->tablerender($imagecaption, $disp); require_once(FOOTERF); @@ -383,7 +386,7 @@ function check_download_limits() if($row['count'] >= $limits['gen_intdata']) { // Exceeded download count limit - $goUrl = e107::getUrl()->create('download/index')."?action=error&id=".$cutoff; + $goUrl = e107::getUrl()->create('download/index')."?action=error&id=2"; e107::redirect($goUrl); // e107::redirect(e_BASE."download.php?error.{$cutoff}.2"); /* require_once(HEADERF); @@ -415,7 +418,7 @@ function check_download_limits() if($row['total_bw'] / 1024 > $limit['gen_user_id']) { //Exceed bandwith limit - $goUrl = e107::getUrl()->create('download/index')."?action=error&id=".$cutoff; + $goUrl = e107::getUrl()->create('download/index')."?action=error&id=2"; e107::redirect($goUrl); // e107::redirect(e_BASE."download.php?error.{$cutoff}.2"); /* require(HEADERF); diff --git a/e107_plugins/faqs/admin_config.php b/e107_plugins/faqs/admin_config.php index 46485375f..4ac9dd3b4 100644 --- a/e107_plugins/faqs/admin_config.php +++ b/e107_plugins/faqs/admin_config.php @@ -2,25 +2,16 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * */ -/** - * - * @package e107 - * @subpackage faqs - * @author e107inc - * - * FAQ plugin admin UI - */ - require_once("../../class2.php"); e107::lan('faqs', 'admin',true); - +//TODO LANS class faq_admin extends e_admin_dispatcher { @@ -42,7 +33,7 @@ class faq_admin extends e_admin_dispatcher protected $adminMenu = array( 'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'), 'main/create' => array('caption'=> LAN_CREATE_ITEM, 'perm' => 'P'), - 'main/pending' => array('caption'=> "Unanswered", 'perm' => 'P', 'uri'=>"admin_config.php?mode=main&action=list&filter=pending"), + 'main/pending' => array('caption'=> LANA_FAQ_UNANSWERED, 'perm' => 'P', 'uri'=>"admin_config.php?mode=main&action=list&filter=pending"), 'cat/list' => array('caption'=> LAN_CATEGORIES, 'perm' => 'P'), 'cat/create' => array('caption'=> LAN_CREATE_CATEGORY, 'perm' => 'P'), @@ -216,54 +207,57 @@ class faq_main_ui extends e_admin_ui //TODO - finish 'user' type, set 'data' to all editable fields, set 'noedit' for all non-editable fields protected $fields = array( 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), - 'faq_id' => array('title'=> LAN_ID, 'tab' => 0, 'type' => null, 'width' =>'5%', 'forced'=> TRUE), + 'faq_id' => array('title'=> LAN_ID, 'tab' => 0, 'type' => null, 'width' =>'5%', 'forced'=> TRUE), 'faq_question' => array('title'=> LANA_FAQ_QUESTION, 'tab' => 0, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'required'=>TRUE, 'readParms'=>'editable=1', 'writeParms'=>'maxlength=1000&size=block-level'), 'faq_answer' => array('title'=> LANA_FAQ_ANSWER, 'tab' => 0, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=1&truncate=50&bb=1'), - 'faq_parent' => array('title'=> LAN_CATEGORY, 'tab' => 0, 'type' => 'dropdown', 'data'=> 'int', 'inline'=>true,'width' => '10%', 'filter'=>TRUE, 'batch'=>TRUE), + 'faq_parent' => array('title'=> LAN_CATEGORY, 'tab' => 0, 'type' => 'dropdown', 'data'=> 'int', 'inline'=>true,'width' => '10%', 'filter'=>TRUE, 'batch'=>TRUE), 'faq_tags' => array('title'=> LANA_FAQ_TAGS, 'tab' => 1, 'type' => 'tags', 'data' => 'str', 'width' => 'auto', 'inline'=> true, 'help' => LANA_FAQ_TAGS_HELP), // User id - 'faq_comment' => array('title'=> LANA_FAQ_COMMENT, 'tab' => 1, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto', 'inline'=> true), // User id + 'faq_comment' => array('title'=> LANA_FAQ_COMMENT, 'tab' => 1, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto', 'inline'=> true), // user class who can make comments - 'faq_datestamp' => array('title'=> LAN_DATE, 'tab' => 1, 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => false,'writeParms'=>'type=datetime&auto=1'), - 'faq_author' => array('title'=> LAN_USER, 'tab' => 1, 'type' => 'user', 'data'=> 'int', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'currentInit=1', 'filter' => true, 'batch' => true, 'nolist' => true ), // Photo - 'faq_author_ip' => array('title'=> LAN_IP, 'tab' => 1, 'type' => 'ip', 'readonly'=>2, 'data'=> 'str', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'currentInit=1', 'filter' => true, 'batch' => true, 'nolist' => true ), // Photo + 'faq_datestamp' => array('title'=> LAN_DATE, 'tab' => 1, 'type' => 'datestamp', 'data'=> 'int','width' => 'auto', 'noedit' => false,'writeParms'=>'type=datetime&auto=1'), + 'faq_author' => array('title'=> LAN_AUTHOR, 'tab' => 1, 'type' => 'user', 'data'=> 'int', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'currentInit=1', 'filter' => true, 'batch' => true, 'nolist' => true ), // Photo + 'faq_author_ip' => array('title'=> LAN_IP, 'tab' => 1, 'type' => 'ip', 'readonly'=>2, 'data'=> 'str', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'currentInit=1', 'filter' => true, 'batch' => true, 'nolist' => true ), // Photo - 'u.user_name' => array('title'=> LANA_FAQ_UNAME, 'tab' => 1, 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User name - 'u.user_loginname' => array('title'=> LANA_FAQ_ULOGINNAME, 'tab' => 1, 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User login name - 'faq_order' => array('title'=> LAN_ORDER, 'tab' => 1, 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center','nolist' => false, 'noedit'=>false, 'readParms'=>'editable=1'), + 'u.user_name' => array('title'=> LAN_USER, 'tab' => 1, 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User name + 'u.user_loginname' => array('title'=> LANA_FAQ_ULOGINNAME, 'tab' => 1, 'type' => 'user', 'width' => 'auto', 'noedit' => true, 'readParms'=>'idField=faq_author&link=1'), // User login name + 'faq_order' => array('title'=> LAN_ORDER, 'tab' => 1, 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center','nolist' => false, 'noedit'=>false, 'readParms'=>'editable=1'), + 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>array('sort'=>1)), - 'pending' => array('title' => 'internal', 'type' => 'hidden', 'data'=>false, 'writeParms'=>array()), + 'pending' => array('title' => 'internal', 'type' => 'hidden', 'data'=>false, 'writeParms'=>array()), ); protected $fieldpref = array('checkboxes', 'faq_question', 'faq_answer', 'faq_parent', 'faq_datestamp', 'options'); - protected $preftabs = array("General", LAN_ADMIN ); + protected $preftabs = array(LAN_GENERAL, LAN_PLUGIN_FAQS_NAME , LAN_CATEGORIES); + // optional, if $pluginName == 'core', core prefs will be used, else e107::getPluginConfig($pluginName); protected $prefs = array( - 'add_faq' => array('title'=> LANA_FAQ_PREF_1, 'tab'=>0, 'type'=>'userclass' ), + 'add_faq' => array('title'=> LANA_FAQ_PREF_1, 'tab'=>0, 'type'=>'userclass' ), 'submit_question' => array('title'=> LANA_FAQ_PREF_2, 'tab'=>0, 'type'=>'userclass' ), - 'submit_question_limit' => array('title'=> "'Ask a Question' limit per user", 'tab'=>0, 'type'=>'number', 'data'=>'int', 'help'=>'0 = no limit'), - 'submit_question_char_limit' => array('title'=> "'Ask a Question' character limit", 'tab'=>0, 'type'=>'number', 'data'=>'int', 'help'=>'0 = no limit', 'writeParms'=>array('max'=>255, 'default'=>255)), + 'submit_question_limit' => array('title'=> "'Ask a Question' limit per user", 'tab'=>0, 'type'=>'number', 'data'=>'int', 'help'=>'0 = no limit'), + 'submit_question_char_limit' => array('title'=> "'Ask a Question' character limit", 'tab'=>0, 'type'=>'number', 'data'=>'int', 'help'=>'0 = no limit', 'writeParms'=>array('max'=>255, 'default'=>255)), 'submit_question_language' => array('title'=> "'Ask a Question' limited to", 'tab'=>0,'type'=>'dropdown' ), - 'submit_question_acknowledgement' => array('title'=> "Submitted Questions Acknowledgement", 'type'=>'textarea', 'help'=>'Leave blank to use default' ), + 'submit_question_acknowledgement' => array('title'=> "Submitted Questions Acknowledgement", 'type'=>'textarea', 'help'=>'Leave blank to use default' ), - 'classic_look' => array('title'=> LANA_FAQ_PREF_3,'tab'=>0, 'type'=>'boolean' ), - 'list_type' => array('title'=> "List Type", 'tab'=>0,'type'=>'dropdown', 'writeParms'=>array('ul'=>'Unordered List', 'ol'=>'Ordered List') ), - 'page_title' => array('title'=> "Page Title", 'tab'=>0,'type'=>'text', 'multilan'=>true, 'help'=>'Leave blank to use default' ), - 'new' => array('title'=> "'New' FAQs are no more than", 'tab'=>0,'type'=>'number', 'writeParms'=>'size=mini&default=0&post=days old', 'help'=>'Leave blank to use default' ), - 'display_total' => array('title'=> "Display FAQ total", 'tab'=>0,'type'=>'boolean', 'data'=>'int' ), - 'display_datestamp' => array('title'=> "Display Datestamp", 'tab'=>0,'type'=>'boolean', 'data'=>'int' ), + 'classic_look' => array('title'=> LANA_FAQ_PREF_3, 'tab'=>0, 'type'=>'boolean' ), + 'list_type' => array('title'=> "List Type", 'tab'=>0,'type'=>'dropdown', 'writeParms'=>array('ul'=>'Unordered List', 'ol'=>'Ordered List') ), + 'page_title' => array('title'=> "Page Title", 'tab'=>0,'type'=>'text', 'multilan'=>true, 'help'=>'Leave blank to use default' ), + + 'new' => array('title'=> "'New' FAQs are no more than", 'tab'=>0,'type'=>'number', 'writeParms'=>'size=mini&default=0&post=days old', 'help'=>'Leave blank to use default' ), + 'display_total' => array('title'=> "Display FAQ total", 'tab'=>0,'type'=>'boolean', 'data'=>'int' ), + 'display_datestamp' => array('title'=> "Display Datestamp", 'tab'=>0,'type'=>'boolean', 'data'=>'int' ), 'display_social' => array('title'=> "Display Social buttons", 'tab'=>0,'type'=>'boolean', 'data'=>'int' ), - 'orderby' => array('title'=> LAN_ORDER, 'tab'=>0,'type'=>'dropdown', 'writeParms'=>array('faq_order-ASC'=>"Specified Order", 'faq_id-ASC'=>'ID ASC', 'faq_id-DESC'=>'ID DESC', 'faq_datestamp-ASC'=>'Date ASC', 'faq_datestamp-DESC'=>'Date DESC')), + 'orderby' => array('title'=> LAN_ORDER, 'tab'=>0,'type'=>'dropdown', 'writeParms'=>array('faq_order-ASC'=>"Specified Order", 'faq_id-ASC'=>'ID ASC', 'faq_id-DESC'=>'ID DESC', 'faq_datestamp-ASC'=>'Date ASC', 'faq_datestamp-DESC'=>'Date DESC')), - 'admin_faq_create' => array('title'=> "Create FAQ", 'tab'=>1, 'type'=>'userclass', 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), - 'admin_faq_edit' => array('title'=> "Edit FAQ", 'tab'=>1, 'type'=>'userclass', 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), - 'admin_faq_delete' => array('title'=> "Delete FAQ", 'tab'=>1, 'type'=>'userclass', 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), + 'admin_faq_create' => array('title'=> LAN_CREATE_ITEM, 'tab'=>1, 'type'=>'userclass', 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), + 'admin_faq_edit' => array('title'=> LAN_EDIT, 'tab'=>1, 'type'=>'userclass', 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), + 'admin_faq_delete' => array('title'=> LAN_DELETE, 'tab'=>1, 'type'=>'userclass', 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), - 'admin_cat_create' => array('title'=> "Create Category", 'tab'=>1, 'type'=>'userclass' , 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), - 'admin_cat_edit' => array('title'=> "Edit Category", 'tab'=>1, 'type'=>'userclass' , 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), - 'admin_cat_delete' => array('title'=> "Delete category", 'tab'=>1, 'type'=>'userclass' , 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), + 'admin_cat_create' => array('title'=> LAN_CREATE_CATEGORY, 'tab'=>2, 'type'=>'userclass' , 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), + 'admin_cat_edit' => array('title'=> LAN_EDIT, 'tab'=>2, 'type'=>'userclass' , 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), + 'admin_cat_delete' => array('title'=> LAN_DELETE, 'tab'=>2, 'type'=>'userclass' , 'writeParms'=>'default=254&classlist=main,admin,classes,no-excludes' ), ); protected $categories = array(); diff --git a/e107_plugins/faqs/faqs.php b/e107_plugins/faqs/faqs.php index c508b3a98..24d888d44 100644 --- a/e107_plugins/faqs/faqs.php +++ b/e107_plugins/faqs/faqs.php @@ -2,16 +2,12 @@ /* * e107 website system * - * Copyright (C) 2008-2009 e107 Inc (e107.org) + * Copyright (C) 2008-2017 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * + * FAQ Core Plugin * - * - * $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/faqs.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ if (!defined('e107_INIT')) @@ -126,7 +122,7 @@ if (isset($_POST['commentsubmit'])) $faqpref = e107::getPlugConfig('faqs')->getPref(); - if ($action == "" || $action == "main") + if (empty($action) || $action == "main") { if(vartrue($faqpref['classic_look'])) { @@ -137,7 +133,7 @@ if (isset($_POST['commentsubmit'])) { $srch = vartrue($_GET['srch']); $ftmp = $faq->view_all($srch); - $caption = FAQLAN_FAQ; + $caption = LAN_FAQS_FAQ; } @@ -182,7 +178,7 @@ if (isset($_POST['commentsubmit'])) if($action == "cat" && $idx) { $ftmp = $faq->view_faq($idx) ; - define("e_PAGETITLE",FAQLAN_FAQ." - ". $ftmp['title']); + define("e_PAGETITLE",LAN_FAQS_FAQ." - ". $ftmp['title']); require_once(HEADERF); $ns -> tablerender($ftmp['caption'], $ftmp['text']); } @@ -233,7 +229,7 @@ class faq if(!empty($this->pref['submit_question_limit']) && $existing >= $this->pref['submit_question_limit']) { - e107::getMessage()->setTitle('Sorry',E_MESSAGE_INFO)->addInfo("You have reached the maximum number of new questions. You may ask more once your existing questions have been answered."); + e107::getMessage()->setTitle(LAN_WARNING,E_MESSAGE_INFO)->addInfo(LAN_FAQS_LIMIT_REACHED); return; } @@ -288,7 +284,7 @@ class faq $text .= $tp->parseTemplate($template['end'], true, $this->sc); // footer - $ret['title'] = FAQLAN_FAQ; + $ret['title'] = LAN_FAQS_FAQ; $ret['text'] = $text; if (!empty($this->pref['page_title'][e_LANGUAGE])) @@ -333,7 +329,7 @@ class faq $insert = " AND (f.faq_question LIKE '%".$srch."%' OR f.faq_answer LIKE '%".$srch."%' OR FIND_IN_SET ('".$srch."', f.faq_tags) ) "; - $message = "".$srch." ×"; + $message = "".$srch." ×"; e107::getMessage()->setClose(false,E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE,E_MESSAGE_INFO)->addInfo($message); $text = e107::getMessage()->render(); @@ -359,7 +355,7 @@ class faq $insert = " AND FIND_IN_SET ('".$srch."', f.faq_tags) "; - $message = "".$srch." ×"; + $message = "".$srch." ×"; e107::getMessage()->setClose(false,E_MESSAGE_INFO)->setTitle(LAN_FAQS_FILTER_ACTIVE,E_MESSAGE_INFO)->addInfo($message); $text = e107::getMessage()->render(); @@ -372,8 +368,8 @@ class faq if(!$data = $sql->retrieve($query, true)) { - $message = (!empty($srch)) ? "".$srch." was not found in search results. Reset" : LAN_FAQS_NONE_AVAILABLE; - return "
".$message."
" ; //TODO LAN + $message = (!empty($srch)) ? e107::getParser()->lanVars(LAN_FAQS_X_NOT_FOUND, $srch)."".LAN_FAQS_RESET."" : LAN_FAQS_NONE_AVAILABLE; + return "
".$message."
" ; } // ----------------- @@ -383,8 +379,8 @@ class faq $prevcat = ""; $sc = e107::getScBatch('faqs', true); $sc->counter = 1; - $sc->tag = htmlspecialchars($tag, ENT_QUOTES, 'utf-8'); - $sc->category = $category; + $sc->tag = htmlspecialchars(varset($tag), ENT_QUOTES, 'utf-8'); + $sc->category = varset($category); if(!empty($_GET['id'])) // expand one specific FAQ. { @@ -474,12 +470,12 @@ class faq { $sc->setVars($rw); $text .= $tp->parseTemplate($FAQ_LIST_LOOP, true); - $caption = " Category: ".$rw['faq_info_title'].""; + $caption = " ".LAN_CATEGORY.": ".$rw['faq_info_title'].""; } $text .= $tp->parseTemplate($FAQ_LIST_END, true); - $ret['title'] = FAQLAN_FAQ." - ".$category_title; + $ret['title'] = LAN_FAQS_FAQ." - ".$category_title; $ret['text'] = $text.$this->faq_footer($id); $ret['caption'] = $caption; return $ret; @@ -605,7 +601,7 @@ class faq if (ADMIN && getperms("B")) { // bkwon 05-Jun-2004 fix URL to moderate comment - echo "
"; + echo "
"; } } $cobj->form_comment($action, $table, $idx.".".$id, $subject, $content_type); @@ -618,10 +614,10 @@ class faq { global $faqpref,$timing_start,$tp,$cust_footer, $CUSTOMPAGES, $CUSTOMHEADER, $CUSTOMHEADER; $text_menu .= "

-   [ Back to Categories ]  "; +   [ ".LAN_FAQS_BACK_TO_CATEGORIES." ]  "; if(check_class($faqpref['add_faq'])){ - $text_menu .="[ Submit a Question ]"; + $text_menu .="[ ".LAN_FAQS_ASK_A_QUESTION." ]"; } $text_menu .="
"; @@ -649,7 +645,7 @@ class faq - + "; while ($rw = $sql->db_Fetch()) { @@ -681,8 +677,8 @@ class faq "; + $text .= (is_numeric($id)) ? LAN_EDIT : LAN_ADD; //LAN_ADD may not exist on the front end, but I dont think this code is used - Mikey. + $text .= " FAQ"; $text .= " @@ -763,10 +759,10 @@ class faq $row = $sql->db_Fetch(); extract($row); } - $ns->tablerender("Frequently asked Questions".$faq_info_title, "
".$text."
".$this->faq_footer()); + $ns->tablerender( LAN_PLUGIN_FAQS_FRONT_NAME.$faq_info_title, "
".$text."
".$this->faq_footer()); } } -?> \ No newline at end of file +?> diff --git a/e107_plugins/faqs/faqs_setup.php b/e107_plugins/faqs/faqs_setup.php index 97ca11d27..faba50be7 100644 --- a/e107_plugins/faqs/faqs_setup.php +++ b/e107_plugins/faqs/faqs_setup.php @@ -2,7 +2,7 @@ /* * e107 website system * -* Copyright (c) 2008-2013 e107 Inc (e107.org) +* Copyright (c) 2008-2016 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -31,7 +31,7 @@ class faqs_setup "; $status = ($sql->db_Select_gen($query)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; - $mes->add("Adding Default table data to table: faqs",$status); + $mes->add(LAN_DEFAULT_TABLE_DATA.": faqs", $status); $query2 = "INSERT INTO #faqs_info (`faq_info_id`, `faq_info_title`, `faq_info_about`, `faq_info_parent`, `faq_info_class`, `faq_info_order`, `faq_info_icon`, `faq_info_metad`, `faq_info_metak`) VALUES @@ -40,7 +40,7 @@ class faqs_setup "; $status = ($sql->db_Select_gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; - $mes->add("Adding Default table data to table: faqs_info",$status); + $mes->add(LAN_DEFAULT_TABLE_DATA.": faqs_info", $status); } /* diff --git a/e107_plugins/faqs/languages/English/English_admin.php b/e107_plugins/faqs/languages/English/English_admin.php index 734ddd46f..9e7b6c67d 100644 --- a/e107_plugins/faqs/languages/English/English_admin.php +++ b/e107_plugins/faqs/languages/English/English_admin.php @@ -5,13 +5,11 @@ * * "FAQ plugin" admin-area language definitions */ - - - define("LANA_FAQ_QUESTION", "Question"); define("LANA_FAQ_ANSWER", "Answer"); -define("LANA_FAQ_COMMENT", "Comment"); //FIXME Use generic -define("LANA_FAQ_UNAME", "User name"); //FIXME Use generic +define("LANA_FAQ_UNANSWERED", "Unanswered"); +define("LANA_FAQ_COMMENT", "Comment Class"); +//define("LANA_FAQ_UNAME", "User name"); //LAN_USER define("LANA_FAQ_ULOGINNAME", "User login"); //FIXME Use generic define("LANA_FAQ_TAGS", "Tags"); define("LANA_FAQ_TAGS_HELP", "Comma separated tag list"); diff --git a/e107_plugins/faqs/languages/English/English_front.php b/e107_plugins/faqs/languages/English/English_front.php index 20678516c..c77267c1c 100644 --- a/e107_plugins/faqs/languages/English/English_front.php +++ b/e107_plugins/faqs/languages/English/English_front.php @@ -1,12 +1,24 @@ getCategoryModel($ctemplate, (vartrue($parm['force']) ? true : false)); $defopt = array( diff --git a/e107_plugins/featurebox/includes/item.php b/e107_plugins/featurebox/includes/item.php index b43c3cb99..ddcd84e2a 100644 --- a/e107_plugins/featurebox/includes/item.php +++ b/e107_plugins/featurebox/includes/item.php @@ -203,7 +203,7 @@ class plugin_featurebox_item extends e_model public function sc_featurebox_counter($parm=1) { $count = $this->getParam('counter', 1); - return ($parm == 0) ? $count - 1 : $count; + return (empty($parm)) ? $count - 1 : $count; } /** diff --git a/e107_plugins/forum/forum.php b/e107_plugins/forum/forum.php index d60545b56..e5fc95adc 100644 --- a/e107_plugins/forum/forum.php +++ b/e107_plugins/forum/forum.php @@ -330,7 +330,7 @@ if(empty($FORUM_TEMPLATE)) } } -if(is_array($FORUM_TEMPLATE) && deftrue('BOOTSTRAP',false)) // new v2.x format. +if(is_array($FORUM_TEMPLATE)) // new v2.x format. { if(varset($FORUM_TEMPLATE['main-start'])) // correction of previous v2.x setup. diff --git a/e107_plugins/forum/forum_update.php b/e107_plugins/forum/forum_update.php index 98fcd138f..fb6505955 100644 --- a/e107_plugins/forum/forum_update.php +++ b/e107_plugins/forum/forum_update.php @@ -19,7 +19,7 @@ if (!getperms('P')) exit ; } -error_reporting(E_ALL); + require_once (e_PLUGIN . 'forum/forum_class.php'); require_once (e_ADMIN . 'auth.php'); diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index 79ed864e3..fb9b4af37 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -804,7 +804,7 @@ function sc_buttonsx() } $replyUrl = "".LAN_FORUM_2006.""; + style='cursor: not-allowed; pointer-events: all !important;'")." href='".($url ?:"#")."'>".LAN_FORUM_2006."".($url?"":" "); if ($forum->checkPerm($this->var['thread_forum_id'], 'post')) { diff --git a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php index f4c8255d2..dc9dd0742 100644 --- a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php @@ -96,6 +96,7 @@ '" class="btn btn-primary'.($this->var['ntUrl'] ?"":" disabled").'"' .($this->var['ntUrl'] ?"":" data-toggle='tooltip' title='".LAN_FORUM_0006."' style='cursor: not-allowed; pointer-events: all !important;'").'>'.LAN_FORUM_1018.' + '.($this->var['ntUrl'] ?"":" ").' \n"; $count++; @@ -120,7 +115,7 @@ if(e_QUERY) if(!$array = $sql->retrieve($query,true)) { - $ns->tablerender(POLLAN_28, "
".POLLAN_33."
"); + $ns->tablerender(POLLAN_28, "
".LAN_NO_RECORDS_FOUND."
"); require_once(FOOTERF); exit; } @@ -129,7 +124,7 @@ if(e_QUERY) if(empty($array)) { - $ns->tablerender(POLLAN_28, "
".POLLAN_33."
"); + $ns->tablerender(POLLAN_28, "
".LAN_NO_RECORDS_FOUND."
"); require_once(FOOTERF); exit; } @@ -142,8 +137,8 @@ if(e_QUERY) - - + + \n"; @@ -164,7 +159,7 @@ if(e_QUERY) $text .= " - + \n"; } diff --git a/e107_plugins/poll/plugin.xml b/e107_plugins/poll/plugin.xml index bdc52fd78..f4a2141a7 100644 --- a/e107_plugins/poll/plugin.xml +++ b/e107_plugins/poll/plugin.xml @@ -5,7 +5,7 @@ contentCopyright e107 Inc e107.org, Licensed under GPL (http://www.gnu.org/licenses/gpl.txt) - POLL_ADLAN03 + LAN_CONFIGURE diff --git a/e107_plugins/poll/poll.php b/e107_plugins/poll/poll.php index 241ff9911..95cb29486 100644 --- a/e107_plugins/poll/poll.php +++ b/e107_plugins/poll/poll.php @@ -2,7 +2,7 @@ /* * e107 website system * - * Copyright (C) 2008-2011 e107 Inc (e107.org) + * Copyright (C) 2008-2017 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -27,4 +27,4 @@ require(e_PLUGIN.'poll/poll_menu.php'); require_once(FOOTERF); exit; -?> \ No newline at end of file +?> diff --git a/e107_plugins/poll/poll_class.php b/e107_plugins/poll/poll_class.php index 466cc83b9..bd77293d8 100644 --- a/e107_plugins/poll/poll_class.php +++ b/e107_plugins/poll/poll_class.php @@ -2,7 +2,7 @@ /* * e107 website system * - * Copyright (C) 2008-2013 e107 Inc (e107.org) + * Copyright (C) 2008-2017 e107 Inc (e107.org) * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * @@ -84,7 +84,7 @@ class poll { admin_purge_related("poll", $existing); } - e107::getLog()->add('POLL_01',LAN_AL_POLL_01.': '.$existing,''); + e107::getLog()->add('POLL_01',POLLAN_3.': '.LAN_DELETED.': '.$existing,''); //return POLL_ADLAN08; } } @@ -131,11 +131,11 @@ class poll $active_end = (!$_POST['endmonth'] || !$_POST['endday'] || !$_POST['endyear'] ? 0 : mktime (0, 0, 0, $_POST['endmonth'], $_POST['endday'], $_POST['endyear'])); $poll_options = ''; - $_POST['poll_option'] = array_filter($_POST['poll_option'], 'poll::clean_poll_array'); + $pollOption = $tp->filter($_POST['poll_option']); + $pollOption = array_filter($pollOption, 'poll::clean_poll_array'); - foreach ($_POST['poll_option'] as $key => $value) + foreach ($pollOption as $key => $value) { - $poll_options .= $tp->toDB($value).chr(1); } @@ -156,6 +156,7 @@ class poll $foo = $sql->fetch(); $voteA = explode(chr(1), $foo['poll_votes']); + $poll_option = varset($poll_option, 0); $opt = count($poll_option) - count($voteA); if ($opt) @@ -197,7 +198,7 @@ class poll $sql->insert("polls", "'0', ".intval($_POST['iid']).", '0', '0', ".USERID.", '$poll_title', '$poll_options', '$votes', '', '2', '0', '".intval($multipleChoice)."', '0', '0', '".intval($storageMethod)."'"); } } - return $message; + return varset($message); } function get_poll($query) @@ -268,13 +269,14 @@ class poll { return FALSE; } - if (isset($_POST['pollvote']) && $POLLMODE == 'notvoted' && ($POLLMODE != 'disallowed')) + if (isset($_POST['pollvote']) && isset($POLLMODE) && $POLLMODE == 'notvoted' && ($POLLMODE != 'disallowed')) { if ($_POST['votea']) { // $sql -> db_Select("polls", "*", "poll_vote_userclass!=255 AND poll_type=1 ORDER BY poll_datestamp DESC LIMIT 0,1"); $row = $pollArray; extract($row); + $poll_votes = varset($poll_votes); $votes = explode(chr(1), $poll_votes); if (is_array($_POST['votea'])) { @@ -300,7 +302,8 @@ class poll } $votep = implode(chr(1), $votes); $pollArray['poll_votes'] = $votep; - $sql->update("polls", "poll_votes = '$votep'".($pollArray['poll_storage_method'] != POLL_MODE_COOKIE ? ", poll_ip='".$poll_ip.$userid."^'" : '')." WHERE poll_id=".$poll_id); + $poll_ip = varset($poll_ip) . varset($userid); + $sql->update("polls", "poll_votes = '$votep'".($pollArray['poll_storage_method'] != POLL_MODE_COOKIE ? ", poll_ip='".$poll_ip."^'" : '')." WHERE poll_id=".varset($poll_id)); /*echo "
".FAQ_ADLAN_49."Options
".LAN_SETTINGS."
"; - $text .= (is_numeric($id)) ? "Edit" : "Add"; - $text .= " an FAQ
".LAN_TITLE."".POLLAN_35."".POLLAN_36."".LAN_POSTED_BY."".LAN_ACTIVE."
{$poll_title} ".$userlink."".$from." ".POLLAN_38." ".$to."".$from." ".LAN_TO." ".$to."