diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..a803826aa --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ + +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*.php] +indent_style = tab +indent_size = 4 + diff --git a/class2.php b/class2.php index b2c7248f3..1b5d28217 100644 --- a/class2.php +++ b/class2.php @@ -446,22 +446,28 @@ e107_require_once(e_HANDLER.'php_compatibility_handler.php'); // // L: Extract core prefs from the database // -$sql->db_Mark_Time('Extract Core Prefs'); + // TODO - remove it from here, auto-loaded when required +$sql->db_Mark_Time('Load Cache Handler'); e107_require_once(e_HANDLER.'cache_handler.php'); //DEPRECATED, BC, call the method only when needed, $e107->arrayStorage caught by __get() +$sql->db_Mark_Time('Load Array Storage Handler'); e107_require_once(e_HANDLER.'arraystorage_class.php'); // ArrayData(); BC Fix only. $eArrayStorage = e107::getArrayStorage(); //TODO - find & replace $eArrayStorage with e107::getArrayStorage(); //DEPRECATED, BC, call the method only when needed, $e107->e_event caught by __get() +$sql->db_Mark_Time('Load Event Handler'); $e_event = e107::getEvent(); //TODO - find & replace $e_event, $e107->e_event // TODO - DEPRECATED - remove + +$sql->db_Mark_Time('Load Core Prefs'); e107_require_once(e_HANDLER."pref_class.php"); $sysprefs = new prefs; + // Check core preferences //FIXME - message_handler is dying after message_handler(CRITICAL_ERROR) call e107::getConfig()->load(); // extra load, required if mysql handler already called e107::getConfig() @@ -515,6 +521,7 @@ $pref = e107::getPref(); // $e107->set_base_path(); moved to init(). //DEPRECATED, BC, call e107::getConfig('menu')->get('pref_name') only when needed +$sql->db_Mark_Time('Load Menu Prefs'); $menu_pref = e107::getConfig('menu')->getPref(); //extract menu prefs // NEW - force ssl @@ -627,6 +634,7 @@ if(!empty($pref['redirectsiteurl']) && !empty($pref['siteurl'])) { // - Language detection (because of session.cookie_domain) // to avoid multi-language 'access-denied' issues. //session_start(); see e107::getSession() above +$sql->db_Mark_Time('Load Session Handler'); e107::getSession(); //init core _SESSION - actually here for reference only, it's done by language handler set() method $sql->db_Mark_Time('Set User Language Session'); e107::getLanguage()->set(); // set e_LANGUAGE, USERLAN, Language Session / Cookies etc. requires $pref; @@ -1717,10 +1725,31 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '') e107::getMessage()->addDebug('Deprecated save_prefs() backtrace:
'."\n".print_r($backtrace, true).'
'); } + + + switch($table) { case 'core': //brute load, force update + + if(count($pref) < 100) // precaution for old plugins + { + $backtrace = debug_backtrace(false); + + e107::getAdminLog()->add( + 'Core pref corruption avoided', + "Call to deprecated function save_prefs() (class2.php) with too few prefs. Backtrace:\n".print_r($backtrace, true), + E_LOG_INFORMATIVE, + 'DEPRECATED' + ); + + + e107::getMessage()->addDebug('Core-pref corruption avoided. Too few prefs sent to save_prefs(). Backtrace:
'."\n".print_r($backtrace, true).'
'); + return false; + } + + return e107::getConfig()->loadData($pref, false)->save(false, true); break; diff --git a/comment.php b/comment.php index 0b406ece6..3c1376b7d 100644 --- a/comment.php +++ b/comment.php @@ -22,7 +22,7 @@ */ require_once('class2.php'); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); if (vartrue(e107::getPref('comments_disabled'))) { diff --git a/contact.php b/contact.php index 757202ce4..989bc271c 100644 --- a/contact.php +++ b/contact.php @@ -24,7 +24,7 @@ if(!check_class($active) && empty($contactInfo)) require_once(e_HANDLER."secure_img_handler.php"); $sec_img = new secure_image; -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); define('PAGE_NAME', LANCONTACT_00); diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 09003add2..1bc77bad6 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -69,10 +69,10 @@ require_once(e_ADMIN.'boot.php'); require_once(e_ADMIN.'auth.php'); require_once(e_HANDLER.'upload_handler.php'); - +e107::getDb()->db_Mark_Time('(Start Admin Checks)'); new admin_start; - +e107::getDb()->db_Mark_Time('(After Admin Checks)'); $mes = e107::getMessage(); if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'infopanel'; // Shouldn't be needed - but just in case @@ -110,7 +110,7 @@ class admin_start function __construct() { - if(!getperms('0')) // don't display this tuff to regular admins only main admin. + if(!getperms('0') || varset($_GET['mode']) === 'customize') // don't display this tuff to regular admins only main admin. { return null; } @@ -153,8 +153,10 @@ class admin_start 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(); @@ -252,14 +254,26 @@ class admin_start return null; } + $checked = e107::getSession()->get('core-update-checked'); + + if(!deftrue('e_DEBUG') && $checked === true) + { + 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'); + e107::getSession()->set('core-update-checked',true); + + if(update_check() === true) { if(e_DEBUG !== true) diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php index 82a2321fa..b29f2ba9d 100644 --- a/e107_admin/admin_log.php +++ b/e107_admin/admin_log.php @@ -10,14 +10,6 @@ * */ -/** - * - * @package e107 - * @subpackage admin - * - * Handle display of the various system logs - */ - /* * Preferences: * 'sys_log_perpage' - number of events per page @@ -37,11 +29,8 @@ if(! getperms('S')) exit(); } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); -// Main language file should automatically be loaded -// Load language files for log messages -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_log_messages.php'); //... for core functions - +e107::coreLan('admin_log', true); +e107::coreLan('log_messages', true); if(is_array($pref['lan_log_list'])) //... and for any plugins which support it { @@ -51,7 +40,7 @@ if(is_array($pref['lan_log_list'])) //... and for any plugins which support it // echo "orig = ".$file." "; //e107::lan($path,'log',true); - include_lan(e_PLUGIN.$path.'/languages/'.$file); + e107::includeLan(e_PLUGIN.$path.'/languages/'.$file); } } @@ -872,7 +861,7 @@ if(is_array($pref['lan_log_list'])) //... and for any plugins which support it // echo "orig = ".$file." "; //e107::lan($path,'log',true); - include_lan(e_PLUGIN.$path.'/languages/'.$file); + e107::includeLan(e_PLUGIN.$path.'/languages/'.$file); } } diff --git a/e107_admin/administrator.php b/e107_admin/administrator.php index b173771c6..4e9434cde 100644 --- a/e107_admin/administrator.php +++ b/e107_admin/administrator.php @@ -23,7 +23,7 @@ if(isset($_POST['go_back'])) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('administrator', true); $e_sub_cat = 'admin'; require_once('auth.php'); diff --git a/e107_admin/auth.php b/e107_admin/auth.php index fe9f01099..c40890362 100644 --- a/e107_admin/auth.php +++ b/e107_admin/auth.php @@ -19,6 +19,9 @@ if (!defined('e107_INIT')) exit; } + +e107::getDb()->db_Mark_Time('(Start auth.php)'); + define('e_CAPTCHA_FONTCOLOR','#F9A533'); diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index f9b1e81df..9bebd3067 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -8,29 +8,10 @@ * * Ban List Management * - * $URL$ - * $Id$ * */ -/** - * e107 Banlist administration - * - * @package e107 - * @subpackage admin - * @version $Id$; - */ - - require_once('../class2.php'); -/* -@todo should this be here? -if(count($_POST) && !varset($_POST['e-token'])) -{ - die('Access denied - bl'); -} -*/ - if (!getperms('4')) { @@ -38,11 +19,9 @@ if (!getperms('4')) exit(); } - - require_once(e_HANDLER.'iphandler_class.php'); // This is probably already loaded in class2.php -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('banlist', true); e107::js('footer-inline', " @@ -53,11 +32,9 @@ e107::js('footer-inline', " event.preventDefault(); }); - "); - class banlist_admin extends e_admin_dispatcher { diff --git a/e107_admin/banlist_export.php b/e107_admin/banlist_export.php index f92912e1c..c6259d0f6 100644 --- a/e107_admin/banlist_export.php +++ b/e107_admin/banlist_export.php @@ -8,16 +8,6 @@ * * Banlist export * - * $URL$ - * $Id$ - */ - -/** - * e107 Banlist administration - * - * @package e107 - * @subpackage admin - * @version $Id$; */ require_once('../class2.php'); diff --git a/e107_admin/boot.php b/e107_admin/boot.php index d9ca9b4ce..0724311f1 100644 --- a/e107_admin/boot.php +++ b/e107_admin/boot.php @@ -8,8 +8,6 @@ * * Admin BootLoader * - * $URL$ - * $Id$ */ if (!defined('e107_INIT')) @@ -17,7 +15,7 @@ if (!defined('e107_INIT')) exit; } - +e107::getDb()->db_Mark_Time('(Start boot.php)'); header('Content-type: text/html; charset=utf-8', TRUE); define('ADMINFEED', 'https://e107.org/adminfeed'); @@ -115,7 +113,7 @@ if(ADMIN && e_AJAX_REQUEST && varset($_GET['mode']) == 'addons' ) $text .= '
'; $text .= '
- +
@@ -165,16 +163,10 @@ e107::coreLan('footer', true); } - - - // Get Icon constants, theme override (theme/templates/admin_icons_template.php) is allowed include_once(e107::coreTemplatePath('admin_icons')); - - - if(!defset('e_ADMIN_UI') && !defset('e_PAGETITLE')) { $array_functions = e107::getNav()->adminLinks('legacy'); // replacement see e107_handlers/sitelinks.php @@ -478,4 +470,4 @@ if (!function_exists("parse_admin")) } } } -} +} \ No newline at end of file diff --git a/e107_admin/cache.php b/e107_admin/cache.php index d8d983aff..c5589928e 100644 --- a/e107_admin/cache.php +++ b/e107_admin/cache.php @@ -8,28 +8,17 @@ * * Cache Administration Area * - * $URL$ - * $Id$ - * */ -/** - * Admin page - cache management - * - * @package e107 - * @subpackage admin - * @version $Id$; - * @author e107 Inc - */ - require_once("../class2.php"); + if (!getperms("C")) { e107::redirect('admin'); exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('cache', true); $e_sub_cat = 'cache'; diff --git a/e107_admin/comment.php b/e107_admin/comment.php index 101a6cb08..e69c7a5b7 100644 --- a/e107_admin/comment.php +++ b/e107_admin/comment.php @@ -73,7 +73,7 @@ class comments_admin_ui extends e_admin_ui 'comment_type' => array('title'=> LAN_TYPE, 'type' => 'method', 'width' => '10%', 'filter'=>TRUE), - 'comment_item_id' => array('title'=> LAN_ITEM." ".LAN_ID, 'type' => 'text', 'readonly'=>2, 'data'=>'int', 'width' => '5%'), + 'comment_item_id' => array('title'=> LAN_ITEM, 'type' => 'text', 'readonly'=>2, 'data'=>'int', 'width' => '5%'), 'comment_subject' => array('title'=> LAN_SUBJECT, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'writeParms'=>array('size'=>'xxlarge')), // Display name 'comment_comment' => array('title'=> LAN_COMMENTS, 'type' => 'textarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'size=xxlarge'), // Display name 'comment_author_id' => array('title'=> LAN_AUTHOR, 'type' => 'user', 'data' => 'int', 'width' => 'auto', 'writeParms' => 'nameField=comment_author_name'), // User id diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 4d8066a06..89746a993 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -9,7 +9,7 @@ * Custom Menus/Pages Administration * Admin-related functions for custom page and menu creation */ -define('e_MINIMAL',true); +//define('e_MINIMAL',true); require_once('../class2.php'); if (!getperms("5|J")) { e107::redirect('admin'); exit; } @@ -19,12 +19,11 @@ e107::css('inline'," .e-wysiwyg { height: 400px } "); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_page.php'); +e107::coreLan('cpage', true); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_page.php'); $e_sub_cat = 'custom'; - class page_admin extends e_admin_dispatcher { @@ -78,6 +77,19 @@ class page_admin extends e_admin_dispatcher ); protected $menuTitle = ADLAN_42; + + + function init() + { + + + + + + } + + + } class page_admin_form_ui extends e_admin_form_ui @@ -122,7 +134,7 @@ class page_admin_form_ui extends e_admin_form_ui $text = " ".ADMIN_EDIT_ICON.""; - $text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'.$delcls)); + $text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default')); return $text; } @@ -160,13 +172,13 @@ class page_chapters_ui extends e_admin_ui 'chapter_name' => array('title'=> CUSLAN_53, 'type' => 'method', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms'=>'size=xxlarge'), 'chapter_template' => array('title'=> LAN_TEMPLATE, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), - 'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE), + 'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'writeParms'=>'size=xxlarge', 'readonly'=>FALSE), 'chapter_meta_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE), - 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1'), // Display name + 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1&sef=chapter_name', ), // Display name 'chapter_manager' => array('title'=> CUSLAN_55, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE), 'chapter_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ), 'chapter_visibility' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE), - + 'chapter_fields' => array('title', 'hidden', 'type'=>'hidden'), 'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'left', 'readParms'=>'sort=1') ); @@ -178,10 +190,19 @@ class page_chapters_ui extends e_admin_ui function init() { - if($this->getAction() == 'list') + // e107::getMessage()->addWarning("Experimental: Custom Fields"); + $this->tabs = array(LAN_GENERAL,"Custom Fields"); + $this->fields['chapter_fields'] = array('title'=>"Fields", 'tab'=>1, 'type'=>'method', 'data'=>'json', 'writeParms'=>array('nolabel'=>2)); + + if($this->getAction() === 'list') { $this->fields['chapter_parent']['title'] = CUSLAN_56; } + elseif(deftrue('e_DEBUG')) + { + $this->fields['chapter_sef']['title'] = LAN_SEFURL.' / '.LAN_NAME; + $this->fields['chapter_sef']['help'] = 'May also be used in shortcode {CHAPTER_MENUS: name=x}'; + } $sql = e107::getDb(); $sql->gen("SELECT chapter_id,chapter_name FROM #page_chapters WHERE chapter_parent =0"); @@ -231,6 +252,8 @@ class page_chapters_ui extends e_admin_ui e107::getMessage()->addError(CUSLAN_57); return false; } + + $new_data = e107::getCustomFields()->processConfigPost('chapter_fields', $new_data); return $new_data; } @@ -238,9 +261,40 @@ class page_chapters_ui extends e_admin_ui public function beforeUpdate($new_data, $old_data, $id) { - // return $this->beforeCreate($new_data); + // return $this->beforeCreate($new_data); + + $new_data = e107::getCustomFields()->processConfigPost('chapter_fields', $new_data); + + return $new_data; } +/* + private function processCustomFields($newdata) + { + if(empty($newdata)) + { + return null; + } + + $new = array(); + foreach($newdata as $fields) + { + if(empty($fields['key']) || empty($fields['type'])) + { + continue; + } + + + $key = $fields['key']; + unset($fields['key']); + $new[$key] = $fields; + + + } + + return $new; + }*/ + } @@ -272,18 +326,42 @@ class page_chapters_form_ui extends e_admin_form_ui if($mode == 'filter') { - return; + return null; } if($mode == 'batch') { - return; + return null; } } - - - + function chapter_fields($curVal,$mode,$parm) + { + $fieldAmount = (deftrue('e_DEBUG')) ? 20 :10; + + + if($mode == 'read') + { + + } + + if($mode == 'write') + { + return e107::getCustomFields()->loadConfig($curVal)->renderConfigForm('chapter_fields'); + } + + if($mode == 'filter') + { + return; + } + if($mode == 'batch') + { + return; + } + } + + + // Override the default Options field. function options($parms, $value, $id, $attributes) @@ -474,14 +552,14 @@ class page_admin_ui extends e_admin_ui // PAGE LIST/EDIT and MENU EDIT modes. protected $fields = array( 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'3%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), - 'page_id' => array('title'=> LAN_ID, 'type' => 'text', 'tab' => 0, 'width'=>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=dialog'), + 'page_id' => array('title'=> LAN_ID, 'type' => 'text', 'tab' => 0, 'width'=>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=blank'), 'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'inline'=>true, 'width'=>'25%', 'writeParms'=>'size=block-level'), 'page_chapter' => array('title'=> CUSLAN_63, 'tab' => 0, 'type' => 'dropdown', 'width' => '20%', 'filter' => true, 'batch'=>true, 'inline'=>true), - 'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), + 'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>array()), 'page_author' => array('title'=> LAN_AUTHOR, 'tab' => 0, 'type' => 'user', 'inline'=>true, 'data'=>'int','width' => 'auto', 'thclass' => 'left'), - 'page_text' => array('title'=> CUSLAN_9, 'tab' => 0, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page&template=page'), + 'page_text' => array('title'=> CUSLAN_9, 'tab' => 0, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>array('media'=>'page', 'template'=>'page')), // Options Tab. @@ -495,7 +573,9 @@ class page_admin_ui extends e_admin_ui 'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'width' => 'auto', 'writeParms'=>'size=xxlarge'), 'page_order' => array('title'=> LAN_ORDER, 'tab' => 1, 'type' => 'number', 'width' => 'auto', 'inline'=>true), - + 'page_fields' => array('title'=>'Custom Fields', 'tab'=>4, 'type'=>'hidden', 'data'=>'json', 'width'=>'auto'), + + // Menu Tab XXX 'menu_name' is 'menu_name' - not caption. 'menu_name' => array('title'=> CUSLAN_64, 'tab' => 2, 'type' => 'text', 'width' => 'auto','nolist'=>true, "help"=>"Will be listed in the Menu-Manager under this name or may be called using {CMENU=name} in your theme. Must use ASCII characters only and be all lowercase."), 'menu_title' => array('title'=> CUSLAN_65, 'nolist'=>true, 'tab' => 2, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Caption displayed on the menu item.", 'writeParms'=>'size=xxlarge'), @@ -529,9 +609,13 @@ class page_admin_ui extends e_admin_ui protected $books = array(); protected $cats = array(0 => LAN_NONE); protected $templates = array(); + protected $chapterFields = array(); function init() { + + + if(vartrue($_POST['menu_delete'])) // Delete a Menu (or rather, remove it's data ) { @@ -544,12 +628,12 @@ class page_admin_ui extends e_admin_ui } // USED IN Menu LIST/INLINE-EDIT MODE ONLY. - if($this->getMode() == 'menu' && ($this->getACtion() == 'list' || $this->getACtion() == 'inline')) + if($this->getMode() == 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline')) { - $this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE p.menu_name != '' "; // without any Order or Limit. + $this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE (p.menu_name != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit. - $this->listOrder = 'p.page_id desc'; + $this->listOrder = 'p.page_order asc'; // 'p.page_id desc'; $this->batchDelete = false; $this->fields = array( @@ -579,7 +663,7 @@ class page_admin_ui extends e_admin_ui $this->fieldpref = array("page_id","menu_name", "menu_title", 'menu_image', 'menu_template', 'menu_icon', 'page_chapter', 'menu_class'); - if(e_DEBUG) + if(deftrue('e_DEBUG')) { $this->fields['menu_name']['inline'] = true; } @@ -594,7 +678,18 @@ class page_admin_ui extends e_admin_ui $this->parseAliases(); } - + + if($this->getAction() == 'create' && e_DEBUG === true) + { + + $tmp = e107::getCoreTemplate('page', 'default'); + if(!empty($tmp['editor'])) + { + $this->fields['page_text']['writeParms']['default'] = $tmp['editor']; + } + + } + $this->templates = e107::getLayouts('', 'page', 'front', '', true, false); unset($this->templates['panel'], $this->templates['nav']); @@ -618,9 +713,8 @@ class page_admin_ui extends e_admin_ui $this->prefs['listBooksTemplate']['writeParms'] = $tmpl; $sql = e107::getDb(); - - - $sql->gen("SELECT chapter_id,chapter_name,chapter_parent FROM #page_chapters ORDER BY chapter_parent asc, chapter_order"); + + $sql->gen("SELECT chapter_id,chapter_name,chapter_parent, chapter_fields FROM #page_chapters ORDER BY chapter_parent asc, chapter_order"); while($row = $sql->fetch()) { $cat = $row['chapter_id']; @@ -633,15 +727,163 @@ class page_admin_ui extends e_admin_ui { $book = $row['chapter_parent']; $this->cats[$cat] = $this->books[$book] . " : ".$row['chapter_name']; - } + } + + if(!empty($row['chapter_fields'])) + { + $this->chapterFields[$cat] = ($row['chapter_fields']); + } + + } // asort($this->cats); $this->fields['page_chapter']['writeParms']['optArray'] = $this->cats; $this->fields['page_chapter']['writeParms']['size'] = 'xxlarge'; + if($this->getAction() === 'create') + { + $this->fields['page_chapter']['writeParms']['ajax'] = array('src'=>e_SELF."?mode=page&action=chapter-change",'target'=>'tabadditional'); + } + + + if(e_AJAX_REQUEST) + { + // @todo insert placeholder examples in params input when 'type' dropdown value is changed + } + + + + + if(e_AJAX_REQUEST && isset($_POST['page_chapter']) ) //&& $this->getAction() === 'chapter-change' + { + + $this->initCustomFields($_POST['page_chapter']); + + $elid = 'core-page-create'; + $model = $this->getModel(); + $tabId = 'additional'; + + $data = array( + 'tabs' => $this->getTabs(), + 'legend' => '', + 'fields' => $this->getFields(), + ); + + $text = $this->getUI()->renderCreateFieldset($elid, $data, $model, $tabId); + + $ajax = e107::getAjax(); + $commands = array(); + + if(empty($text)) + { + $text = ""; // There are no additional fields for the selected chapter. + $commands[] = $ajax->commandInvoke('a[href="#tab' . $tabId . '"]', 'fadeOut'); + } + else + { + $commands[] = $ajax->commandInvoke('a[href="#tab' . $tabId . '"]', 'fadeInAdminTab'); + } + + $commands[] = $ajax->commandInvoke('#tab' . $tabId, 'html', array($text)); + + $ajax->response($commands); + exit; + } } + /* + * @todo Move to admin-ui ? + */ + private function initCustomFields($chap=null) + { + $tabId = 'additional'; + + if(!empty($this->chapterFields[$chap])) + { + e107::getCustomFields()->setTab($tabId, "Additional")->loadConfig($this->chapterFields[$chap])->setAdminUIConfig('page_fields',$this); + } + else + { + e107::css('inline', '.nav-tabs li a[href="#tab' . $tabId . '"] { display: none; }'); + } + } + + private function loadCustomFieldsData() + { + $row = e107::getDb()->retrieve('page', 'page_chapter, page_fields', 'page_id='.$this->getId()); + + $cf = e107::getCustomFields(); + + $cf->loadData($row['page_fields'])->setAdminUIData('page_fields',$this); + + // e107::getDebug()->log($cf); + + + } + + + function CreateObserver() + { + parent::CreateObserver(); + $this->initCustomFields(0); + + } + + + + // Override default so we can alter the field db table data after it is loaded. . + function EditObserver() + { + + parent::EditObserver(); + + $row = e107::getDb()->retrieve('page', 'page_chapter, page_fields', 'page_id='.$this->getId()); + $chap = intval($row['page_chapter']); + + $this->initCustomFields($chap); + $this->loadCustomFieldsData(); + + } + + /** + * Filter/Process Posted page_field data; + * @param $new_data + * @return null + *//* + private function processCustomFieldData($new_data) + { + if(empty($new_data)) + { + return null; + } + + unset($new_data['page_fields']); // Reset. + + foreach($new_data as $k=>$v) + { + if(substr($k,0,11) === "page_fields") + { + list($tmp,$newkey) = explode("__",$k); + $new_data['page_fields'][$newkey] = $v; + unset($new_data[$k]); + + + } + + } + + + + return $new_data; + + + } +*/ + + + + /** * Overrid @@ -711,7 +953,10 @@ class page_admin_ui extends e_admin_ui $newdata['page_sef'] = eHelper::secureSef($newdata['page_sef']); } - + + // $newdata = $this->processCustomFieldData($newdata); + + $sef = e107::getParser()->toDB($newdata['page_sef']); if(isset($newdata['page_title']) && isset($newdata['menu_name']) && empty($newdata['page_title']) && empty($newdata['menu_name'])) @@ -732,11 +977,17 @@ class page_admin_ui extends e_admin_ui function beforeUpdate($newdata,$olddata, $id) { + + $newdata = e107::getCustomFields()->processDataPost('page_fields',$newdata); + if(isset($newdata['menu_name'])) { $newdata['menu_name'] = preg_replace('/[^\w-*]/','',$newdata['menu_name']); } + + + return $newdata; } @@ -771,6 +1022,8 @@ class page_admin_ui extends e_admin_ui } + + public function afterDelete($deleted_data, $id, $deleted_check) { $sql = e107::getDb(); diff --git a/e107_admin/credits.php b/e107_admin/credits.php index 0c6549a79..5462eef29 100644 --- a/e107_admin/credits.php +++ b/e107_admin/credits.php @@ -50,7 +50,7 @@ require_once(e_ADMIN."auth.php"); Nuvolo Icons, PHPMailer, TCPDF, PHP UTF8

- +
diff --git a/e107_admin/cron.php b/e107_admin/cron.php index b21be360b..d7c1f1f87 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -17,9 +17,7 @@ if (!getperms('U')) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); - - +e107::coreLan('cron', true); class cron_admin extends e_admin_dispatcher { @@ -269,7 +267,7 @@ class cron_admin_ui extends e_admin_ui if(!$sql->insert('cron',$insert)) { - e107::getMessage()->add(LAN_CRON_6, E_MESSAGE_ERROR); + e107::getMessage()->addDebug(LAN_CRON_6); } else { diff --git a/e107_admin/db.php b/e107_admin/db.php index 6513fd5bc..7bba0a173 100644 --- a/e107_admin/db.php +++ b/e107_admin/db.php @@ -26,9 +26,7 @@ if(isset($_POST['back'])) exit(); } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); - - +e107::coreLan('db', true); $e_sub_cat = 'database'; diff --git a/e107_admin/docs.php b/e107_admin/docs.php index 821588ccd..81cef9468 100644 --- a/e107_admin/docs.php +++ b/e107_admin/docs.php @@ -8,10 +8,6 @@ * * Docs * - * $Source: /cvs_backup/e107_0.8/e107_admin/docs.php,v $ - * $Revision$ - * $Date$ - * $Author$ * */ require_once("../class2.php"); @@ -20,7 +16,7 @@ if (!ADMIN) { exit; } -e107::lan('core','docs',true); +e107::coreLan('docs', true); define('DOC_PATH', e_DOCS.e_LANGUAGE.'/'); define('DOC_PATH_ALT', e_DOCS.'English/'); diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php index 9e21b980b..31d8cebbd 100644 --- a/e107_admin/emoticon.php +++ b/e107_admin/emoticon.php @@ -18,7 +18,7 @@ if (!getperms("F")) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('emoticon', true); $e_sub_cat = 'emoticon'; diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php index b890cb6ef..b95c3253a 100644 --- a/e107_admin/eurl.php +++ b/e107_admin/eurl.php @@ -8,8 +8,6 @@ * * URL and front controller Management * - * $URL$ - * $Id$ */ require_once('../class2.php'); diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php index b543f3485..15a40f1af 100644 --- a/e107_admin/fileinspector.php +++ b/e107_admin/fileinspector.php @@ -14,11 +14,9 @@ header('Content-Encoding: none'); // turn off gzip. ob_implicit_flush(true); ob_end_flush(); - - require_once('../class2.php'); -e107::lan('core','fileinspector', true); +e107::coreLan('fileinspector', true); if (!getperms('Y')) { diff --git a/e107_admin/frontpage.php b/e107_admin/frontpage.php index d927f47e7..628593c3a 100644 --- a/e107_admin/frontpage.php +++ b/e107_admin/frontpage.php @@ -25,7 +25,7 @@ if(! getperms('G')) exit(); } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('frontpage', true); $e_sub_cat = 'frontpage'; require_once ('auth.php'); diff --git a/e107_admin/header.php b/e107_admin/header.php index 14c6c5d77..a6ee16982 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -98,7 +98,17 @@ function loadJSAddons() e107::css('core', 'core/all.jquery.css', 'jquery'); e107::js("core", "core/all.jquery.js","jquery",4); // Load all default functions. - + + $plUpload = "plupload/i18n/".e_LAN.".js"; + + if(e_LAN != 'en' && file_exists(e_WEB_JS.$plUpload)) + { + e107::js('core', $plUpload); + } + + + + } loadJSAddons(); diff --git a/e107_admin/image.php b/e107_admin/image.php index d78e73227..1d9dcfdbf 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -8,8 +8,6 @@ * * Image Administration Area * - * $URL$ - * $Id$ * */ @@ -53,7 +51,7 @@ if(isset($_POST['submit_cancel_show'])) exit(); } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('image', true); if($_GET['action'] == 'dialog') { @@ -1040,7 +1038,13 @@ class media_admin_ui extends e_admin_ui $mes->addDebug("For:".$cat); $mes->addDebug("Bbcode: ".$this->getQuery('bbcode')); - + $video = $this->getQuery('video'); + + if($video == 2) + { + echo $this->mediaSelectUpload('video'); + return; + } $this->processUploadUrl(true, $cat); @@ -1142,6 +1146,19 @@ class media_admin_ui extends e_admin_ui function mediaSelectUpload($type='image') { $frm = e107::getForm(); + + if($type === 'video') + { + $tabs = array( + 'youtube' => array('caption'=>'Youtube', 'text' => $this->videoTab()) + ); + + return $frm->tabs($tabs, array('class'=>'media-manager')); + } + + + + $videoActive = 'inactive'; $options = array(); @@ -1484,7 +1501,7 @@ class media_admin_ui extends e_admin_ui - if(vartrue($parm['search'])) + if(!empty($parm['search'])) { $filtered = array(); if(!empty($items)) @@ -2137,7 +2154,7 @@ class media_admin_ui extends e_admin_ui $img_src = "
- +
"; diff --git a/e107_admin/index.php b/e107_admin/index.php index 26ce2dd65..c6e1ea995 100644 --- a/e107_admin/index.php +++ b/e107_admin/index.php @@ -6,12 +6,6 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_admin/index.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ header('Location: admin.php'); diff --git a/e107_admin/lancheck.php b/e107_admin/lancheck.php index e331f49b1..5997039c9 100644 --- a/e107_admin/lancheck.php +++ b/e107_admin/lancheck.php @@ -22,7 +22,7 @@ if (!getperms("L")) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_lancheck.php'); +e107::coreLan('lancheck', true); $e_sub_cat = 'language'; // require_once("auth.php"); diff --git a/e107_admin/language.php b/e107_admin/language.php index e2d425d06..63687cc7e 100644 --- a/e107_admin/language.php +++ b/e107_admin/language.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) * @@ -15,7 +15,7 @@ if (!getperms('L')) e107::redirect('admin'); exit; } -//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); + e107::coreLan('language', true); $e_sub_cat = 'language'; @@ -25,11 +25,6 @@ if(!empty($_GET['iframe'])) define('e_IFRAME', true); } - - - - - class language_admin extends e_admin_dispatcher { @@ -639,7 +634,7 @@ require_once ("auth.php"); $frm = e107::getForm(); $mes = e107::getMessage(); -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_lancheck.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_lancheck.php"); require_once(e_ADMIN."lancheck.php"); require_once(e_HANDLER."language_class.php"); @@ -1091,7 +1086,7 @@ class lanDeveloper function disableUnused($data) { - $data = str_replace("2008-2010","2008-2013", $data); + $data = str_replace("2008-2010","2008-2017", $data); $data = str_replace(' * $URL$ * $Revision$ * $Id$ @@ -1166,21 +1161,29 @@ class lanDeveloper // print_a($_SESSION['languageTools_lanFileList']); - $text .= " - -
".e107::getParser()->toHTML(LANG_LAN_140, true)."
- - + "; $omit = array('languages','\.png','\.gif','handlers'); $lans = $fl->get_files(e_ADMIN,'.php','standard',0); + asort($lans); + $fl->setFileFilter(array("^e_")); $root = $fl->get_files(e_BASE,'.*?/?.*?\.php',$omit,0); + asort($root); $templates = $fl->get_files(e_CORE."templates",'.*?/?.*?\.php',$omit,0); + asort($templates); + $shortcodes = $fl->get_files(e_CORE."shortcodes",'.*?/?.*?\.php',$omit,1); + asort($shortcodes); + $exclude = array('lan_admin.php'); $srch = array(e_ADMIN,e_PLUGIN, e_CORE, e_BASE ); @@ -1261,7 +1264,7 @@ class lanDeveloper $selected = ($_POST['deprecatedLanFile'][0] == 'auto') ? "selected='selected'" :""; $text .= "\n";//Auto-Detect - + asort($_SESSION['languageTools_lanFileList']); foreach($_SESSION['languageTools_lanFileList'] as $val) { if(strstr($val,e_SYSTEM)) diff --git a/e107_admin/links.php b/e107_admin/links.php index 07f062d0f..c846458bd 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -10,15 +10,8 @@ * */ -/** - * @package e107 - * @subpackage admin - * @version $Id$ - * - * Manage site navigation links - */ - require_once("../class2.php"); + if (!getperms("I")) { e107::redirect('admin'); diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index 1fb6cee1f..ee6e51cf2 100644 --- a/e107_admin/mailout.php +++ b/e107_admin/mailout.php @@ -10,14 +10,6 @@ * */ - -/** - * e107 Mail handling - Admin - * - * @package e107 - * @subpackage admin - */ - /* Features: 1. Additional sources of email addresses for mailouts can be provided via plugins, and can be enabled via the mailout preferences page @@ -74,9 +66,9 @@ if (!getperms('W')) e107::redirect('admin'); exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_users.php'); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php'); -// e107::lan('core','signup'); + +e107::coreLan('users', true); +e107::coreLan('mailout', true); require_once(e_HANDLER.'ren_help.php'); @@ -242,7 +234,7 @@ class mailout_admin extends e_admin_dispatcher 'main/list' => array('caption'=> LAN_MANAGE, 'perm'=> 'W'), 'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'W'), - 'recipients/list' => array('caption'=> "Recipients", 'perm' => 'W'), + 'recipients/list' => array('caption'=> LAN_MAILOUT_173, 'perm' => 'W'), // 'main/send' => array('caption'=> "Send", 'perm' => 'W'), 'other' => array('divider'=> true), // 'saved/list' => array('caption'=> LAN_MAILOUT_191, 'perm' => 'W'), @@ -252,7 +244,7 @@ class mailout_admin extends e_admin_dispatcher 'other2' => array('divider'=> true), 'prefs/prefs' => array('caption'=> LAN_PREFS, 'perm' => '0'), 'maint/maint' => array('caption'=> ADLAN_40, 'perm' => '0'), - 'main/templates' => array('caption'=> 'Template Preview', 'perm' => '0'), + 'main/templates' => array('caption'=> LAN_MAILOUT_262, 'perm' => '0'), ); @@ -298,7 +290,7 @@ class mailout_main_ui extends e_admin_ui 'mail_bcopy_to' => array('title' => LAN_MAILOUT_152,'tab'=>1, 'type'=>'method','data'=>false), 'mail_subject' => array('title' => LAN_MAILOUT_06, 'type'=>'text', 'forced' => TRUE,'data'=>'str', 'inline'=>true, 'writeParms'=>'size=xxlarge&required=1'), 'mail_content_status' => array('title' => LAN_MAILOUT_136, 'tab'=>1, 'type'=> 'dropdown', 'data'=>'int', 'filter'=>false, 'inline'=>false, 'thclass' => 'left', 'class'=>'left'), - 'mail_total_count' => array('title' => "Total Recipients", 'noedit'=>true, 'type'=>'number'), + 'mail_total_count' => array('title' => LAN_MAILOUT_263, 'noedit'=>true, 'type'=>'number'), 'mail_sent_count' => array('title' => LAN_MAILOUT_82, 'noedit'=>true, 'type'=>'number'), 'mail_togo_count' => array('title' => LAN_MAILOUT_83, 'noedit'=>true, 'type'=>'number'), @@ -315,7 +307,7 @@ class mailout_main_ui extends e_admin_ui 'mail_attach' => array('title' => LAN_MAILOUT_153, 'tab'=>1, 'type'=>'method','data'=>false), 'mail_include_images' => array('title' => LAN_MAILOUT_224, 'tab'=>1, 'type'=>'boolean','data'=>false, 'proc' => 'yesno'), 'mail_send_style' => array('title' => LAN_MAILOUT_154,'type'=>'method','data'=>false), - 'mail_media' => array('title' => 'Embed Media', 'type' => 'images', 'data' => 'array', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'video=1', 'class' => 'center', 'thclass' => 'center', ), + 'mail_media' => array('title' => LAN_MAILOUT_264, 'type' => 'images', 'data' => 'array', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'video=1', 'class' => 'center', 'thclass' => 'center', ), 'mail_body' => array('title' => LAN_MAILOUT_100, 'type'=>'bbarea', 'proc' => 'trunc200'), 'mail_body_templated' => array('title' => LAN_MAILOUT_257, 'noedit'=>true, 'proc' => 'chars'), @@ -412,7 +404,7 @@ class mailout_main_ui extends e_admin_ui define('MAIL_STATUS_TEMP', 22); // Tags entries which aren't yet in any list */ - $types = array(10=>'Pending',20=>"Saved", 21=>"Held", 0=>'Sent', 1=>'Bounced', 2=>'Cancelled', 3=> 'Partial', 5=>'Failed', 19 => "Max Active", 22=>"Temp"); + $types = array(10=>LAN_MAILOUT_265,20=>LAN_SAVED, 21=>LAN_MAILOUT_217, 0=>LAN_MAILOUT_211, 1=>LAN_MAILOUT_213, 2=>LAN_MAILOUT_218, 3=>LAN_MAILOUT_219, 5=>LAN_MAILOUT_212, 19 => LAN_MAILOUT_266, 22=>"Temp"); $qr = array('saved'=>20,'pending'=>10,'held'=>21,'sent'=>0); @@ -1182,8 +1174,8 @@ class mailout_main_ui extends e_admin_ui if(function_exists('openssl_pkey_new') && deftrue('e_DEVELOPER')) { - $text .= "DomainKeys Identified Mail (DKIM)".$frm->button('DKIM_generate',1,'primary','Generate Public/Private keys')." - Developer Mode Only"; + $text .= "DomainKeys Identified Mail (DKIM)".$frm->button('DKIM_generate',1,'primary',LAN_MAILOUT_267)." + ".LAN_MAILOUT_268.""; } @@ -1593,8 +1585,8 @@ class mailout_admin_form_ui extends e_admin_form_ui $link = e_SELF."?mode=main&action=send&id=".$id; $preview = e_SELF."?mode=main&action=preview&id=".$id; $text .= ""; - $text .= "".E_32_MAIL.""; - $text .= "".E_32_SEARCH.""; + $text .= "".E_32_MAIL.""; + $text .= "".E_32_SEARCH.""; $text .= $this->renderValue('options',$value,$attributes,$id); @@ -1608,8 +1600,8 @@ class mailout_admin_form_ui extends e_admin_form_ui $preview = e_SELF."?mode=main&action=preview&id=".$id.'&user='.$user; $text = ""; - $text .= "".E_32_USER.""; - $text .= "".E_32_SEARCH.""; + $text .= "".E_32_USER.""; + $text .= "".E_32_SEARCH.""; $attributes['readParms']['editClass'] = e_UC_NOBODY; $text .= $this->renderValue('options',$value,$attributes,$id); @@ -2644,4 +2636,4 @@ function headerjs() return $text; } -?> \ No newline at end of file +?> diff --git a/e107_admin/menus.php b/e107_admin/menus.php index 639ae5cd7..583bfc922 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -49,10 +49,6 @@ if(e_MENUMANAGER_ACTIVE === false ) body { overflow:hidden } - - - - '); } else @@ -124,12 +120,9 @@ if(e_MENUMANAGER_ACTIVE === false ) ul.dropdown-menu.e-mm-selector { padding: 10px; margin-top: -2px; margin-right:-2px; } "); - } - - if (!getperms("2")) { e107::redirect('admin'); @@ -137,17 +130,10 @@ if (!getperms("2")) } - - e107::coreLan('menus', true); e107::coreLan('admin', true); - - - - - if(e_MENUMANAGER_ACTIVE === true || vartrue($_GET['enc'])) { @@ -794,6 +780,9 @@ class e_menu_layout $theme = e107::pref('core','sitetheme'); } + $sql = e107::getDb(); + $tp = e107::getParser(); + $HEADER = null; $FOOTER = null; $LAYOUT = null; @@ -1034,7 +1023,7 @@ class e_menu_layout ; - $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. "; + $diz = MENLAN_58; $caption .= "toAttribute($diz)."\">".ADMIN_INFO_ICON.""; @@ -1926,4 +1915,4 @@ function menus_adminmenu() } -?> \ No newline at end of file +?> diff --git a/e107_admin/message.php b/e107_admin/message.php index 009cd3455..bdc99aa9c 100644 --- a/e107_admin/message.php +++ b/e107_admin/message.php @@ -6,17 +6,11 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_admin/message.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ require_once("../class2.php"); -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('message', true); $e_sub_cat = 'message'; require_once("auth.php"); diff --git a/e107_admin/meta.php b/e107_admin/meta.php index 1b5a5ea61..ba9687f13 100644 --- a/e107_admin/meta.php +++ b/e107_admin/meta.php @@ -11,12 +11,14 @@ * */ require_once("../class2.php"); -if (!getperms("T")) { + +if (!getperms("T")) +{ e107::redirect('admin'); exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('meta', true); $e_sub_cat = 'meta'; require_once("auth.php"); diff --git a/e107_admin/modcomment.php b/e107_admin/modcomment.php index 23ab9295d..eeacdfbb9 100644 --- a/e107_admin/modcomment.php +++ b/e107_admin/modcomment.php @@ -9,13 +9,14 @@ */ require_once("../class2.php"); -if (!getperms("B")) { + +if (!getperms("B")) +{ e107::redirect('admin'); exit; } - $tmp = explode(".", e_QUERY); $table = $tmp[0]; $id = intval($tmp[1]); diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 614d8bab2..0911ab03e 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -27,9 +27,6 @@ e107::css('inline', " "); - - - class news_admin extends e_admin_dispatcher { @@ -509,6 +506,9 @@ class news_admin_ui extends e_admin_ui $new_data['news_sef'] = empty($new_data['news_sef']) ? eHelper::title2sef($new_data['news_title']) : eHelper::secureSef($new_data['news_sef']); + $this->checkSEFSimilarity($new_data); + + $tmp = explode(chr(35), $new_data['news_author']); $new_data['news_author'] = intval($tmp[0]); @@ -566,6 +566,9 @@ class news_admin_ui extends e_admin_ui $new_data['news_sef'] = eHelper::title2sef($new_data['news_title']); } + + $this->checkSEFSimilarity($new_data); + if(!empty($new_data['news_author'])) { $tmp = explode(chr(35), $new_data['news_author']); @@ -581,6 +584,30 @@ class news_admin_ui extends e_admin_ui } + /** + * Display a warning if there is a mismatch with the SEF Url. + * @param $new_data + */ + private function checkSEFSimilarity($new_data) + { + if(e_LANGUAGE === "Japanese" || e_LANGUAGE === "Korean") + { + return null; + } + + + $expectedSEF = eHelper::title2sef($new_data['news_title']); + similar_text($expectedSEF,$new_data['news_sef'],$percSimilar); + + if($percSimilar < 60) + { + e107::getMessage()->addWarning(LAN_NEWS_108); // The SEF URL is unlike the title of your news item. + } + + + } + + public function afterCreate($new_data, $old_data, $id) { diff --git a/e107_admin/notify.php b/e107_admin/notify.php index d23fd8033..019964b93 100644 --- a/e107_admin/notify.php +++ b/e107_admin/notify.php @@ -8,23 +8,15 @@ * */ -/** - * @package e107 - * @subpackage admin - * - * 'Notify' admin page - selects action on various events - */ - require_once('../class2.php'); + if (!getperms('O')) { e107::redirect('admin'); exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); - - +e107::coreLan('notify', true); class plugin_notify_admin extends e_admin_dispatcher { diff --git a/e107_admin/phpinfo.php b/e107_admin/phpinfo.php index b8326c945..cc6e5eade 100644 --- a/e107_admin/phpinfo.php +++ b/e107_admin/phpinfo.php @@ -6,16 +6,11 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_admin/phpinfo.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ require_once("../class2.php"); -if (!getperms("0")) + +if(!getperms("0")) { e107::redirect('admin'); exit; diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 54c73e7df..4bb54a84f 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -11,7 +11,8 @@ */ require_once("../class2.php"); -if (!getperms("Z")) + +if(!getperms("Z")) { e107::redirect('admin'); exit; diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index d9fe161de..01f5a2aa0 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -9,6 +9,7 @@ * Administration - Site Preferences * */ + require_once ("../class2.php"); if(isset($_POST['newver'])) @@ -17,17 +18,17 @@ if(isset($_POST['newver'])) exit(); } -if(! getperms("1")) +if(!getperms("1")) { e107::redirect('admin'); exit(); } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('prefs', true); + $e_sub_cat = 'prefs'; -e107::lan('core','mailout','admin'); - - +//e107::lan('core','mailout','admin'); +e107::coreLan('mailout', true); require_once (e_ADMIN."auth.php"); @@ -1574,7 +1575,7 @@ $text .= " // File Uploads - include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_upload.php"); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_upload.php"); require_once(e_HANDLER."upload_handler.php"); diff --git a/e107_admin/search.php b/e107_admin/search.php index a75e647d9..a78f55659 100644 --- a/e107_admin/search.php +++ b/e107_admin/search.php @@ -17,15 +17,13 @@ if (!getperms('X')) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('search', true); $e_sub_cat = 'search'; require_once('auth.php'); require_once(e_HANDLER.'userclass_class.php'); require_once(e_HANDLER.'search_class.php'); - - $frm = e107::getForm(); $mes = e107::getMessage(); $e_userclass = new user_class(); diff --git a/e107_admin/theme.php b/e107_admin/theme.php index 9ec2f1ee5..ab238b1c4 100644 --- a/e107_admin/theme.php +++ b/e107_admin/theme.php @@ -6,22 +6,17 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_admin/theme.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ require_once("../class2.php"); + if (!getperms("1")) { e107::redirect('admin'); exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('theme', true); $e_sub_cat = 'theme_manage'; diff --git a/e107_admin/ugflag.php b/e107_admin/ugflag.php index 4cd1458dd..04370c59e 100644 --- a/e107_admin/ugflag.php +++ b/e107_admin/ugflag.php @@ -10,6 +10,7 @@ * */ require_once ('../class2.php'); + if(!getperms('9')) { e107::redirect('admin'); @@ -18,7 +19,7 @@ if(!getperms('9')) $e_sub_cat = 'maintain'; -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); +e107::coreLan('ugflag', true); $mes = e107::getMessage(); $frm = e107::getForm(); diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index bb54550b9..68b8755b5 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -1,26 +1,14 @@ core as $func => $data) @@ -270,6 +261,7 @@ class e107Update { $frm = e107::getForm(); $mes = e107::getMessage(); + $sql = e107::getDb(); $text = ""; @@ -385,8 +377,11 @@ function update_check() foreach($dbupdate as $func => $rmks) // See which core functions need update { + if (function_exists('update_'.$func)) { + + $sql->db_Mark_Time('Check Core Update_'.$func.' '); if (!call_user_func('update_'.$func, FALSE)) { $update_needed = TRUE; @@ -400,6 +395,7 @@ function update_check() { if (function_exists('update_'.$func)) { + // $sql->db_Mark_Time('Check Core Update_'.$func.' '); if (!call_user_func('update_'.$func, FALSE)) { $update_needed = TRUE; @@ -600,6 +596,7 @@ function update_core_database($type = '') //-------------------------------------------- function update_706_to_800($type='') { + global $pref, $e107info; global $sysprefs, $eArrayStorage; @@ -1756,6 +1753,7 @@ function core_media_import($cat,$epath) function update_70x_to_706($type='') { + global $sql,$ns, $pref, $e107info, $admin_log, $emessage; $just_check = $type == 'do' ? FALSE : TRUE; diff --git a/e107_admin/userclass2.php b/e107_admin/userclass2.php index 02daedf4c..b69a7ac92 100644 --- a/e107_admin/userclass2.php +++ b/e107_admin/userclass2.php @@ -10,25 +10,15 @@ * */ - -/** - * e107 Userclass handling - Admin - * - * @package e107 - * @subpackage admin - * @version $Id$; - */ - require_once('../class2.php'); + if (!getperms('4')) { e107::redirect('admin'); exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); - - +e107::coreLan('userclass2', true); class uclass_admin extends e_admin_dispatcher @@ -141,6 +131,9 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); } + /** + * @return Object + */ public function getUserClassAdmin() { return e107::getSingleton('user_class_admin'); @@ -201,7 +194,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); $e_userclass->calc_tree(); $text = "
".$e_userclass->show_graphical_tree()."
"; - return array('caption'=>'Class Structure', 'text' => $text); //TODO LAN + return array('caption'=>UCSLAN_91, 'text' => $text); // $text .= $e_userclass->show_graphical_tree(); } @@ -285,7 +278,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); return false; } - $ns = e107::getRender(); + $message = ''; $sql = e107::getDb(); $mes = e107::getMessage(); $e_userclass = $this->getUserClassAdmin(); @@ -333,6 +326,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); // $ns->tablerender('', "
".$message."
"); } + return null; } @@ -342,11 +336,11 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); $pref = e107::pref('core'); $mes = e107::getMessage(); - $ns = e107::getRender(); + $frm = e107::getForm(); // $e_userclass = $this->getUserClassAdmin(); - $text = ""; + // $text = ""; $initial_classes = varset($pref['initial_user_classes'],''); @@ -388,7 +382,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); $initClassStages = array(1 =>UCSLAN_47, 2=>UCSLAN_48); $text .= UCSLAN_45."
- ".$frm->select('init_class_stage', $initClassStages, $sel_stage)."".UCSLAN_46." + ".$frm->select('init_class_stage', $initClassStages, $sel_stage, 'size=xlarge')."".UCSLAN_46."
". $frm->admin_button('set_initial_classes','no-value','create',LAN_UPDATE)."
"; @@ -429,6 +423,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); $pref['initial_user_classes'] = $newval; e107::getConfig()->setPref($pref)->save(true,true,true); + + return true; } @@ -462,6 +458,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); $classID = $this->getController()->getListModel()->get('userclass_id'); + if(!$this->getController()->getUserClassAdmin()->queryCanDeleteClass($classID)) { $options['readParms']['deleteClass'] = e_UC_NOBODY; @@ -484,6 +481,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); return $text; } + return ''; } @@ -500,6 +498,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); return $prm->renderPermTable('tabs',$curVal); } + + return ''; } } @@ -519,1259 +519,4 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE); - -$e_sub_cat = 'userclass'; -//define('UC_DEBUG_OPTS',FALSE); - -require_once(e_HANDLER.'userclass_class.php'); // Modified class handler -$e_userclass = new user_class_admin; // Admin functions - should just obliterate any previous object created in class2.php - // @TODO: Does core object manager need to know somehow? - -require_once(e_HANDLER.'form_handler.php'); - - -$frm = new e_form(); -// $uc = new uclass_manager; -$mes = e107::getMessage(); - - -$message = ''; - -/** - * See whether a user class is editable. - * - * (Note: On fixed classes, only some fields are editable) - * - * @param integer $class_id - * @param boolean $redirect - if TRUE, will redirect to site home page if class not editable. - * @param boolean $fullEdit - set TRUE if full editing required, FALSE if some editing permitted - * - * @return boolean - TRUE if class editable (fully or partially), FALSE if not. - */ -function checkAllowed($classID, $redirect = true, $fullEdit = FALSE) -{ - global $e_userclass; // TODO: Get rid of this (we need the system admin object; not the user-level object) - $editLevel = $fullEdit ? 2 : 1; - if ($e_userclass->queryCanEditClass($classID) >= $editLevel) - { - return TRUE; - } - - if ($redirect) - { - e107::redirect(); - exit; - } - - return FALSE; - - // Next bit probably redundant - editing of some parts of system class data is allowed. - if(!$uc->isEditableClass($class_id)) - { - if(!$redirect) return false; - e107::getMessage()->addSession(UCSLAN_90, E_MESSAGE_ERROR); - header('location:'.e_SELF); - exit; - } - - return true; -} - -if (e_QUERY) -{ - // BC - SO MUCH BAD, never do this at home!!! - if(isset($_GET['action'])) - { - $uc_qs = array($_GET['action'], $_GET['id']); - } - else $uc_qs = explode('.', e_QUERY); -} -$action = varset($uc_qs[0]); -$params = varset($uc_qs[1],''); -e107::setRegistry('pageParams', $uc_qs); - -//AJAX request check is already made by the API -/* -if(e_AJAX_REQUEST) -{ - $class_num = intval($params); - if ($action == 'edit') - { - require_once(e_HANDLER.'js_helper.php'); - $jshelper = new e_jshelper(); - if(!checkAllowed($class_num, false)) - { - //This will raise an error - //'Access denied' is the message which will be thrown - //by the JS AJAX handler - e_jshelper::sendAjaxError('403', 'Access denied. '.UCSLAN_90); - } - elseif($sql->db_Select('userclass_classes', '*', "userclass_id='".$class_num."' ")) - { - $row = $sql->db_Fetch(); - - //Response action - reset all group checkboxes - $jshelper->addResponseAction('reset-checked', array('group_classes_select' => '0')); - - //it's grouped userclass - if ($row['userclass_type'] == UC_TYPE_GROUP) - { - //Response action - show group, hide standard - $jshelper->addResponseAction('element-invoke-by-id', array('show' => 'userclass_type_groups', 'hide' => 'userclass_type_standard')); - - //fill in the classes array - $tmp = explode(',',$row['userclass_accum']); - foreach ($tmp as $uid) - { - $row['group_classes_select_'.$uid] = $uid; - } - } - else - { - //hide group, show standard rows - $jshelper->addResponseAction('element-invoke-by-id', array('hide' => 'userclass_type_groups', 'show' => 'userclass_type_standard')); - } - unset($row['userclass_accum']); - - $jshelper->addResponseAction('fill-form', $row); - $jshelper->sendResponse('XML'); - // $jshelper->sendResponse('JSON'); - another option (tested) - faster transfer! - } - else - { - e_jshelper::sendAjaxError('500', 'Database read error!'); - } - - } - exit; -} - -e107::getJs()->headerCore('core/admin.js'); -*/ - -/* - * Authorization should be done a bit later! - */ -require_once("auth.php"); -$emessage = e107::getMessage(); - -//--------------------------------------------------- -// Set Initial Classes -//--------------------------------------------------- -/* -if (isset($_POST['set_initial_classes'])) -{ - $changed = $pref['init_class_stage'] != intval($_POST['init_class_stage']); - $pref['init_class_stage'] = intval($_POST['init_class_stage']); - $temp = array(); - foreach ($_POST['init_classes'] as $ic) - { - $temp[] = intval($ic); - } - $newval = implode(',', $temp); - $temp = varset($pref['initial_user_classes'],''); - if ($temp != $newval) $changed = TRUE; - if ($changed) - { - $pref['initial_user_classes'] = $newval; - save_prefs(); - userclass2_adminlog("05","New: {$newval}, Old: {$temp}, Stage: ".$pref['init_class_stage']); - $message = UCSLAN_41; - } - else - { - $message = LAN_NOCHANGE_NOTSAVED; - } -} -*/ - -//--------------------------------------------------- -// Delete existing class -//--------------------------------------------------- - -/* -if (isset($_POST['etrigger_delete']) && !empty($_POST['etrigger_delete'])) -{ - $classID = intval(array_shift(array_keys($_POST['etrigger_delete']))); - //checkAllowed($classID); - - if ($e_userclass->queryCanDeleteClass($classID)) - { - if ($e_userclass->delete_class($class_id) !== FALSE) - { - userclass2_adminlog("02","ID:{$class_id} (".$e_userclass->uc_get_classname($classID).")"); - if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$classID}' OR user_class REGEXP('^{$classID},') OR user_class REGEXP(',{$classID},') OR user_class REGEXP(',{$classID}$')")) - { // Delete existing users from class - while ($row = $sql->db_Fetch()) - { - $uidList[$row['user_id']] = $row['user_class']; - } - $e_userclass->class_remove($classID, $uidList); - } - $e_pref = e107::getConfig(); - if($e_pref->isData('frontpage/'.$classID)) - { - $e_pref->removePref('frontpage/'.$classID)->save(false); - } - // if (isset($pref['frontpage'][$class_id])) - { - // unset($pref['frontpage'][$class_id]); // (Should work with both 0.7 and 0.8 front page methods) - // save_prefs(); - } - $emessage->add(LAN_DELETED, E_MESSAGE_SUCCESS); - } - else - { - $emessage->add(UCSLAN_10, E_MESSAGE_ERROR); - } - } - else - { - $emessage->add(UCSLAN_10, E_MESSAGE_ERROR); - } -}*/ - - - -//--------------------------------------------------- -// Add/Edit class information -//--------------------------------------------------- -/* - -if (isset($_POST['createclass'])) // Add or edit -{ - $fullEdit = TRUE; // Most of the time, we are allowed to edit everything - $do_tree = FALSE; // Set flag to rebuild tree if no errors - $forwardVals = FALSE; // Set to ripple through existing values to a subsequent pass - - $tempID = intval(varset($_POST['userclass_id'], -1)); - if (($tempID < 0) && $e_userclass->ucGetClassIDFromName($class_record['userclass_name'])) - { - $emessage->add(UCSLAN_63, E_MESSAGE_WARNING); // Duplicate name - $forwardVals = TRUE; - } - if ($tempID > 0) - { - $fullEdit = $e_userclass->queryCanEditClass($tempID) == 2; - } - - $class_record = array( - 'userclass_description' => varset($tp->toDB($_POST['userclass_description']),''), - 'userclass_editclass' => intval(varset($_POST['userclass_editclass'],0)), - 'userclass_parent' => intval(varset($_POST['userclass_parent'],0)), - 'userclass_visibility' => intval(varset($_POST['userclass_visibility'],0)), - 'userclass_icon' => $tp->toDB(varset($_POST['userclass_icon'],'')) - ); - - if ($fullEdit) - { - $class_record['userclass_name'] = varset($tp->toDB($_POST['userclass_name']),''); - $class_record['userclass_type'] = intval(varset($_POST['userclass_type'],UC_TYPE_STD)); - if ($class_record['userclass_type'] == UC_TYPE_GROUP) - { - $temp = array(); - foreach ($_POST['group_classes_select'] as $gc) - { - $temp[] = intval($gc); - } - $class_record['userclass_accum'] = implode(',',$temp); - } - } - - - if ($e_userclass->checkAdminInfo($class_record, $tempID) === FALSE) - { - $emessage->add(UCSLAN_86); // Some fixed values changed - $forwardVals = TRUE; - } - - if (!$forwardVals) - { - if ($tempID > 0) - { // Editing existing class here - checkAllowed($tempID); - $class_record['userclass_id'] = $tempID; - $e_userclass->save_edited_class($class_record); - userclass2_adminlog('03',"ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")"); - $do_tree = TRUE; - //$message .= LAN_UPDATED.': '.LAN_USERCLASS; - $emessage->add(LAN_UPDATED.': '.LAN_USERCLASS, E_MESSAGE_SUCCESS); - } - else - { // Creating new class - if($class_record['userclass_name']) - { - if (getperms("0") || ($class_record['userclass_editclass'] && check_class($class_record['userclass_editclass']))) - { - $i = $e_userclass->findNewClassID(); - if ($i === FALSE) - { - //$message = UCSLAN_85; - $emessage->add(UCSLAN_85, E_MESSAGE_WARNING); - } - else - { - $class_record['userclass_id'] = $i; - $e_userclass->add_new_class($class_record); - userclass2_adminlog("01","ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")"); - $do_tree = TRUE; - //$message .= LAN_UPDATED.': '.LAN_USERCLASS; - $emessage->add(LAN_UPDATED.': '.LAN_USERCLASS, E_MESSAGE_SUCCESS); - } - } - else - { - header("location:".SITEURL); - exit; - } - } - else - { - // Class name required - //$message = UCSLAN_37; - $emessage->add(UCSLAN_37, E_MESSAGE_ERROR); - $forwardVals = TRUE; - } - } - } - - if ($do_tree) - { - $e_userclass->calc_tree(); - $e_userclass->save_tree(); - } -} -*/ - -/* -if ($message) -{ - $emessage->add($message); -} - -class uclassFrm extends e_form -{ - function userclass_type($curVal,$mode) - { - $types = array( - UC_TYPE_STD => UCSLAN_80, - UC_TYPE_GROUP => UCSLAN_81 - ); - - return varset($types[$curVal]); - } -} -*/ - - -/* -if(!e_QUERY || $action == 'list') -{ - $uc->show_existing(); - -} -*/ -if(isset($_GET['id']) && $_GET['action'] == 'edit') -{ - $action = 'config'; - $_POST['existing'] = $_GET['id']; -} - -switch ($action) -{ -//----------------------------------- -// Class management -//----------------------------------- - case 'config' : - $fullEdit = TRUE; - if(isset($_POST['existing'])) - { - $params = 'edit'; - $class_num = intval(varset($_POST['existing'],0)); - $fullEdit = $e_userclass->queryCanEditClass($class_num) == 2; - } - else - { - $class_num = intval(varset($uc_qs[2],0)); - } - - $userclass_id = 0; // Set defaults for new class to start with - $userclass_name = ''; - $userclass_description = ''; - $userclass_editclass = e_UC_ADMIN; - $userclass_visibility = e_UC_ADMIN; - $userclass_parent = e_UC_NOBODY; - $userclass_icon = ''; - $userclass_type = UC_TYPE_STD; - $userclass_groupclass = ''; - if ($params == 'edit' || $forwardVals) - { - if (!isset($forwardVals)) - { // Get the values from DB (else just recycle data uer was trying to store) - checkAllowed($class_num); - $sql->db_Select('userclass_classes', '*', "userclass_id='".intval($class_num)."' "); - $class_record = $sql->db_Fetch(); - $userclass_id = $class_record['userclass_id']; // Update fields from DB if editing - } - $userclass_name = $class_record['userclass_name']; - $userclass_description = $class_record['userclass_description']; - $userclass_editclass = $class_record['userclass_editclass']; - $userclass_visibility = $class_record['userclass_visibility']; - $userclass_parent = $class_record['userclass_parent']; - $userclass_icon = $class_record['userclass_icon']; - $userclass_type = $class_record['userclass_type']; - if ($userclass_type == UC_TYPE_GROUP) - { - $userclass_groupclass = $class_record['userclass_accum']; - } - } - - $class_total = $sql->db_Count('userclass_classes', '(*)'); - - $text = "
-
- - - - - - "; - - - $text .= " - - - - - - - - - "; - -// Userclass icon - $text .= " - - - - - "; - - $text .= " - - - - - "; - - // Who can manage class - $text .= " - - - - - "; - - // List of class checkboxes for grouping - $text .= " - - - - - "; - - - $text .= " - - - - - "; - - $text .= " - - - -
".LAN_NAME.""; - if ($fullEdit) - { - $text .= ""; - } - else - { - $text .= "{$userclass_name}"; - } - $text .= "
".UCSLAN_30."
".LAN_DESCRIPTION." -
".UCSLAN_31."
".LAN_ICON."".$frm->iconpicker('userclass_icon', $userclass_icon, LAN_SELECT)." -
".UCSLAN_69."
".LAN_TYPE.""; - $classTypes = array(UC_TYPE_STD => UCSLAN_80, UC_TYPE_GROUP => UCSLAN_81); - if ($fullEdit) - { - $text .= "\n - \n"; - } - else - { - $text .= $classTypes[$userclass_type].""; - } - $text .= "
".UCSLAN_82."
".LAN_VISIBILITY.""; - $text .= "'; - $text .= "
".UCSLAN_33."
".LAN_PARENT.""; - $text .= "'; -// .r_userclass("userclass_parent", $userclass_parent, "off", "admin,classes,matchclass,public,member"). - $text .= "
".UCSLAN_36."
- "; - - - $text .= " -
"; - -if($params == 'edit') -{ - $text .= $frm->admin_button('createclass', LAN_UPDATE, 'create'); - $text .= $frm->admin_button('updatecancel', LAN_CANCEL, 'cancel'); - // $text .= ""; - // $text .= "  "; - $text .= " - - "; -} -else -{ - $text .= $frm->admin_button('createclass', LAN_CREATE, 'create'); - $text .= $frm->admin_button('updatecancel', LAN_CANCEL, 'cancel'); - // $text .= " - //   "; - $text .= " - "; -} - -$text .= "
"; -$text .= "


"; - - -// $text .= $e_userclass->show_graphical_tree(); - -$title = $params == 'edit' ? LAN_EDIT : LAN_CREATE; -$ns->tablerender(ADLAN_38.SEP.$title, $text); -unset($title); - break; // End of 'config' option - - - - -//----------------------------------- -// Initial User class(es) -//----------------------------------- -/* - case 'initial' : - - $initial_classes = varset($pref['initial_user_classes'],''); - $irc = explode(',',$initial_classes); - $icn = array(); - foreach ($irc as $i) - { - if (trim($i)) $icn[] = $e_userclass->uc_get_classname($i); - } - -// $class_text = $e_userclass->uc_checkboxes('init_classes', $initial_classes, 'classes, force', TRUE); - $class_text = $e_userclass->vetted_tree('init_classes',array($e_userclass,'checkbox_desc'), $initial_classes, 'classes, force, no-excludes'); - - $mes->addInfo(UCSLAN_49); - - $text = "
-
- - -
".UCSLAN_43.""; - - if (count($icn) > 0) - { - // $text .= implode(', ',$icn); - } - else - { - $text .= LAN_NONE; - } - - - if ($class_text) - { - $text .= $class_text."
"; - $sel_stage = varset($pref['init_class_stage'],2); - $text .= UCSLAN_45."
- ".UCSLAN_46.""; - $text .= "
-
". - $frm->admin_button('set_initial_classes','no-value','create',LAN_UPDATE) - ."
"; - } - else - { - $text .= UCSLAN_39; - } - - $text .= "
"; - $ns->tablerender(ADLAN_38.SEP.UCSLAN_40, $mes->render() . $text); - - break; // End of 'initial' -*/ - -//----------------------------------- -// Debug aids -//----------------------------------- - case 'debug' : -// if (!check_class(e_UC_MAINADMIN)) break; // Let ordinary admins see this if they know enough to specify the URL - $text .= $e_userclass->show_graphical_tree(TRUE); // Print with debug options - $ns->tablerender(LAN_SETTINGS, $text); - - $text = " - "; - $sql->db_Select('user','user_id,user_name,user_class',"ORDER BY user_id LIMIT 0,20",'no_where'); - while ($row = $sql->db_Fetch()) - { - $inherit = $e_userclass->get_all_user_classes($row['user_class']); - $text .= " - - - - "; - } - $text .= "
Class rights for first 20 users in database
User IDDisp NameRaw classesInherited classesEditable classes
".$row['user_id']."".$row['user_name']."".$row['user_class']."".$inherit."".$e_userclass->get_editable_classes($inherit)."
"; - $ns->tablerender(LAN_SETTINGS, $text); - break; // End of 'debug' - - -//----------------------------------- -// Configuration options -//----------------------------------- - case 'options' : - /* - if (!check_class(e_UC_MAINADMIN)) break; - - if (isset($_POST['add_class_tree'])) - { // Create a default tree - $message = UCSLAN_62; - $e_userclass->set_default_structure(); - $e_userclass->calc_tree(); - $e_userclass->save_tree(); - $e_userclass->readTree(TRUE); // Need to re-read the tree to show correct info - $message .= UCSLAN_64; - } - - if (isset($_POST['flatten_class_tree'])) - { // Remove the default tree - $message = UCSLAN_65; - $sql->db_Update('userclass_classes', "userclass_parent='0'"); - $e_userclass->calc_tree(); - $e_userclass->save_tree(); - $e_userclass->readTree(TRUE); // Need to re-read the tree to show correct info - $message .= UCSLAN_64; - } - - if (isset($_POST['rebuild_tree'])) - { - $message = UCSLAN_70; - $e_userclass->calc_tree(); - $e_userclass->save_tree(); - $message .= UCSLAN_64; - } - - if ($params == 'xml') $params = '.xml'; else $params = ''; - - if (isset($_POST['create_xml_db']) && ($params == '.xml')) - { - $message = $e_userclass->makeXMLFile() ? 'XML file created' : 'Error creating XML file'; - } - - if ($message) - { - $ns->tablerender('', "
".$message."
"); - } - - $mes = e107::getMessage(); - - $mes->addWarning(LAN_OPTIONS."
".UCSLAN_53); - - $text = "
- - - - - - - - - - "; - if ($params == '.xml') - { - $text .= " - - "; - - } - $text .= "
".UCSLAN_54."
".UCSLAN_57."
-
- ".$frm->admin_button('add_class_tree','no-value','delete', UCSLAN_58)." -
".UCSLAN_55."
".UCSLAN_56."
-
- ".$frm->admin_button('flatten_class_tree','no-value','delete', UCSLAN_58)." -
".'Create XML file of DB'."
".'Dev aid to set initial values'."
-
- ".$frm->admin_button('create_xml_db','no-value','create', 'Create')." -
"; - - $ns->tablerender(ADLAN_38.SEP.LAN_PREFS, $mes->render().$text); - - - $text = "
- - - - - - - - - -
".UCSLAN_72."
- ".UCSLAN_73." -
- ".$frm->admin_button('rebuild_tree','no-value','delete', UCSLAN_58)." -
-
"; - - $ns->tablerender(UCSLAN_71, $text); - - break; // End of 'options' -*/ - -//----------------------------------- -// Test options -//----------------------------------- - case 'test' : - if (!check_class(e_UC_MAINADMIN)) break; - break; // ...And disable for everyone at present - if (isset($_POST['add_db_fields'])) - { // Add the extra DB fields - $message = "Add DB fields: "; - $e_userclass->update_db(FALSE); - $message .= "Completed"; - } - - if (isset($_POST['remove_db_fields'])) - { // Remove the DB fields - $message = "Remove DB fields: "; - $sql->gen("ALTER TABLE #userclass_classes DROP `userclass_parent`, DROP `userclass_accum`, DROP `userclass_visibility`"); - $message .= "Completed"; - } - - if (isset($_POST['add_class_tree'])) - { // Create a default tree - $message = "Create default class tree: "; - if (!$e_userclass->update_db(TRUE)) - { - $message .= "Must add new DB fields first"; - } - else - { - $e_userclass->set_default_structure(); - $e_userclass->read_tree(TRUE); // Need to re-read the tree to show correct info - $message .= "Completed"; - } - } - - if (isset($_POST['remove_class_tree'])) - { // Remove the default tree - $message = "Remove default class tree: "; - $sql->db_Delete("userclass_classes","`userclass_id` IN (".implode(',',array(e_UC_MAINADMIN,e_UC_MEMBER, e_UC_ADMIN, e_UC_ADMINMOD, e_UC_MODS, e_UC_USERS, e_UC_READONLY)).") "); - $e_userclass->read_tree(TRUE); // Need to re-read the tree to show correct info - $message .= "completed"; - } - - if (isset($_POST['rebuild_tree'])) - { - $message = 'Rebuilding tree: '; - $e_userclass->calc_tree(); - $e_userclass->save_tree(); - $message .= " completed"; - } - - if ($message) - { - $ns->tablerender("", "
".$message."
"); - } - - $db_status = "Unknown"; - $db_status = $e_userclass->update_db(TRUE) ? "Updated" : "Original"; - $text = "
-
- - "; - $text .= ""; - $text .= ""; - $text .= ""; - $text .= ""; - $text .= ""; - $text .= ""; - $text .= ""; - $text .= ""; - $text .= ""; - - $text .= "
Test Functions and Information
DB Status: ".$db_status."
First required stepReverse the process
Optional default treeDeletes the 'core' class entries
Sets up all the structuresSpare
 
".$e_userclass->show_tree(TRUE)."
"; - - $text .= "
-
"; - $ns->tablerender('User classes - test features', $text); - break; // End of temporary test options - - -//----------------------------------- -// Special fooling around -//----------------------------------- - case 'special' : - if (!check_class(e_UC_MAINADMIN)) break; // Let main admins see this if they know enough to specify the URL - - $text = "
-
"; - - - $text .= "\n"; - $ns->tablerender('Select box with nested items', $text); - - $text = "\n"; - $ns->tablerender('Multiple Select box with nested items', $text); - - $checked_class_list = implode(',',$_POST['classes_select']); - $text = "
"; - $text .= $e_userclass->vetted_tree('classes_select', array($e_userclass,'checkbox'), $checked_class_list, 'is-checkbox'); - $text .= "Classes: ".$checked_class_list; - $text .= ""; - $text .= $e_userclass->vetted_tree('normalised_classes_select', array($e_userclass,'checkbox'), $e_userclass->normalise_classes($checked_class_list), 'is-checkbox'); - $text .= "Normalised Classes: ".$e_userclass->normalise_classes($checked_class_list); - $text .= "
"; - $ns->tablerender('Nested checkboxes, showing the effect of the normalise() routine', $text); - - $text = "Single class: ".$_POST['class_select']."
- Multi-select: ".implode(',',$_POST['multi_class_select'])."
- Check boxes: ".implode(',',$_POST['classes_select'])."
"; - $text .= " -
"; - $ns->tablerender('Click on the button - the settings above should be remembered, and the $_POST values displayed', $text); - break; // End of 'debug' - -} // End - switch ($action) - - - - -/** - * Log event to admin log - * - * @param string $msg_num - 2-digit event number (MUST be as a string) - * @param string $woffle - log detail - * - * @return none - */ -function userclass2_adminlog($msg_num='00', $woffle='') -{ - e107::getAdminLog()->log_event('UCLASS_'.$msg_num,$woffle,E_LOG_INFORMATIVE,''); -} - -/* -function userclass2_adminmenu() -{ - $tmp = array(); - if (e_QUERY) - { - $tmp = explode(".", e_QUERY); - } - $action = vartrue($tmp[0],'list'); - if(isset($_GET['action']) && 'edit' == $_GET['action']) $action = 'list'; - - $var['list']['text'] = LAN_MANAGE; - $var['list']['link'] = 'userclass2.php'; - - - $var['config']['text'] = LAN_CREATE; // UCSLAN_25; - $var['config']['link'] = 'userclass2.php?config'; - -//DEPRECATED - use admin->users instead. - -// $var['membs']['text'] = UCSLAN_26; -// $var['membs']['link'] ='userclass2.php?membs'; - - - $var['initial']['text'] = UCSLAN_38; - $var['initial']['link'] ='userclass2.php?initial'; - - if (check_class(e_UC_MAINADMIN)) - { - $var['options']['text'] = LAN_PREFS; // UCSLAN_50; - $var['options']['link'] ='userclass2.php?options'; - - if (defined('UC_DEBUG_OPTS')) - { - $var['debug']['text'] = UCSLAN_27; - $var['debug']['link'] ='userclass2.php?debug'; - - $var['test']['text'] = 'Test functions'; - $var['test']['link'] ="userclass2.php?test"; - - $var['specials']['text'] = 'Special tests'; - $var['specials']['link'] ="userclass2.php?special"; - } - } - show_admin_menu(ADLAN_38, $action, $var); -} -*/ - - - - -/* - -class uclass_manager -{ - public function __construct() - { - global $user_pref; - if(isset($_POST['etrigger_ecolumns'])) - { - $user_pref['admin_userclass_columns'] = $_POST['e-columns']; - save_prefs('user'); - } - - $this->fieldpref = (varset($user_pref['admin_userclass_columns'])) ? $user_pref['admin_userclass_columns'] : array("userclass_id","userclass_name","userclass_description"); - - $this->fields = array( - 'userclass_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'width' => '5%', 'thclass' => 'center', 'class' => 'center'), - 'userclass_id' => array('title'=> LAN_ID, 'type' => 'int', 'width' => '5%', 'thclass' => 'left'), - 'userclass_name' => array('title'=> LAN_NAME, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'), - 'userclass_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'), - 'userclass_editclass' => array('title'=> LAN_MANAGER, 'type' => 'userclass', 'width' => 'auto', 'thclass' => 'left'), - 'userclass_parent' => array('title'=> LAN_PARENT, 'type' => 'userclass', 'width' => 'auto', 'thclass' => 'left'), - 'userclass_visibility' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'width' => 'auto', 'thclass' => 'left'), - 'userclass_type' => array('title'=> LAN_TYPE, 'type' => 'method', 'width' => '10%', 'thclass' => 'left', 'class'=>'left' ), - 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'thclass' => 'center last', 'forced'=>TRUE, 'class'=>'right', 'readParms' => array('deleteClass' => e_UC_NOBODY)) - ); - - } - - - -// Show list of existing userclasses, followed by graphical tree of the hierarchy - - public function show_existing() - { - global $e_userclass; - - $tp = e107::getParser(); - $sql = e107::getDb(); - $frm = new uclassFrm; - $ns = e107::getRender(); - $mes = e107::getMessage(); - - - if (!$total = $sql->db_Select('userclass_classes', '*')) - { - $text = ""; - $mes->add(LAN_NO_RECORDS_FOUND, E_MESSAGE_INFO); - - } - else - { - $text = "
-
- ".LAN_UPDATED.': '.LAN_USERCLASS." - ". - $frm->colGroup($this->fields,$this->fieldpref). - $frm->thead($this->fields,$this->fieldpref). - - ""; - $classes = $sql->db_getList('ALL', FALSE, FALSE); - - foreach($classes as $row) - { - $this->fields['options']['readParms']['deleteClass'] = $e_userclass->queryCanDeleteClass($row['userclass_id']) ? '' : e_UC_NOBODY; - $text .= $frm->renderTableRow($this->fields, $this->fieldpref, $row, 'userclass_id'); - } - - $text .= "
"; - } - - // $text .= $e_userclass->show_graphical_tree(); // Show the tree as well - sometimes more useful - - $ns->tablerender(ADLAN_38, $mes->render().$text ); - - } -} - -require_once(e_ADMIN.'footer.php'); -*/ - - -// @TODO: Is this function still required? - Yes - setGroupStatus() used on class add/edit page -function headerjs() -{ - $params = e107::getRegistry('pageParams'); - /* - * e107Ajax.fillForm demonstration - * Open Firebug console for Ajax transaction details - * - */ - $script_js = "\n"; - - if ($params[0] != 'membs') return $script_js; - -// We only want this JS on the class membership selection page -// XXX memebs action is deprecated now, remove this script? - $script_js .= "\n"; - return $script_js; -} - - -?> \ No newline at end of file +?> diff --git a/e107_admin/users_extended.php b/e107_admin/users_extended.php index a08d2691d..b9a5de8ff 100755 --- a/e107_admin/users_extended.php +++ b/e107_admin/users_extended.php @@ -16,8 +16,7 @@ if (!getperms('4')) exit; } - -include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE); +e107::coreLan('users_extended', true); if(varset($_GET['mode']) == "ajax") { @@ -292,7 +291,7 @@ e107::js('footer-inline', js()); 'main/list' => array('caption'=> LAN_MANAGE, 'perm' => '0'), 'main/add' => array('caption'=> EXTLAN_45, 'perm' => '0'), - 'main/create' => array('caption'=> 'Add Custom Field', 'perm' => '0'), + 'main/create' => array('caption'=> EXTLAN_81, 'perm' => '0'), 'cat/list' => array('caption'=> LAN_CATEGORIES, 'perm' => '0'), 'cat/create' => array('caption'=> LAN_CREATE_CATEGORY, 'perm' => '0'), @@ -356,13 +355,13 @@ e107::js('footer-inline', js()); 'user_extended_struct_name' => array ( 'title' => LAN_NAME, 'type' => 'text', 'data' => 'str', 'readonly'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'tdClassRight=form-inline&pre=user_ ', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_text' => array ( 'title' => EXTLAN_79, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => 'constant=1', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_type' => array ( 'title' => EXTLAN_2, 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'user_extended_struct_values' => array ( 'title' => "Values", 'type' => 'method', 'nolist'=>true, 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'user_extended_struct_values' => array ( 'title' => EXTLAN_82, 'type' => 'method', 'nolist'=>true, 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_default' => array ( 'title' => EXTLAN_16, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_parent' => array ( 'title' => LAN_CATEGORY, 'type' => 'dropdown', 'tab'=>1, 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('size'=>'xxlarge'), 'class' => 'left', 'thclass' => 'left', ), // These are combined into user_extended_struct_parms on submit. - 'field_placeholder' => array('title'=>'Placeholder', 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')), - 'field_helptip' => array('title'=>'Help Tip', 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')), + 'field_placeholder' => array('title'=>EXTLAN_83, 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')), + 'field_helptip' => array('title'=>EXTLAN_84, 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')), 'field_include' => array('title'=> EXTLAN_15, 'tab'=>1, 'type'=>'textarea', 'data'=>false, 'help'=>EXTLAN_51, 'writeParms'=>array('size'=>'xxlarge')), 'field_regex' => array('title'=> EXTLAN_52, 'tab'=>1, 'type'=>'text', 'data'=>false, 'help'=> EXTLAN_53, 'writeParms'=>array('size'=>'xxlarge')), @@ -374,7 +373,7 @@ e107::js('footer-inline', js()); 'user_extended_struct_applicable' => array ( 'title' => EXTLAN_5, 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true, 'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_parms' => array ( 'title' => "Params", 'type' => 'hidden', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_read' => array ( 'title' =>EXTLAN_6, 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true,'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'user_extended_struct_write' => array ( 'title' => 'Write Access', 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true, 'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'user_extended_struct_write' => array ( 'title' => EXTLAN_7, 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true, 'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_signup' => array ( 'title' => 'Signup', 'type' => 'hidden', 'nolist'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_order' => array ( 'title' => LAN_ORDER, 'type' => 'hidden', 'nolist'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'options' => array ( 'title' => LAN_OPTIONS, 'type' => 'method', 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'readParms'=>'sort=1' ), @@ -540,7 +539,7 @@ e107::js('footer-inline', js()); } else { - $mes->addSuccess("User Extended Column deleted from table"); //TODO LAN + $mes->addSuccess(EXTLAN_86); } } @@ -846,7 +845,7 @@ e107::js('footer-inline', js()); $curVal = '1'; } - $types = e107::getUserExt()->user_extended_types; + $types = e107::getUserExt()->getFieldTypes(); return $this->select('user_extended_struct_type', $types, $curVal, array('class'=>'tbox e-select')); @@ -943,7 +942,7 @@ e107::js('footer-inline', js());
".EXTLAN_17.""; - $text .= "
".$frm->checkbox('sort_user_values',1, false, "Sort values")."
"; + $text .= "
".$frm->checkbox('sort_user_values',1, false, EXTLAN_87)."
"; $text .= ""; @@ -1077,7 +1076,7 @@ e107::js('footer-inline', js()); // 'user_extended_struct_parms' => array ( 'title' => "Params", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_read' => array ( 'title' =>EXTLAN_6, 'type' => 'userclass', 'data' => 'int', 'width' => '15%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'user_extended_struct_write' => array ( 'title' => 'Write Access', 'type' => 'userclass', 'data' => 'int', 'width' => '15%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'user_extended_struct_write' => array ( 'title' => EXTLAN_7, 'type' => 'userclass', 'data' => 'int', 'width' => '15%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), // 'user_extended_struct_signup' => array ( 'title' => 'Signup', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'user_extended_struct_order' => array ( 'title' => LAN_ORDER, 'type' => 'number', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'right', 'thclass' => 'right', ), 'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'readParms'=>'sort=0' ), @@ -2211,7 +2210,7 @@ class users_ext $var['pre']['text'] = EXTLAN_45; $var['pre']['link'] = e_SELF."?pre"; - $var['editext']['text'] = "Add Custom Field"; + $var['editext']['text'] = EXTLAN_81; $var['editext']['link'] = e_SELF."?editext"; $var['cat']['text'] = EXTLAN_35; @@ -2466,4 +2465,4 @@ class users_ext } -?> \ No newline at end of file +?> diff --git a/e107_admin/ver.php b/e107_admin/ver.php index edfec51af..6faf523ba 100644 --- a/e107_admin/ver.php +++ b/e107_admin/ver.php @@ -6,16 +6,10 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * - * - * $Source: /cvs_backup/e107_0.8/e107_admin/ver.php,v $ - * $Revision$ - * $Date$ - * $Author$ */ if (!defined('e107_INIT')) { exit; } -$e107info['e107_version'] = "2.1.4 (git)"; +$e107info['e107_version'] = "2.1.5 (git)"; ?> \ No newline at end of file diff --git a/e107_admin/wmessage.php b/e107_admin/wmessage.php index 612e8b441..058cf2f56 100644 --- a/e107_admin/wmessage.php +++ b/e107_admin/wmessage.php @@ -15,7 +15,7 @@ if (!getperms("M")) exit; } -e107::lan('core','wmessage',true); +e107::coreLan('wmessage', true); class wmessage_admin extends e_admin_dispatcher diff --git a/e107_core/bbcodes/bb_img.php b/e107_core/bbcodes/bb_img.php index 60ec525ba..26568ea24 100644 --- a/e107_core/bbcodes/bb_img.php +++ b/e107_core/bbcodes/bb_img.php @@ -133,7 +133,7 @@ class bb_img extends e_bb_base $imgParms['title'] = $imgParms['alt'] ; - $imgParms['class'] = "img-rounded bbcode ".e107::getBB()->getClass('img');; // This will be overridden if a new class is specified + $imgParms['class'] = "img-rounded rounded bbcode ".e107::getBB()->getClass('img');; // This will be overridden if a new class is specified if($mode == 'string') { diff --git a/e107_core/bbcodes/quote.bb b/e107_core/bbcodes/quote.bb index 292dc74ce..4a7270705 100644 --- a/e107_core/bbcodes/quote.bb +++ b/e107_core/bbcodes/quote.bb @@ -1,6 +1,6 @@ //getClass('quote'); -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_parser_functions.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_parser_functions.php"); if(deftrue('BOOTSTRAP')) { diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 99eb011bd..c6dbbaaae 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -15,6 +15,10 @@ if (!defined('e107_INIT')) { exit; } class admin_shortcodes { + + const ADMIN_NAV_HOME = 'enav_home'; // Must match with admin_template. ie. {ADMIN_NAVIGATION=enav_home} and $E_ADMIN_NAVIGATION['button_enav_home'] + const ADMIN_NAV_LANGUAGE = 'enav_language'; + const ADMIN_NAV_LOGOUT = 'enav_logout'; function cronUpdateRender($parm,$cacheData) { @@ -707,7 +711,7 @@ class admin_shortcodes { if(e_DEBUG !== false) { - return ""; + return ""; } } @@ -1418,7 +1422,7 @@ Inverse 10 10 $tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION')); global $$tmpl; - if($parm == 'home' || $parm == 'logout' || $parm == 'language' || $parm == 'pm') + if($parm == self::ADMIN_NAV_HOME || $parm == self::ADMIN_NAV_LOGOUT || $parm == self::ADMIN_NAV_LANGUAGE || $parm == 'pm') { $template = $$tmpl; @@ -1480,6 +1484,7 @@ Inverse 10 10 $tmp['sub_class'] = ''; $tmp['sort'] = false; + if(vartrue($pref['admin_slidedown_subs']) && vartrue($array_sub_functions[$key])) { $tmp['sub_class'] = 'sub'; @@ -1649,15 +1654,16 @@ Inverse 10 10 $tp = e107::getParser(); $frm = e107::getForm(); - if($type == 'home') + if($type === self::ADMIN_NAV_HOME) { - $menu_vars['home']['text'] = ""; // ADLAN_53; - $menu_vars['home']['link'] = e_HTTP.'index.php'; - $menu_vars['home']['image'] = $tp->toGlyph('fa-home'); // "" ; // "".ADLAN_151.""; - $menu_vars['home']['image_src'] = ADLAN_151; - $menu_vars['home']['sort'] = 1; - $menu_vars['home']['sub_class'] = 'sub'; + $menu_vars[$type]['text'] = ""; // ADLAN_53; + $menu_vars[$type]['link'] = e_HTTP.'index.php'; + $menu_vars[$type]['image'] = $tp->toGlyph('fa-home'); // "" ; // "".ADLAN_151.""; + $menu_vars[$type]['image_src'] = ADLAN_151; + $menu_vars[$type]['sort'] = 1; + $menu_vars[$type]['sub_class'] = 'sub'; + $menu_vars[$type]['template'] = $type; // Sub Links for 'home'. require_once(e_HANDLER."sitelinks_class.php"); @@ -1682,10 +1688,10 @@ Inverse 10 10 $c++; } - $menu_vars['home']['sub'] = $tmp; + $menu_vars[$type]['sub'] = $tmp; // -------------------- } - elseif($type == 'logout') + elseif($type == self::ADMIN_NAV_LOGOUT) { $tmp = array(); @@ -1774,14 +1780,15 @@ Inverse 10 10 $tmp[8]['image_large_src'] = ''; $tmp[8]['link_class'] = ''; - $menu_vars['logout']['text'] = ADMINNAME; // ""; // ADMINNAME; - $menu_vars['logout']['link'] = '#'; - $menu_vars['logout']['image'] = $tp->toGlyph('fa-user'); // ""; // "".ADLAN_151.""; - $menu_vars['logout']['image_src'] = LAN_LOGOUT; - $menu_vars['logout']['sub'] = $tmp; + $menu_vars[$type]['text'] = ''; // ADMINNAME; // ""; // ADMINNAME; + $menu_vars[$type]['link'] = '#'; + $menu_vars[$type]['image'] = $tp->toAvatar(null, array('w'=>30,'h'=>30,'crop'=>1, 'shape'=>'circle')); // $tp->toGlyph('fa-user'); // ""; // "".ADLAN_151.""; + $menu_vars[$type]['image_src'] = LAN_LOGOUT; + $menu_vars[$type]['sub'] = $tmp; + $menu_vars[$type]['template'] = $type; } - if($type == 'language') + if($type == self::ADMIN_NAV_LANGUAGE) { $slng = e107::getLanguage(); $languages = $slng->installed();//array('English','French'); @@ -1839,11 +1846,12 @@ Inverse 10 10 $c++; } - $menu_vars['language']['text'] = strtoupper(e_LAN); // e_LANGUAGE; - $menu_vars['language']['link'] = '#'; - $menu_vars['language']['image'] = $tp->toGlyph('fa-globe'); // "" ; - $menu_vars['language']['image_src'] = null; - $menu_vars['language']['sub'] = $tmp; + $menu_vars[$type]['text'] = strtoupper(e_LAN); // e_LANGUAGE; + $menu_vars[$type]['link'] = '#'; + $menu_vars[$type]['image'] = $tp->toGlyph('fa-globe'); // "" ; + $menu_vars[$type]['image_src'] = null; + $menu_vars[$type]['sub'] = $tmp; + $menu_vars[$type]['template'] = $type; } } @@ -1877,6 +1885,8 @@ Inverse 10 10 $var = array(); + + foreach($pref['sitetheme_layouts'] as $key=>$val) { $layoutName = str_replace($search,$replace,$key); @@ -1902,6 +1912,8 @@ Inverse 10 10 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 ee13f69c5..3dfa6f40a 100644 --- a/e107_core/shortcodes/batch/comment_shortcodes.php +++ b/e107_core/shortcodes/batch/comment_shortcodes.php @@ -364,7 +364,7 @@ class comment_shortcodes extends e_shortcode if ($pref['allowCommentEdit'] && USER && $this->var['user_id'] == USERID && ($this->var['comment_lock'] < 1)) { - $adop_icon = (file_exists(THEME."images/commentedit.png") ? "".COMLAN_318."" : "Edit"); + $adop_icon = (file_exists(THEME."images/commentedit.png") ? "".COMLAN_318."" : LAN_EDIT); //Searching for '.' is BAD!!! It breaks mod rewritten requests. Why is this needed at all? if (strstr(e_QUERY, "&")) { diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index dfdac3578..479cc30c7 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -439,7 +439,7 @@ class news_shortcodes extends e_shortcode } // When news_allow_comments = 1 then it is disabled. Backward, but that's how it is in v1.x - $text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "news_item)."'>".$this->param['commentlink'].''); + $text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "news_item)."'>".$this->param['commentlink'].''); return $text; } @@ -510,7 +510,7 @@ class news_shortcodes extends e_shortcode $class = varset($parm['class']); - return "".$adop_icon."\n"; + return "".$adop_icon."\n"; } else { @@ -693,7 +693,7 @@ class news_shortcodes extends e_shortcode break; default: - return "news_item)."'>"; + return "news_item)."'>"; break; } } @@ -734,7 +734,7 @@ class news_shortcodes extends e_shortcode $parm['item'] = ($parm['item'] +1); if(empty($parm['class'])) { - $parm['class'] = 'img-responsive news-media news-media-'.$parm['item']; + $parm['class'] = 'img-responsive img-fluid news-media news-media-'.$parm['item']; } return $this->sc_newsimage($parm); } @@ -811,7 +811,7 @@ class news_shortcodes extends e_shortcode * Display News Images (but not video thumbnails ) * @param $parm array * @example {NEWSIMAGE: type=src&placeholder=true} - * @example {NEWSIMAGE: class=img-responsive} + * @example {NEWSIMAGE: class=img-responsive img-fluid} */ function sc_newsimage($parm = null) { @@ -826,7 +826,7 @@ class news_shortcodes extends e_shortcode $tmp = $this->handleMultiple($parm); $srcPath = $tmp['file']; - $class = (!empty($parm['class'])) ? $parm['class'] : "news_image news-image img-responsive img-rounded"; + $class = (!empty($parm['class'])) ? $parm['class'] : "news_image news-image img-responsive img-fluid img-rounded rounded"; $class .= ' news-image-'.$tmp['count']; $dimensions = null; $srcset = null; diff --git a/e107_core/shortcodes/batch/page_shortcodes.php b/e107_core/shortcodes/batch/page_shortcodes.php index be293d22a..4d61f86b6 100644 --- a/e107_core/shortcodes/batch/page_shortcodes.php +++ b/e107_core/shortcodes/batch/page_shortcodes.php @@ -33,11 +33,15 @@ class cpage_shortcodes extends e_shortcode foreach($books as $row) { $id = $row['chapter_id']; + + $this->chapterData[$id] = $row; } - + + + } - + // Set Chapter. // @see chapter_menu.php public function setChapter($id) @@ -457,6 +461,15 @@ class cpage_shortcodes extends e_shortcode return $tp->toHtml($row['chapter_name'], false, 'TITLE'); } + /** + * Alias for {CHAPTER_NAME} + * @example {CHAPTER_TITLE} + */ + function sc_chapter_title() + { + return $this->sc_chapter_name(); + } + /** * @example {CHAPTER_ANCHOR} @@ -596,5 +609,75 @@ class cpage_shortcodes extends e_shortcode return "".$icon.""; } - + + + function sc_cpagefieldtitle($parm=null) + { + if(empty($parm['name']) || empty($this->var['page_fields'])) + { + return null; + } + + $chap = $this->var['page_chapter']; + $key = $parm['name']; + + + if(!empty($this->chapterData[$chap]['chapter_fields'][$key]['title'])) + { + return $this->chapterData[$chap]['chapter_fields'][$key]['title']; + } + + return null; + } + + + /** + * Return raw HTML-usable values from page fields. + * @experimental subject to change without notice. + * @param null $parm + * @return mixed + */ + function sc_cpagefield($parm=null) + { + if(empty($parm['name']) || empty($this->var['page_fields'])) + { + return null; + } + + $chap = $this->var['page_chapter']; + $fields = $this->chapterData[$chap]['chapter_fields']; + + return e107::getCustomFields()->loadConfig($fields)->loadData($this->var['page_fields'])->getFieldValue($parm['name'],$parm); + + + } + + + /** + * @experimental - subject to change without notice. Use at own risk. + * @param null $parm + * @return string + */ + function sc_cpagefields($parm=null) + { + $fieldData = e107::unserialize($this->var['page_fields']); + + + $text = ' + '; + + foreach($fieldData as $ok=>$v) + { + + $text .= ""; + } + + $text .= "
NameTitle
{CPAGEFIELDTITLE: name=x}
Normal
{CPAGEFIELD: name=x}
Raw
{CPAGEFIELD: name=x&mode=raw}
".$ok."".$this->sc_cpagefieldtitle(array('name'=>$ok))."".$this->sc_cpagefield(array('name'=>$ok))."".$this->sc_cpagefield(array('name'=>$ok, 'mode'=>'raw'))."
"; + + return $text; + + } + + + } diff --git a/e107_core/shortcodes/batch/user_shortcodes.php b/e107_core/shortcodes/batch/user_shortcodes.php index 93c9d529d..f80168642 100644 --- a/e107_core/shortcodes/batch/user_shortcodes.php +++ b/e107_core/shortcodes/batch/user_shortcodes.php @@ -374,7 +374,6 @@ class user_shortcodes extends e_shortcode } - function sc_user_icon_link($parm='') { @@ -396,29 +395,32 @@ class user_shortcodes extends e_shortcode } - function sc_user_id($parm='') { return $this->var['user_id']; } - - - + + function sc_user_name($parm='') { return $this->var['user_name']; } - - - + + function sc_user_name_link($parm='') { - $uparams = array('id' => $this->var['user_id'], 'name' => $this->var['user_name']); - return "".$this->var['user_name'].""; + $url = $this->sc_user_profile_url(); + return "".$this->var['user_name'].""; } - - - + + + function sc_user_profile_url($parm='') + { + $uparams = array('id' => $this->var['user_id'], 'name' => $this->var['user_name']); + return e107::getUrl()->create('user/profile/view', $uparams); + } + + function sc_user_loginname($parm='') { if(ADMIN && getperms("4")) @@ -428,7 +430,6 @@ class user_shortcodes extends e_shortcode } - function sc_user_birthday_icon($parm='') { if(defined("USER_BIRTHDAY_ICON")) @@ -439,12 +440,11 @@ class user_shortcodes extends e_shortcode { return " "; } - + return " "; } - - + function sc_user_birthday($parm='') { if ($this->var['user_birthday'] != "" && $this->var['user_birthday'] != "0000-00-00" && preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $this->var['user_birthday'], $regs)) @@ -456,9 +456,8 @@ class user_shortcodes extends e_shortcode return "".LAN_USER_33.""; } } - - - + + function sc_user_signature($parm) { $tp = e107::getParser(); @@ -466,7 +465,6 @@ class user_shortcodes extends e_shortcode } - function sc_user_comments_link($parm) { if($this->commentsDisabled) @@ -679,14 +677,14 @@ class user_shortcodes extends e_shortcode if(!$ext->hasPermission($fld,'read')) { + // e107::getDebug()->log("Wrong permissions for user_euf: ".$fld); return false; } $val = $this->var[$fld]; + $type = $ext->getFieldType($fld); - // e107::getDebug()->log(print_a($ext,true)); - - return $ext->renderValue($val); //TODO auto-detect type, from within the user-extended class. + return $ext->renderValue($val,$type); } diff --git a/e107_core/shortcodes/batch/usersettings_shortcodes.php b/e107_core/shortcodes/batch/usersettings_shortcodes.php index 5f2e61ec3..29f36637a 100755 --- a/e107_core/shortcodes/batch/usersettings_shortcodes.php +++ b/e107_core/shortcodes/batch/usersettings_shortcodes.php @@ -18,6 +18,7 @@ if (!defined('e107_INIT')) { exit; } class usersettings_shortcodes extends e_shortcode { private $extendedTabs = false; + public $legacyTemplate = array(); function sc_username($parm) // This is the 'display name' { @@ -375,22 +376,25 @@ class usersettings_shortcodes extends e_shortcode return $ret; } - - - - function sc_userextended_cat($parm='') - { - global $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed; - - if(deftrue('BOOTSTRAP')===3) + + + function sc_userextended_cat($parm = '') + { + global $extended_showed; + + if(THEME_LEGACY === true) { - $USER_EXTENDED_CAT = e107::getCoreTemplate('usersettings','extended-category'); + $USER_EXTENDED_CAT = $this->legacyTemplate['USER_EXTENDED_CAT']; } - - + else + { + $USER_EXTENDED_CAT = e107::getCoreTemplate('usersettings', 'extended-category'); + } + + $sql = e107::getDb(); $tp = e107::getParser(); - + if(isset($extended_showed['cat'][$parm])) { return ""; @@ -401,26 +405,27 @@ class usersettings_shortcodes extends e_shortcode { $qry = " SELECT * FROM #user_extended_struct - WHERE user_extended_struct_applicable IN (".$tp -> toDB($this->var['userclass_list'], true).") - AND user_extended_struct_write IN (".USERCLASS_LIST.") - AND user_extended_struct_id = ".intval($parm)." + WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ") + AND user_extended_struct_write IN (" . USERCLASS_LIST . ") + AND user_extended_struct_id = " . intval($parm) . " "; if($sql->gen($qry)) { $catInfo = $sql->fetch(); } } - + if($catInfo) { $qry = " SELECT * FROM #user_extended_struct - WHERE user_extended_struct_applicable IN (".$tp -> toDB($this->var['userclass_list'], true).") - AND user_extended_struct_write IN (".USERCLASS_LIST.") - AND user_extended_struct_parent = ".intval($parm)." + WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ") + AND user_extended_struct_write IN (" . USERCLASS_LIST . ") + AND user_extended_struct_parent = " . intval($parm) . " AND user_extended_struct_type != 0 ORDER BY user_extended_struct_order ASC "; + if($sql->gen($qry)) { $fieldList = $sql->db_getList(); @@ -429,94 +434,115 @@ class usersettings_shortcodes extends e_shortcode cachevars("extendedfield_{$field['user_extended_struct_name']}", $field); //TODO use $this instead of parseTemplate(); $ret .= $this->sc_userextended_field($field['user_extended_struct_name']); - // $ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", TRUE, $usersettings_shortcodes); + // $ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", TRUE, $usersettings_shortcodes); } } } - + if($ret && $this->extendedTabs == false) { $catName = $catInfo['user_extended_struct_text'] ? $catInfo['user_extended_struct_text'] : $catInfo['user_extended_struct_name']; - if(defined($catName)) $catName = constant($catName); - $ret = str_replace("{CATNAME}", $tp->toHTML($catName, FALSE, 'emotes_off,defs'), $USER_EXTENDED_CAT).$ret; + if(defined($catName)) + { + $catName = constant($catName); + } + $ret = str_replace("{CATNAME}", $tp->toHTML($catName, false, 'emotes_off,defs'), $USER_EXTENDED_CAT) . $ret; } - + $extended_showed['cat'][$parm] = 1; + return $ret; } - - - - function sc_userextended_field($parm='') - { - global $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD; - - if(deftrue('BOOTSTRAP')===3) + + + function sc_userextended_field($parm = '') + { + global $extended_showed; + + $ue = e107::getUserExt(); + + + if(THEME_LEGACY === true) { - $USEREXTENDED_FIELD = e107::getCoreTemplate('usersettings','extended-field'); + $USEREXTENDED_FIELD = $this->legacyTemplate['USEREXTENDED_FIELD']; + $REQUIRED_FIELD = $this->legacyTemplate['REQUIRED_FIELD']; } - - + else + { + $USEREXTENDED_FIELD = e107::getCoreTemplate('usersettings', 'extended-field'); + $REQUIRED_FIELD = ''; + } + + if(isset($extended_showed['field'][$parm])) { return ""; } - + $sql = e107::getDb(); $tp = e107::getParser(); - - + $ret = ""; - + $fInfo = getcachedvars("extendeddata_{$parm}"); + if(!$fInfo) { $qry = " SELECT * FROM #user_extended_struct - WHERE user_extended_struct_applicable IN (".$tp -> toDB($this->var['userclass_list'], true).") - AND user_extended_struct_write IN (".USERCLASS_LIST.") - AND user_extended_struct_name = '".$tp -> toDB($parm, true)."' + WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ") + AND user_extended_struct_write IN (" . USERCLASS_LIST . ") + AND user_extended_struct_name = '" . $tp->toDB($parm, true) . "' "; if($sql->gen($qry)) { $fInfo = $sql->fetch(); } } - + if($fInfo) { $fname = $fInfo['user_extended_struct_text']; - if(defined($fname)) $fname = constant($fname); + + if(defined($fname)) + { + $fname = constant($fname); + } + $fname = $tp->toHTML($fname, "", "emotes_off, defs"); - + if($fInfo['user_extended_struct_required'] == 1 && !deftrue('BOOTSTRAP')) { $fname = str_replace("{FIELDNAME}", $fname, $REQUIRED_FIELD); } - - $parms = explode("^,^",$fInfo['user_extended_struct_parms']); - - $fhide=""; + + $parms = explode("^,^", $fInfo['user_extended_struct_parms']); + + $fhide = ""; + if(varset($parms[3])) { - $chk = (strpos($this->var['user_hidden_fields'], "^user_".$parm."^") === FALSE) ? FALSE : TRUE; + $chk = (strpos($this->var['user_hidden_fields'], "^user_" . $parm . "^") === false) ? false : true; + if(isset($_POST['updatesettings'])) { - $chk = isset($_POST['hide']['user_'.$parm]); + $chk = isset($_POST['hide']['user_' . $parm]); } + $fhide = $ue->user_extended_hide($fInfo, $chk); } - - $uVal = str_replace(chr(1), "", $this->var['user_'.$parm]); + + $uVal = str_replace(chr(1), "", $this->var['user_' . $parm]); $fval = $ue->user_extended_edit($fInfo, $uVal); - + $ret = $USEREXTENDED_FIELD; $ret = str_replace("{FIELDNAME}", $fname, $ret); $ret = str_replace("{FIELDVAL}", $fval, $ret); $ret = str_replace("{HIDEFIELD}", $fhide, $ret); } - + $extended_showed['field'][$parm] = 1; + return $ret; } diff --git a/e107_core/shortcodes/single/custom.php b/e107_core/shortcodes/single/custom.php index cc628efd4..2e632d2dc 100644 --- a/e107_core/shortcodes/single/custom.php +++ b/e107_core/shortcodes/single/custom.php @@ -9,7 +9,7 @@ function custom_shortcode($parm) { case 'login': case 'login noprofile': - include_lan(e_PLUGIN.'login_menu/languages/'.e_LANGUAGE.'.php'); + e107::includeLan(e_PLUGIN.'login_menu/languages/'.e_LANGUAGE.'.php'); $ret = ''; $sep = (defined('LOGINC_SEP')) ? LOGINC_SEP : ".:."; diff --git a/e107_core/shortcodes/single/email.sc b/e107_core/shortcodes/single/email.sc index b2eacb001..43a6e319e 100644 --- a/e107_core/shortcodes/single/email.sc +++ b/e107_core/shortcodes/single/email.sc @@ -1,4 +1,4 @@ -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user.php"); global $tp; if (substr($parm, -5) == '-link') diff --git a/e107_core/shortcodes/single/search.sc b/e107_core/shortcodes/single/search.sc index 1b992e290..0675eb171 100644 --- a/e107_core/shortcodes/single/search.sc +++ b/e107_core/shortcodes/single/search.sc @@ -1,7 +1,7 @@ //thumbWidth = vartrue($parm['w'],100); - e107::getParser()->thumbHeight = vartrue($parm['h'],0); - e107::getParser()->thumbCrop = vartrue($parm['crop'],0); + e107::getParser()->thumbWidth = varset($parm['w'],0); + e107::getParser()->thumbHeight = varset($parm['h'],0); + e107::getParser()->thumbCrop = varset($parm['crop'],0); } diff --git a/e107_core/shortcodes/single/user_extended.php b/e107_core/shortcodes/single/user_extended.php index 5295c6fa8..56af0ba83 100644 --- a/e107_core/shortcodes/single/user_extended.php +++ b/e107_core/shortcodes/single/user_extended.php @@ -65,7 +65,7 @@ /** * @todo - must be a better way of picking up the 'Miscellaneous' category */ - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); if (($parms[1] != 'icon') && ($parms[0] != LAN_USER_44)) diff --git a/e107_core/shortcodes/single/user_extended_old.sc b/e107_core/shortcodes/single/user_extended_old.sc index 02b85b70c..88c7a4cbe 100644 --- a/e107_core/shortcodes/single/user_extended_old.sc +++ b/e107_core/shortcodes/single/user_extended_old.sc @@ -10,7 +10,7 @@ * USAGE: {USER_EXTENDED=.[text|value|icon|text_value].} * EXAMPLE: {USER_EXTENDED=user_gender.value.5} will show the value of the extended field user_gender for user #5 */ -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user_extended.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user_extended.php'); $parms = explode('.', $parm); global $currentUser, $tp, $loop_uid, $e107, $sc_style; if(isset($loop_uid) && intval($loop_uid) == 0) { return ''; } @@ -49,7 +49,7 @@ if($udata['user_admin'] == 1) /** * @todo - must be a better way of picking up the 'Miscellaneous' category */ -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); if (($parms[1] != 'icon') && ($parms[0] != LAN_USER_44)) { $ret_cause = 0; diff --git a/e107_core/sql/core_sql.php b/e107_core/sql/core_sql.php index 6a2f9aeb3..bfcc84d5b 100644 --- a/e107_core/sql/core_sql.php +++ b/e107_core/sql/core_sql.php @@ -387,6 +387,7 @@ CREATE TABLE page ( page_ip_restrict text, page_template varchar(50) NOT NULL default '', page_order int(4) unsigned NOT NULL default '9999', + page_fields mediumtext, menu_name varchar(50) NOT NULL default '', menu_title varchar(250) NOT NULL default '', menu_text mediumtext, @@ -418,6 +419,7 @@ CREATE TABLE page_chapters ( chapter_order int(6) unsigned NOT NULL default '0', chapter_template varchar(50) NOT NULL default '', chapter_visibility tinyint(3) unsigned NOT NULL default '0', + chapter_fields mediumtext, PRIMARY KEY (chapter_id), KEY chapter_order (chapter_order) ) ENGINE=MyISAM; diff --git a/e107_core/templates/admin_icons_template.php b/e107_core/templates/admin_icons_template.php index 9ee81afa9..3ccea6ad9 100644 --- a/e107_core/templates/admin_icons_template.php +++ b/e107_core/templates/admin_icons_template.php @@ -440,14 +440,25 @@ if (!defined('E_16_FAILEDLOGIN')) { define("E_32_TRUE", ""); +/* + define("ADMIN_TRUE_ICON", ""); + define("ADMIN_FALSE_ICON", ""); + define("ADMIN_WARNING_ICON", ""); + + define("ADMIN_EDIT_ICON", ""); + define("ADMIN_DELETE_ICON", ""); + define("ADMIN_EXECUTE_ICON", ""); + define("ADMIN_SORT_ICON", ""); +*/ define("ADMIN_TRUE_ICON", ""); define("ADMIN_FALSE_ICON", ""); define("ADMIN_WARNING_ICON", ""); - define("ADMIN_EDIT_ICON", ""); define("ADMIN_DELETE_ICON", ""); + + define("ADMIN_ADD_ICON", ""); define("ADMIN_INFO_ICON", ""); define("ADMIN_CONFIGURE_ICON", ""); @@ -463,6 +474,7 @@ define("E_32_TRUE", ""); define("ADMIN_EXECUTE_ICON", ""); + // FOR BC define("ADMIN_EDIT_ICON_PATH", e_IMAGE_ABS."admin_images/edit_32.png"); diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index f36fc0cdf..d5c8a9f6b 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -187,7 +187,7 @@ if (/*!defined("PREVIEWTHEME") && */! (isset($no_core_css) && $no_core_css !==tr $e_js->otherCSS('{e_WEB_CSS}e107.css'); } -if(!deftrue('BOOTSTRAP')) +if(THEME_LEGACY === true) { $e_js->otherCSS('{e_WEB_CSS}backcompat.css'); } @@ -665,12 +665,13 @@ echo "\n"; $HEADER = str_replace("{e_PAGETITLE}",deftrue('e_PAGETITLE',''),$HEADER); - $body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' "; + //$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' "; if(!deftrue('BODYTAG')) //TODO Discuss a better way? { + $body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' "; echo "\n"; } else diff --git a/e107_core/templates/page_template.php b/e107_core/templates/page_template.php index 09a00162f..19a9ae2d7 100644 --- a/e107_core/templates/page_template.php +++ b/e107_core/templates/page_template.php @@ -51,7 +51,11 @@ $sc_style['CPAGENAV|default']['post'] = '';
{CPAGERATING|default} {CPAGEEDIT} - '; + + + '; + + // {CPAGEFIELD: name=image} $PAGE_WRAPPER['default']['CPAGEEDIT'] = "
{---}
"; @@ -100,7 +104,7 @@ $sc_style['CPAGENAV|default']['post'] = ''; $PAGE_TEMPLATE['default']['related']['item'] = ''; $PAGE_TEMPLATE['default']['related']['end'] = ''; - + // $PAGE_TEMPLATE['default']['editor'] = '
  • Level 1
  • Level 2
'; #### No table render example template #### diff --git a/e107_core/templates/signup_template.php b/e107_core/templates/signup_template.php index dd4687697..3c1c1f68e 100755 --- a/e107_core/templates/signup_template.php +++ b/e107_core/templates/signup_template.php @@ -167,7 +167,7 @@ $sc_style['SIGNUP_EMAIL_CONFIRM']['post'] = " "; $sc_style['SIGNUP_XUP']['pre'] = "
"; -$sc_style['SIGNUP_XUP']['post'] = "
"; +$sc_style['SIGNUP_XUP']['post'] = ""; $sc_style['SIGNUP_PASSWORD1']['pre'] = " @@ -191,7 +191,7 @@ $sc_style['SIGNUP_USERCLASS_SUBSCRIBE']['post'] = " if(!defined($COPPA_TEMPLATE)) { $COPPA_TEMPLATE = - LAN_SIGNUP_77." ".LAN_SIGNUP_14.". " + LAN_SIGNUP_77." ".LAN_SIGNUP_14.". " .LAN_SIGNUP_15." ".$tp->emailObfuscate(SITEADMINEMAIL,LAN_SIGNUP_14)." ".LAN_SIGNUP_16."

".LAN_SIGNUP_17." @@ -268,4 +268,4 @@ if(!defined($SIGNUP_END)) { $SIGNUP_END = ''; } -?> \ No newline at end of file +?> diff --git a/e107_core/xml/default_install.xml b/e107_core/xml/default_install.xml index f77d3877c..a1c578cc0 100644 --- a/e107_core/xml/default_install.xml +++ b/e107_core/xml/default_install.xml @@ -8,7 +8,7 @@ admin_dark.css 0 - infopanel + flexpanel bootstrap3 0 2 diff --git a/e107_core/xml/user_extended.xml b/e107_core/xml/user_extended.xml index 04dfd5bf4..7447269f5 100644 --- a/e107_core/xml/user_extended.xml +++ b/e107_core/xml/user_extended.xml @@ -8,8 +8,7 @@ 253 - db field - user_extended_country,country_iso,country_name,country_name + country 253 253 diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 820691e7a..72d7e522b 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -2608,6 +2608,10 @@ class e_admin_controller_ui extends e_admin_controller return $this->tabs; } + public function addTab($key,$val) + { + $this->tabs[$key] = (string) $val; + } /** * Get Tab data diff --git a/e107_handlers/application.php b/e107_handlers/application.php index 24456f072..c3f3ebb06 100644 --- a/e107_handlers/application.php +++ b/e107_handlers/application.php @@ -6,17 +6,10 @@ * Released under the terms and conditions of the * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * $URL$ - * $Id$ */ /** - * @package e107 - * @subpackage e107_handlers - * @version $Id$ - * @author SecretR - * * e107 Single Entry Point handling * * Currently this file contains all classes required for single entry point functionallity @@ -1821,7 +1814,7 @@ class eRouter if(isset($params['#'])) { $anc = '#'.$params['#']; - usnet($params['#']); + unset($params['#']); } // Config independent - Deny parameter keys, useful for directly denying sensitive data e.g. password db fields @@ -4326,6 +4319,7 @@ class eHelper public static function secureIdAttr($string) { + $string = str_replace(array('/','_'),'-',$string); return preg_replace(self::$_idRegEx, '', $string); } diff --git a/e107_handlers/comment_class.php b/e107_handlers/comment_class.php index c4cb75263..ca2233937 100644 --- a/e107_handlers/comment_class.php +++ b/e107_handlers/comment_class.php @@ -16,7 +16,7 @@ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php"); global $comment_shortcodes; require_once (e_CORE."shortcodes/batch/comment_shortcodes.php"); /** diff --git a/e107_handlers/date_handler.php b/e107_handlers/date_handler.php index 902886759..0f788d1f7 100644 --- a/e107_handlers/date_handler.php +++ b/e107_handlers/date_handler.php @@ -14,7 +14,7 @@ */ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php"); class convert { diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index 3874c4c4e..587c4d1c9 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -350,169 +350,233 @@ class e107_db_debug { return "".$amount.""; } - - function Show_Performance() { - // - // Stats by Time Marker - // - global $db_time; - global $sql; - global $eTimingStart, $eTimingStop; - $this->Mark_Time('Stop'); + function Show_Performance() + { + // + // Stats by Time Marker + // + global $db_time; + global $sql; + global $eTimingStart, $eTimingStop; - if (!E107_DBG_TIMEDETAILS) return ''; + $this->Mark_Time('Stop'); - $totTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop); - $text = "\n\n"; - $bRowHeaders=FALSE; - reset($this->aTimeMarks); - $aSum=$this->aTimeMarks[0]; // create a template from the 'real' array - $aSum['Index']=''; - $aSum['What']='Total'; - $aSum['Time']=0; - $aSum['DB Time']=0; - $aSum['DB Count']=0; - $aSum['Memory']=''; + if(!E107_DBG_TIMEDETAILS) + { + return ''; + } - while (list($tKey, $tMarker) = each($this->aTimeMarks)) { - if (!$bRowHeaders) { - // First time: emit headers - $bRowHeaders=TRUE; - $text .= "\n"; - $aUnits = $tMarker; - foreach ($aUnits as $key=>$val) { - switch ($key) { - case 'DB Time': - case 'Time': - $aUnits[$key] = '(msec)'; - break; - default: - $aUnits[$key] = ''; - break; - } + $totTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop); + + $text = "\n
".implode(" ", array_keys($tMarker))." OB Lev 
\n"; + $bRowHeaders = false; + reset($this->aTimeMarks); + $aSum = $this->aTimeMarks[0]; // create a template from the 'real' array + + $aSum['Index'] = ''; + $aSum['What'] = 'Total'; + $aSum['Time'] = 0; + $aSum['DB Time'] = 0; + $aSum['DB Count'] = 0; + $aSum['Memory'] = 0; + + // Calculate Memory Usage per entry. + $prevMem = 0; + + foreach($this->aTimeMarks as $k=>$v) + { + + $prevKey = $k-1; + + if(!empty($prevKey)) + { + $this->aTimeMarks[$prevKey]['Memory Used'] = (intval($v['Memory']) - $prevMem); } - $aUnits['OB Lev'] = 'lev(buf bytes)'; - $aUnits['Memory'] = '(kb)'; - $text .= "\n"; + + $prevMem = intval($v['Memory']); } - $tMem = $tMarker['Memory']; - $tMarker['Memory'] = ($tMem ? number_format($tMem/1024.0, 1) : '?'); // display if known - if ($tMarker['What'] == 'Stop') { - $tMarker['Time']=' '; - $tMarker['%Time']=' '; - $tMarker['%DB Count']=' '; - $tMarker['%DB Time']=' '; - $tMarker['DB Time']=' '; - $tMarker['OB Lev']=$this->aOBMarks[$tKey]; - $tMarker['DB Count']=' '; - } else { - // Convert from start time to delta time, i.e. from now to next entry - $nextMarker=current($this->aTimeMarks); - $aNextT=$nextMarker['Time']; - $aThisT=$tMarker['Time']; - - $thisDelta = e107::getSingleton('e107_traffic')->TimeDelta($aThisT, $aNextT); - $aSum['Time'] += $thisDelta; - $aSum['DB Time'] += $tMarker['DB Time']; - $aSum['DB Count'] += $tMarker['DB Count']; - $tMarker['Time']=number_format($thisDelta*1000.0, 1); - $tMarker['%Time']=$totTime ? number_format(100.0 * ($thisDelta / $totTime), 0) : 0; - $tMarker['%DB Count']=number_format(100.0 * $tMarker['DB Count'] / $sql->db_QueryCount(), 0); - $tMarker['%DB Time']=$db_time ? number_format(100.0 * $tMarker['DB Time'] / $db_time, 0) : 0; - $tMarker['DB Time']=number_format($tMarker['DB Time']*1000.0, 1); - - $tMarker['OB Lev']=$this->aOBMarks[$tKey]; + + + while(list($tKey, $tMarker) = each($this->aTimeMarks)) + { + if(!$bRowHeaders) + { + // First time: emit headers + $bRowHeaders = true; + $text .= "\n"; + $aUnits = $tMarker; + foreach($aUnits as $key => $val) + { + switch($key) + { + case 'DB Time': + case 'Time': + $aUnits[$key] = '(msec)'; + break; + default: + $aUnits[$key] = ''; + break; + } + } + $aUnits['OB Lev'] = 'lev(buf bytes)'; + $aUnits['Memory'] = '(kb)'; + $aUnits['Memory Used'] = '(kb)'; + $text .= "\n"; + } + + + + // $tMem = ($tMarker['Memory'] - $aSum['Memory']); + + $tMem = ($tMarker['Memory']); + + if($tMem < 0) // Quick Fix for negative numbers. + { + // $tMem = 0.0000000001; + } + + $tMarker['Memory'] = ($tMem ? number_format($tMem / 1024.0, 1) : '?'); // display if known + + $tUsage = $tMarker['Memory Used']; + $tMarker['Memory Used'] = number_format($tUsage / 1024.0, 1); + + if($tUsage > 400000) // Highlight high memory usage. + { + $tMarker['Memory Used'] = "".$tMarker['Memory Used'].""; + } + + $aSum['Memory'] = $tMem; + + if($tMarker['What'] == 'Stop') + { + $tMarker['Time'] = ' '; + $tMarker['%Time'] = ' '; + $tMarker['%DB Count'] = ' '; + $tMarker['%DB Time'] = ' '; + $tMarker['DB Time'] = ' '; + $tMarker['OB Lev'] = $this->aOBMarks[$tKey]; + $tMarker['DB Count'] = ' '; + } + else + { + // Convert from start time to delta time, i.e. from now to next entry + $nextMarker = current($this->aTimeMarks); + $aNextT = $nextMarker['Time']; + $aThisT = $tMarker['Time']; + + $thisDelta = e107::getSingleton('e107_traffic')->TimeDelta($aThisT, $aNextT); + $aSum['Time'] += $thisDelta; + $aSum['DB Time'] += $tMarker['DB Time']; + $aSum['DB Count'] += $tMarker['DB Count']; + $tMarker['Time'] = number_format($thisDelta * 1000.0, 1); + $tMarker['%Time'] = $totTime ? number_format(100.0 * ($thisDelta / $totTime), 0) : 0; + $tMarker['%DB Count'] = number_format(100.0 * $tMarker['DB Count'] / $sql->db_QueryCount(), 0); + $tMarker['%DB Time'] = $db_time ? number_format(100.0 * $tMarker['DB Time'] / $db_time, 0) : 0; + $tMarker['DB Time'] = number_format($tMarker['DB Time'] * 1000.0, 1); + + $tMarker['OB Lev'] = $this->aOBMarks[$tKey]; + } + + $text .= "\n"; + + if(isset($this->aMarkNotes[$tKey])) + { + $text .= "\n"; + } + + if($tMarker['What'] == 'Stop') + { + break; + } } - $text .= "\n"; - - if (isset($this->aMarkNotes[$tKey])) { - $text .= "\n"; - } - if ($tMarker['What'] == 'Stop') break; - } - - $aSum['%Time']=$totTime ? number_format(100.0 * ($aSum['Time'] / $totTime), 0) : 0; - $aSum['%DB Time']=$db_time ? number_format(100.0 * ($aSum['DB Time'] / $db_time), 0) : 0; - $aSum['%DB Count']=($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0; - $aSum['Time']=number_format($aSum['Time'] * 1000.0, 1); - $aSum['DB Time']=number_format($aSum['DB Time']*1000.0, 1); + $aSum['%Time'] = $totTime ? number_format(100.0 * ($aSum['Time'] / $totTime), 0) : 0; + $aSum['%DB Time'] = $db_time ? number_format(100.0 * ($aSum['DB Time'] / $db_time), 0) : 0; + $aSum['%DB Count'] = ($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0; + $aSum['Time'] = number_format($aSum['Time'] * 1000.0, 1); + $aSum['DB Time'] = number_format($aSum['DB Time'] * 1000.0, 1); - $text .= " + $text .= " - - - - - - - - + + + + + + + + + + "; - // $text .= "\n"; + // $text .= "\n"; $text .= "\n
".implode(" ", $aUnits)." 
" . implode(" ", array_keys($tMarker)) . " OB Lev 
" . implode(" ", $aUnits) . " 
" . implode(" ", array_values($tMarker)) . " 
 "; + $text .= $this->aMarkNotes[$tKey] . "
".implode(" ", array_values($tMarker))." 
 "; - $text .= $this->aMarkNotes[$tKey]."
  Total".$aSum['%Time']."".$aSum['%DB Time']."".$aSum['%DB Count']."".$aSum['Time']."".$aSum['DB Time']."".$aSum['DB Count']."".$tMarker['Memory']."".$tMarker['OB Lev']."" . $aSum['%Time'] . "" . $aSum['%DB Time'] . "" . $aSum['%DB Count'] . "" . $aSum['Time'] . "" . $aSum['DB Time'] . "" . $aSum['DB Count'] . "" . number_format($aSum['Memory'] / 1024, 1) . "" . number_format($aSum['Memory'] / 1024, 1) . "" . $tMarker['OB Lev'] . "
".implode(" ", $aSum)."  
".implode(" ", $aSum)."  

\n"; - // - // Stats by Table - // + // + // Stats by Table + // - $text .= "\n\n"; + $text .= "\n
\n"; - $bRowHeaders=FALSE; - $aSum=$this->aDBbyTable['core']; // create a template from the 'real' array - $aSum['Table']='Total'; - $aSum['%DB Count']=0; - $aSum['%DB Time']=0; - $aSum['DB Time']=0; - $aSum['DB Count']=0; + $bRowHeaders = false; + $aSum = $this->aDBbyTable['core']; // create a template from the 'real' array + $aSum['Table'] = 'Total'; + $aSum['%DB Count'] = 0; + $aSum['%DB Time'] = 0; + $aSum['DB Time'] = 0; + $aSum['DB Count'] = 0; - foreach ($this->aDBbyTable as $curTable) { - if (!$bRowHeaders) { - $bRowHeaders=TRUE; - $text .= "\n"; - $aUnits = $curTable; - foreach ($aUnits as $key=>$val) { - switch ($key) { - case 'DB Time': - $aUnits[$key] = '(msec)'; - break; - default: - $aUnits[$key] = ''; - break; + foreach($this->aDBbyTable as $curTable) + { + if(!$bRowHeaders) + { + $bRowHeaders = true; + $text .= "\n"; + $aUnits = $curTable; + foreach($aUnits as $key => $val) + { + switch($key) + { + case 'DB Time': + $aUnits[$key] = '(msec)'; + break; + default: + $aUnits[$key] = ''; + break; + } } + $text .= "\n"; } - $text .= "\n"; + + $aSum['DB Time'] += $curTable['DB Time']; + $aSum['DB Count'] += $curTable['DB Count']; + $curTable['%DB Count'] = number_format(100.0 * $curTable['DB Count'] / $sql->db_QueryCount(), 0); + $curTable['%DB Time'] = number_format(100.0 * $curTable['DB Time'] / $db_time, 0); + $curTable['DB Time'] = number_format($curTable['DB Time'] * 1000.0, 1); + $text .= "\n"; } - $aSum['DB Time'] += $curTable['DB Time']; - $aSum['DB Count'] += $curTable['DB Count']; - $curTable['%DB Count']=number_format(100.0 * $curTable['DB Count'] / $sql->db_QueryCount(), 0); - $curTable['%DB Time']=number_format(100.0 * $curTable['DB Time'] / $db_time, 0); - $curTable['DB Time']=number_format($curTable['DB Time']*1000.0, 1); - $text .= "\n"; + $aSum['%DB Time'] = $db_time ? number_format(100.0 * ($aSum['DB Time'] / $db_time), 0) : 0; + $aSum['%DB Count'] = ($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0; + $aSum['DB Time'] = number_format($aSum['DB Time'] * 1000.0, 1); + $text .= "\n"; + $text .= "\n
".implode("", array_keys($curTable))."
" . implode("", array_keys($curTable)) . "
" . implode(" ", $aUnits) . " 
".implode(" ", $aUnits)." 
" . implode(" ", array_values($curTable)) . " 
".implode(" ", array_values($curTable))." 
" . implode(" ", array_values($aSum)) . " 

\n"; + + return $text; } - $aSum['%DB Time']=$db_time ? number_format(100.0 * ($aSum['DB Time'] / $db_time), 0) : 0; - $aSum['%DB Count']=($sql->db_QueryCount()) ? number_format(100.0 * ($aSum['DB Count'] / ($sql->db_QueryCount())), 0) : 0; - $aSum['DB Time']=number_format($aSum['DB Time']*1000.0, 1); - $text .= "".implode(" ", array_values($aSum))." \n"; - $text .= "\n
\n"; - - return $text; - } - function logDeprecated(){ $back_trace = debug_backtrace(); diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 7e10a28e1..aea5091b6 100644 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -17,7 +17,7 @@ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_db_verify.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_db_verify.php'); class db_verify { diff --git a/e107_handlers/debug_handler.php b/e107_handlers/debug_handler.php index a0adda994..ec9faf8a5 100644 --- a/e107_handlers/debug_handler.php +++ b/e107_handlers/debug_handler.php @@ -144,15 +144,18 @@ class e107_debug { $aDVal = explode('.',$dVals); // support multiple values, OR'd together $dVal = 0; + + + foreach ($aDVal as $curDVal) { if (isset($this->aDebugShortcuts[$curDVal])) { $dVal |= $this->aDebugShortcuts[$curDVal]; - } + } else { - $dVal |= $curDVal; + $dVal |= intval($curDVal); } } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 203cb10af..d5dd14655 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -184,6 +184,7 @@ class e107 'e_array' => '{e_HANDLER}core_functions.php', // Old ArrayStorage. 'e_bbcode' => '{e_HANDLER}bbcode_handler.php', 'e_bb_base' => '{e_HANDLER}bbcode_handler.php', + 'e_customfields' => '{e_HANDLER}e_customfields_class.php', 'e_file' => '{e_HANDLER}file_class.php', 'e_form' => '{e_HANDLER}form_handler.php', 'e_jshelper' => '{e_HANDLER}js_helper.php', @@ -1116,7 +1117,7 @@ class e107 $legacy_pref_name = ($pref_name) ? $pref_name = '/'.$pref_name : ''; $tprefs = self::getConfig()->getPref('sitetheme_pref'.$legacy_pref_name, $default, $index); - return !empty($tprefs) ? $tprefs : array(); + return !empty($tprefs) ? $tprefs : $default; } @@ -1765,6 +1766,15 @@ class e107 return self::getSingleton('comment', true); } + /** + * Retrieve comments handler singleton object + * @return e_customfields + */ + public static function getCustomFields() + { + return self::getSingleton('e_customfields', true); + } + /** * Retrieve Media handler singleton object * @return e_media @@ -2764,7 +2774,7 @@ class e107 /** * Load language file, replacement of include_lan() - * + * @outdated use e107::lan() or e107::coreLan(), e107::plugLan(), e107::themeLan() * @param string $path * @param boolean $force * @return string @@ -2778,9 +2788,11 @@ class e107 return false; } - self::getMessage()->addDebug("Couldn't load language file: ".$path); + $path = str_replace(e_LANGUAGE, 'English', $path); - + + self::getDebug()->log("Couldn't load language file: ".$path); + if(!is_readable($path)) { return false; diff --git a/e107_handlers/e_customfields_class.php b/e107_handlers/e_customfields_class.php new file mode 100644 index 000000000..8b07d3d94 --- /dev/null +++ b/e107_handlers/e_customfields_class.php @@ -0,0 +1,464 @@ +'Additional FieldsXX'); + + + function __construct() + { + asort($this->_fieldTypes); + + } + + public function getFieldTypes() + { + + return $this->_fieldTypes; + } + + + /** + * Load the configuration for all custom fields + * @param string $data - json custom-field configuration data. + * @return $this + */ + public function loadConfig($data) + { + if(empty($data)) + { + return $this; + } + + if(is_array($data)) + { + $this->_config = $data; + return $this; + } + + $tp = e107::getParser(); + + if($arr = $tp->isJSON($data)) + { + $this->_config = $arr; + } + + + // e107::getDebug()->log($this->_config); + + + return $this; + } + + + /** + * Load a set of custom-field data for the current configuration. + * @param string $data json custom-field form data. + * @return $this + */ + public function loadData($data) + { + $this->_data = e107::unserialize($data); + + // e107::getDebug()->log($this->_data); + + return $this; + } + + + public function getConfig() + { + return $this->_config; + } + + + public function getData() + { + return $this->_data; + } + + + public function setTab($key, $label) + { + $this->_tab = array((string) $key => (string) $label); + + return $this; + } + + + public function getFieldValue($key, $parm=array()) + { + $tp = e107::getParser(); + + $value = $this->_data[$key]; + $raw = (!empty($parm['mode']) && $parm['mode'] === 'raw') ? true : false; + $type = (!empty($parm['type'])) ? $parm['type'] : null; + + $fieldType = $this->_config[$key]['type']; + + switch($fieldType) + { + case "dropdown": + case "checkboxes": + case "radio": + return ($raw) ? $value : e107::getForm()->renderValue($key,$value,$this->_config[$key]); + break; + + case "video": + return ($raw) ? 'https://www.youtube.com/watch?v='.str_replace(".youtube", '', $value) : $tp->toVideo($value); + break; + + case "image": + return ($raw) ? $tp->thumbUrl($value) : $tp->toImage($value); + break; + + case "icon": + return ($raw) ? str_replace(".glyph", '', $value) : $tp->toIcon($value); + break; + + case "country": + return ($raw) ? $value : e107::getForm()->getCountry($value); + break; + + case "tags": + return ($raw) ? $value : $tp->toLabel($value,$type); + break; + + case "lanlist": + case "language": + return ($raw) ? $value : e107::getLanguage()->convert($value); + break; + + case "datestamp": + return ($raw) ? $value : $tp->toDate($value); + break; + + case "file": + return ($raw) ? $tp->toFile($value, array('raw'=>1)) : $tp->toFile($value); + break; + + case "url": + case "email": + return ($raw) ? $value : $tp->toHtml($value); + break; + + case "user": + return ($raw) ? $value : e107::getSystemUser($value,true)->getName(); + break; + + case "userclass": + return ($raw) ? $value : e107::getUserClass()->getName($value); + break; + + case "textarea": + case "bbarea": + return $tp->toHtml($value, true); + break; + + + default: + return $tp->toHtml($value); + } + + } + + + public function renderTest() + { + + $text = ' + '; + + foreach($this->_data as $ok=>$v) + { + + $text .= ""; + } + + $text .= "
NameTitle
{CPAGEFIELDTITLE: name=x}
Normal
{CPAGEFIELD: name=x}
Raw
{CPAGEFIELD: name=x&mode=raw}
".$ok."".$this->getFieldTitle($ok)."".$this->getFieldValue($ok)."".$this->getFieldValue($ok, array('mode'=>'raw'))."
"; + + return $text; + + + + } + + + + public function getFieldTitle($key) + { + + if(!empty($this->_config[$key]['title'])) + { + return $this->_config[$key]['title']; + } + + return null; + } + + + + + public function renderConfigForm($name) + { + $frm = e107::getForm(); + $curVal = $this->_config; + $value = array(); + + if(!empty($curVal)) + { + $i = 0; + foreach($curVal as $k=>$v) + { + $v['key'] = $k; + $value[$i] = $v; + $i++; + } + } + + + $text = " + + + + + + + + + "; + + for ($i = 0; $i <= $this->_field_limit; $i++) + { + + $writeParms = array( + // 'class' => 'form-control', + 'useValues' => 1, + 'default' => 'blank', + 'data-src' => e_REQUEST_URI, + + ); + + $parmsWriteParms= array( + 'size' => 'block-level', + 'placeholder' => $this->getCustomFieldPlaceholder($value[$i]['type']) + + ); + + $fieldName = $frm->text($name.'['.$i.'][key]', $value[$i]['key'],30, array('pattern'=>'^[a-z0-9-]*')); + $fieldTitle = $frm->text($name.'['.$i.'][title]',$value[$i]['title'], 80); + $fieldType = $frm->select($name.'['.$i.'][type]',$this->getFieldTypes(),$value[$i]['type'], $writeParms); + $fieldParms = $frm->text($name.'['.$i.'][writeParms]',$value[$i]['writeParms'], 255, $parmsWriteParms); + $fieldHelp = $frm->text($name.'['.$i.'][help]',$value[$i]['help'], 255, array('size'=>'block-level')); + $text .= ""; + } + + $text .= "
".LAN_NAME."".LAN_TITLE."".LAN_TYPE."Params".LAN_TOOLTIP."
".$fieldName."".$fieldTitle."".$fieldType."".$fieldParms."".$fieldHelp."
"; + + + return $text; + + } + + + /** + * @param $type + * @return null|string + */ + private function getCustomFieldPlaceholder($type) + { + switch($type) + { + case "radio": + case "dropdown": + case "checkboxes": + return 'eg. { "optArray": { "blue": "Blue", "green": "Green", "red": "Red" }, "default": "blank" }'; + break; + + case "datestamp": + return 'eg. (Optional) { "format": "yyyy-mm-dd" }'; + break; + + + default: + + } + + + return null; + + + } + + + /** + * + * @param $fieldName + * @param e_admin_ui $ui + * @return $this + */ + public function setAdminUIConfig($fieldName, e_admin_ui &$ui) + { + $fields = array(); + + $tabKey = key($this->_tab); + $ui->addTab($tabKey, $this->_tab[$tabKey]); + + + foreach($this->_config as $key=>$fld) + { + $fld['tab'] = $tabKey; + $fld['data'] = false; + + if($fld['type'] === 'icon') + { + $fld['writeParms'] .= "&glyphs=1"; + } + + if($fld['type'] == 'checkboxes') + { + if($tmp = e107::getParser()->isJSON($fld['writeParms'])) + { + $fld['writeParms'] = $tmp; + } + + $fld['writeParms']['useKeyValues'] = 1; + } + + $fields[$fieldName.'__'.$key] = $fld; + + } + + $ui->setFieldAttr($fields); + + return $this; + + + } + + + /** + * @param $fieldname + * @param e_admin_ui $ui + * @return $this + */ + public function setAdminUIData($fieldname, e_admin_ui &$ui) + { + + $ui->getModel()->set($fieldname, null); + + foreach($this->_data as $key=>$value) + { + $ui->getModel()->set($fieldname.'__'.$key, $value); + // e107::getDebug()->log($fieldname.'__'.$key.": ".$value); + } + + return $this; + + + } + + + /** + * Process Posted form data and compiled Configuration Form data if found. + * @param string $fieldname + * @param array $postData all posted data. + * @return array + */ + public function processConfigPost($fieldname, $postData) + { + + if(empty($postData[$fieldname])) + { + return $postData; + } + + + $new = array(); + foreach($postData[$fieldname] as $fields) + { + if(empty($fields['key']) || empty($fields['type'])) + { + continue; + } + + + $key = $fields['key']; + unset($fields['key']); + $new[$key] = $fields; + + + } + + $postData[$fieldname] = empty($new) ? null : $new; + + return $postData; + + } + + + /** + * Process all posted data and compile into a single field array. + * @param $fieldname + * @param $new_data + * @return null + * @internal param array $newdata - all posted data. + */ + public function processDataPost($fieldname, $new_data) + { + if(empty($new_data)) + { + return null; + } + + unset($new_data[$fieldname]); // Reset. + + $len = strlen($fieldname); + + foreach($new_data as $k=>$v) + { + if(substr($k,0,$len) === $fieldname) + { + list($tmp,$newkey) = explode("__",$k); + $new_data[$fieldname][$newkey] = $v; + unset($new_data[$k]); + + + } + + } + + if(empty($new_data[$fieldname])) + { + // $new_data[$fieldname] = array(); + } + + return $new_data; + + } + + + + } \ No newline at end of file diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 64a77c9f9..6c69d8282 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2590,8 +2590,6 @@ class e_parse extends e_parser // $parms['x'] = $encode; - - if(!empty($parm['return']) && $parm['return'] == 'src') { return $this->thumbUrl($src, $parms); @@ -3641,6 +3639,49 @@ class e_parser } + /** + * @param $text + * @return string + */ + public function toLabel($text, $type = null) + { + if($type === null) + { + $type = 'default'; + } + + $tmp = explode(",",$text); + + $opt = array(); + foreach($tmp as $v) + { + $opt[] = "".$v.""; + } + + return implode(" ",$opt); + } + + /** + * Take a file-path and convert it to a download link. + * @param $text + * @return string + */ + public function toFile($text, $parm=array()) + { + $srch = array( + '{e_MEDIA_FILE}' => 'e_MEDIA_FILE/', + '{e_PLUGIN}' => 'e_PLUGIN/' + ); + + $link = e_HTTP."request.php?file=". str_replace(array_keys($srch), $srch,$text); + + if(!empty($parm['raw'])) + { + return $link; + } + + return "-attachment-"; //TODO Add pref for this. + } /** * Render an avatar based on supplied user data or current user when missing. @@ -3655,6 +3696,12 @@ class e_parser $linkStart = ''; $linkEnd = ''; + if(!empty($options['h'])) + { + $height = intval($options['h']); + } + + if($userData === null && USERID) { $userData = array(); @@ -3704,7 +3751,7 @@ class e_parser } $title = (ADMIN) ? $image : $tp->toAttribute($userData['user_name']); - $shape = (!empty($options['shape'])) ? "img-".$options['shape'] : "img-rounded"; + $shape = (!empty($options['shape'])) ? "img-".$options['shape'] : "img-rounded rounded"; if(!empty($options['type']) && $options['type'] == 'url') { @@ -3857,10 +3904,18 @@ class e_parser unset($parm['src']); $path = $tp->thumbUrl($file,$parm); - $srcSetParm = $parm; - $srcSetParm['size'] = ($parm['w'] < 100) ? '4x' : '2x'; - $parm['srcset'] = $tp->thumbSrcSet($file, $srcSetParm); + + if(empty($parm['w']) && empty($parm['h'])) + { + $parm['srcset'] = false; + } + else + { + $srcSetParm = $parm; + $srcSetParm['size'] = ($parm['w'] < 100) ? '4x' : '2x'; + $parm['srcset'] = $tp->thumbSrcSet($file, $srcSetParm); + } } elseif(strpos($file,'http')===0) @@ -3897,7 +3952,7 @@ class e_parser $id = (!empty($parm['id'])) ? "id=\"".$parm['id']."\" " : "" ; - $class = (!empty($parm['class'])) ? $parm['class'] : "img-responsive"; + $class = (!empty($parm['class'])) ? $parm['class'] : "img-responsive img-fluid"; $alt = (!empty($parm['alt'])) ? $tp->toAttribute($parm['alt']) : basename($file); $style = (!empty($parm['style'])) ? "style=\"".$parm['style']."\" " : "" ; $srcset = (!empty($parm['srcset'])) ? "srcset=\"".$parm['srcset']."\" " : ""; @@ -3950,6 +4005,35 @@ class e_parser } + /** + * Check if string is json and parse or return false. + * @param $text + * @return bool|mixed return false if not json, and json values if true. + */ + public function isJSON($text) + { + if(!is_string($text)) + { + return false; + } + + if(substr($text,0,1) === '{' || substr($text,0,1) === '[') // json + { + $dat = json_decode($text, true); + + if(json_last_error() != JSON_ERROR_NONE) + { + // e107::getDebug()->log("Json data found"); + return false; + } + + return $dat; + } + + return false; + + } + /** @@ -4074,7 +4158,7 @@ class e_parser if($thumb == 'tag') { - return "Youtube Video"; + return "Youtube Video"; } if($thumb == 'email') @@ -4120,7 +4204,7 @@ class e_parser { $thumbSrc = e_IMAGE_ABS."generic/playlist_120.png"; } - return "".LAN_YOUTUBE_PLAYLIST.""; + return "".LAN_YOUTUBE_PLAYLIST.""; } diff --git a/e107_handlers/emailprint_class.php b/e107_handlers/emailprint_class.php index 56324e6a2..9caa8dde8 100644 --- a/e107_handlers/emailprint_class.php +++ b/e107_handlers/emailprint_class.php @@ -16,8 +16,8 @@ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php"); -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php"); class emailprint { diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index e68c38d06..5198a7bd6 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -67,6 +67,8 @@ class e_form protected $_tabindex_enabled = true; protected $_cached_attributes = array(); + + /** * @var user_class */ @@ -531,10 +533,11 @@ class e_form $text .= ''; $initTab = varset($options['active'],false); + $tabClass = varset($options['class'],null); $text .= ' -
'; +
'; $c=0; foreach($array as $key=>$tab) @@ -896,7 +899,7 @@ class e_form if(!empty($extras['video'])) { - $url .= "&video=1"; + $url .= ($extras['video'] == 2) ? "&video=2" : "&video=1"; } if(!empty($extras['path']) && $extras['path'] == 'plugin') @@ -982,13 +985,13 @@ class e_form if($localonly == true) { $text = ""; - $text .= "Click on the avatar to change it"; + $text .= "Click on the avatar to change it"; } else { $text = ""; $text .= ""; - $text .= ""; + $text .= ""; } $avFiles = e107::getFile()->get_files(e_AVATAR_DEFAULT,".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG"); @@ -1028,9 +1031,9 @@ class e_form if(ADMIN) { - $EAVATAR = "".e_AVATAR_DEFAULT.""; + $EAVATAR = e_AVATAR_DEFAULT; $text .= "
"; - $text .= e107::getParser()->lanVars(LAN_EFORM_006, array('x'=>$EAVATAR)); + $text .= e107::getParser()->lanVars(e107::getParser()->toHTML(LAN_EFORM_006, true), array('x'=>$EAVATAR)); $text .= "
"; } @@ -1105,7 +1108,7 @@ class e_form } -e107::getDebug()->log($sc_parameters); +// e107::getDebug()->log($sc_parameters); $default_thumb = $default; $class = ''; @@ -1181,7 +1184,7 @@ e107::getDebug()->log($sc_parameters); $thpath = empty($default) || !empty($video) ? $default_url : $tp->thumbUrl($default_thumb, $att, true); //isset($sc_parameters['nothumb']) || vartrue($hide) ? - $label = "{$default_url}"; + $label = "{$default_url}"; if($cat != 'news' && $cat !='page' && $cat !='' && strpos($cat,'_image')===false) { @@ -2763,29 +2766,29 @@ e107::getDebug()->log($sc_parameters); switch ($image) { case 'edit': - $icon = "e-edit-32"; + $icon = (e_ADMIN_AREA === true) ? ADMIN_EDIT_ICON : $tp->toIcon("e-edit-32"); $options['class'] = $options['class'] == 'action' ? 'btn btn-default action edit' : $options['class']; break; case 'delete': - $icon = (e_ADMIN_AREA === true) ? "e-delete-32" : 'fa-trash.glyph'; + $icon = (e_ADMIN_AREA === true) ? ADMIN_DELETE_ICON : $tp->toIcon('fa-trash.glyph'); $options['class'] = $options['class'] == 'action' ? 'btn btn-default action delete' : $options['class']; $options['other'] = 'data-confirm="'.LAN_JSCONFIRM.'"'; break; case 'execute': - $icon = "e-execute-32"; + $icon = (e_ADMIN_AREA === true) ? ADMIN_EXECUTE_ICON : $tp->toIcon('fa-power-off.glyph'); $options['class'] = $options['class'] == 'action' ? 'btn btn-default action execute' : $options['class']; break; case 'view': - $icon = "e-view-32"; + $icon = $tp->toIcon("e-view-32"); $options['class'] = $options['class'] == 'action' ? 'btn btn-default action view' : $options['class']; break; } $options['title'] = $title;//shorthand - return ""; + return ""; } @@ -3011,6 +3014,11 @@ e107::getDebug()->log($sc_parameters); return false; } + + + + + /** * Helper function to get default button class by action. * @@ -3877,8 +3885,14 @@ e107::getDebug()->log($sc_parameters); $parms = $attributes['readParms']; } + // @see custom fields in cpage which accept json params. + if(!empty($attributes['writeParms']) && $tmpOpt = e107::getParser()->isJSON($attributes['writeParms'])) + { + $attributes['writeParms'] = $tmpOpt; + unset($tmpOpt); + } + - if(!empty($attributes['inline'])) $parms['editable'] = true; // attribute alias if(!empty($attributes['sort'])) $parms['sort'] = true; // attribute alias @@ -3982,9 +3996,15 @@ e107::getDebug()->log($sc_parameters); break; case 'checkboxes': - $value = $this->checkbox(vartrue($attributes['toggle'], 'multiselect').'['.$id.']', $id); + //$attributes['type'] = 'text'; - return $value; + if(empty($attributes['writeParms'])) // avoid comflicts with a field called 'checkboxes' + { + $value = $this->checkbox(vartrue($attributes['toggle'], 'multiselect').'['.$id.']', $id); + return $value; + } + + break; } @@ -4009,6 +4029,10 @@ e107::getDebug()->log($sc_parameters); // else same break; + case 'country': + $value = $this->getCountry($value); + break; + case 'ip': //$e107 = e107::getInstance(); $value = "".e107::getIPHandler()->ipDecode($value).'';; @@ -4082,7 +4106,7 @@ e107::getDebug()->log($sc_parameters); $opts['multiple'] = true; } - if(vartrue($opts['multiple'])) + if(!empty($opts['multiple'])) { $ret = array(); $value = is_array($value) ? $value : explode(',', $value); @@ -4091,6 +4115,8 @@ e107::getDebug()->log($sc_parameters); if(isset($wparms[$v])) $ret[] = $wparms[$v]; } $value = implode(', ', $ret); + + } else { @@ -4837,10 +4863,14 @@ e107::getDebug()->log($sc_parameters); { $tp = e107::getParser(); - - $parms = vartrue($attributes['writeParms'], array()); + if($tmpOpt = $tp->isJSON($parms)) + { + $parms = $tmpOpt; + unset($tmpOpt); + } + if(is_string($parms)) parse_str($parms, $parms); $ajaxParms = array(); @@ -4850,9 +4880,11 @@ e107::getDebug()->log($sc_parameters); $ajaxParms['data-src'] = varset($parms['ajax']['src']); $ajaxParms['data-target'] = varset($parms['ajax']['target']); $ajaxParms['data-method'] = varset($parms['ajax']['method'], 'html'); - $ajaxParms['data-loading'] = varset($parms['ajax']['loading'], $tp->toGlyph('fa-spinner', array('spin'=>1))); + $ajaxParms['data-loading'] = varset($parms['ajax']['loading'], 'fa-spinner'); //$tp->toGlyph('fa-spinner', array('spin'=>1)) unset($attributes['writeParms']['ajax']); + + // e107::getDebug()->log($parms['ajax']); } if(!empty($attributes['multilan'])) @@ -4932,6 +4964,10 @@ e107::getDebug()->log($sc_parameters); $ret = vartrue($parms['pre']).$this->number($key, $value, $maxlength, $parms).vartrue($parms['post']); break; + case 'country': + $ret = vartrue($parms['pre']).$this->country($key, $value).vartrue($parms['post']); + break; + case 'ip': $ret = vartrue($parms['pre']).$this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms).vartrue($parms['post']); break; @@ -4953,6 +4989,11 @@ e107::getDebug()->log($sc_parameters); case 'password': // encrypts to md5 when saved. $maxlength = vartrue($parms['maxlength'], 255); unset($parms['maxlength']); + if(!isset($parms['required'])) + { + + $parms['required'] = false; + } $ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true break; @@ -5024,9 +5065,17 @@ e107::getDebug()->log($sc_parameters); $ret = vartrue($parms['pre']).$this->bbarea($key, $value, vartrue($parms['template']), vartrue($parms['media']), vartrue($parms['size'], 'medium'),$options ).vartrue($parms['post']); break; + case 'video': case 'image': //TODO - thumb, image list shortcode, js tooltip... $label = varset($parms['label'], 'LAN_EDIT'); unset($parms['label']); + + if($attributes['type'] === 'video') + { + $parms['video'] = 2; // ie. video only. + $parms['w'] = 280; + } + $ret = $this->imagepicker($key, $value, defset($label, $label), $parms); break; @@ -5574,7 +5623,7 @@ e107::getDebug()->log($sc_parameters); ".$this->token()." "; - foreach ($form['fieldsets'] as $elid => $data) //XXX rename 'fieldsets' to 'forms' ? + foreach ($form['fieldsets'] as $elid => $data) { $elid = $form['id'].'-'.$elid; @@ -5593,6 +5642,12 @@ e107::getDebug()->log($sc_parameters); { $active = (strval($tabId) === $curTab) ? 'active' : ''; $text .= '
'; + + // e107::getDebug()->log('elid: '.$elid. " tabid: ".$tabId); + // e107::getDebug()->log($data); + // e107::getDebug()->log($model); + + $text .= $this->renderCreateFieldset($elid, $data, $model, $tabId); $text .= "
"; } @@ -5632,12 +5687,13 @@ e107::getDebug()->log($sc_parameters); * @param string $id field id * @param array $fdata fieldset data * @param object $model - * @return string + * @return string | false */ function renderCreateFieldset($id, $fdata, $model, $tab=0) { - - $text = vartrue($fdata['fieldset_pre'])." + + + $start = vartrue($fdata['fieldset_pre'])."
".vartrue($fdata['legend'])." ".vartrue($fdata['table_pre'])." @@ -5649,6 +5705,8 @@ e107::getDebug()->log($sc_parameters); "; + $text = ''; + // required fields - model definition $model_required = $model->getValidationRules(); $required_help = false; @@ -5770,7 +5828,7 @@ e107::getDebug()->log($sc_parameters); $text .= " "; - $text .= "
".$leftCell."
"; + $text .= (isset($writeParms['nolabel']) && $writeParms['nolabel'] == 2) ? '' : "
".$leftCell."
" ; $text .= $rightCell." @@ -5814,17 +5872,27 @@ e107::getDebug()->log($sc_parameters); $required_help = '
'.$this->getRequiredString().' - required fields
'; //TODO - lans } - $text .= " + + if(!empty($text) || !empty($hidden_fields)) + { + $text = $start.$text; + + $text .= " "; - $text .= implode("\n", $hidden_fields); + $text .= implode("\n", $hidden_fields); + + $text .= "
"; + + $text .= vartrue($fdata['fieldset_post']); + + return $text; + } + - $text .= ""; - - $text .= vartrue($fdata['fieldset_post']); - return $text; + return false; /* $text .= " diff --git a/e107_handlers/js_manager.php b/e107_handlers/js_manager.php index 231ad7a41..e77ba043e 100644 --- a/e107_handlers/js_manager.php +++ b/e107_handlers/js_manager.php @@ -1336,13 +1336,25 @@ class e_jsmanager if('css' === $external) { $path = explode($this->_sep, $path, 4); + + + $media = $path[0]; // support of IE checks $pre = varset($path[2]) ? $path[2]."\n" : ''; $post = varset($path[3]) ? "\n".$path[3] : ''; $path = $path[1]; + + $insertID =''; + if(strpos($path, 'http') !== 0) // local file. { + + if($label === 'Theme CSS') // add an id for local theme stylesheets. + { + $insertID = 'id="stylesheet-'. eHelper::secureIdAttr(str_replace(array('{e_THEME}','.css'),'',$path)).'"' ; + } + if($this->addCache($external,$path) === true) // if cache enabled, then skip and continue. { continue; @@ -1354,7 +1366,8 @@ class e_jsmanager continue; } - echo $pre.''.$post; + + echo $pre.''.$post; echo "\n"; continue; diff --git a/e107_handlers/login.php b/e107_handlers/login.php index 839ca0c33..acc1ccab2 100644 --- a/e107_handlers/login.php +++ b/e107_handlers/login.php @@ -15,7 +15,7 @@ if (!defined('e107_INIT')) { exit; } // require_once(e_HANDLER.'user_handler.php'); //shouldn't be necessary -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_login.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_login.php'); // TODO - class constants define ('LOGIN_TRY_OTHER', 2); // Try some other authentication method diff --git a/e107_handlers/mail.php b/e107_handlers/mail.php index 81fa0835a..180955801 100644 --- a/e107_handlers/mail.php +++ b/e107_handlers/mail.php @@ -787,7 +787,7 @@ class e107Email extends PHPMailer { $size = isset($mediaParms[$nk]) ? "?w=".$mediaParms[$nk]['w'] : ''; //echo $nk.": ".$val['path'].$size."
"; - $eml['shortcodes'][$id] = "
"; + $eml['shortcodes'][$id] = "
"; } } diff --git a/e107_handlers/mail_manager_class.php b/e107_handlers/mail_manager_class.php index 93b4d9030..59a93c0db 100644 --- a/e107_handlers/mail_manager_class.php +++ b/e107_handlers/mail_manager_class.php @@ -97,7 +97,7 @@ Variables relating to DB values all begin 'mail_' - others are internal (volatil if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php'); // May be needed by anything loading this class +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php'); // May be needed by anything loading this class define('MAIL_STATUS_SENT', 0); // Mail sent. Email handler happy, but may have bounced (or may be yet to bounce) define('MAIL_STATUS_BOUNCED', 1); diff --git a/e107_handlers/media_class.php b/e107_handlers/media_class.php index 84a3a77c5..d43fd0309 100644 --- a/e107_handlers/media_class.php +++ b/e107_handlers/media_class.php @@ -37,7 +37,7 @@ class e_media $this->logging = true; } - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_image.php'); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_image.php'); } @@ -1267,7 +1267,7 @@ class e_media if($data['type'] == 'image') { - $text .= ''; + $text .= ''; } elseif($data['type'] == 'glyph') { diff --git a/e107_handlers/menu_class.php b/e107_handlers/menu_class.php index 79feebd60..a74ea5d8e 100644 --- a/e107_handlers/menu_class.php +++ b/e107_handlers/menu_class.php @@ -451,6 +451,8 @@ class e_menu public function renderMenu($mpath, $mname='', $parm = '', $return = false) { // global $sql; // required at the moment. + + global $sc_style, $e107_debug; @@ -540,7 +542,8 @@ class e_menu $id = e107::getForm()->name2id($mpath . $mname); $ns->setUniqueId($id); - global $pref; // possibly used by plugin menu. + + $pref = e107::getPref(); // possibly used by plugin menu. $e107_debug ? include(e_PLUGIN.$mpath.$mname.'.php') : @include(e_PLUGIN.$mpath.$mname.'.php'); diff --git a/e107_handlers/model_class.php b/e107_handlers/model_class.php index 3b98e82f0..2331be6c2 100644 --- a/e107_handlers/model_class.php +++ b/e107_handlers/model_class.php @@ -2659,6 +2659,14 @@ class e_front_model extends e_model return $tp->toDB($value); break; + case 'json': + if(empty($value)) + { + return null; + } + return e107::serialize($value,'json'); + break; + case 'code': return $tp->toDB($value, false, false, 'pReFs'); break; diff --git a/e107_handlers/notify_class.php b/e107_handlers/notify_class.php index 5b14eddac..784384132 100644 --- a/e107_handlers/notify_class.php +++ b/e107_handlers/notify_class.php @@ -23,7 +23,7 @@ class notify function __construct() { - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php'); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php'); if(empty($this->notify_prefs)) { diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 79b4b870a..e8eabb39e 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -277,11 +277,11 @@ class e107plugin foreach($plugVersions as $path=>$version) { $fullPath = e_PLUGIN.$path."/plugin.xml"; - if(is_file(e_PLUGIN.$path."/plugin.xml")) + if(file_exists(e_PLUGIN.$path."/plugin.xml")) { $data = $xml->loadXMLfile($fullPath, true); - if(!in_array($path, $this->core_plugins)) // check non-core plugins for sql file changes. + if(!isset($this->core_plugins[$path])) // check non-core plugins for sql file changes. { $dbv->errors = array(); $dbv->compare($path); @@ -2839,7 +2839,7 @@ class e107plugin { if(empty($dir)) { - return; + return null; } global $sysprefs, $mySQLprefix; @@ -2854,7 +2854,7 @@ class e107plugin if(!is_array($plug)) { - return "'{$id}' is missing from the plugin db table"; + return "'{$dir}' is missing from the plugin db table"; } $_path = e_PLUGIN.$plug['plugin_path'].'/'; diff --git a/e107_handlers/rate_class.php b/e107_handlers/rate_class.php index f58fbc10d..fb6e6092c 100644 --- a/e107_handlers/rate_class.php +++ b/e107_handlers/rate_class.php @@ -11,7 +11,7 @@ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_rate.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_rate.php"); class rater { diff --git a/e107_handlers/shortcode_handler.php b/e107_handlers/shortcode_handler.php index c466106c7..1de80dcdc 100644 --- a/e107_handlers/shortcode_handler.php +++ b/e107_handlers/shortcode_handler.php @@ -107,10 +107,15 @@ class e_parse_shortcode // $_SESSION['editable'] = array(); $this->ignoreCodes = e107::getParser()->getUrlConstants(); // ignore all URL shortcodes. ie. {e_PLUGIN} - $this->loadOverrideShortcodes(); - $this->loadThemeShortcodes(); - $this->loadPluginShortcodes(); - $this->loadPluginSCFiles(); + + if(e_ADMIN_AREA !== true) + { + $this->loadOverrideShortcodes(); + $this->loadThemeShortcodes(); + $this->loadPluginShortcodes(); + $this->loadPluginSCFiles(); + + } //$this->loadCoreShortcodes(); DEPRECATED $editableActivePref = e107::getPref('inline_editing',255); @@ -1310,7 +1315,7 @@ class e_parse_shortcode if (E107_DBG_SC || E107_DBG_TIMEDETAILS) { - $sql->db_Mark_Time("(After SC {$code})"); + // $sql->db_Mark_Time("(After SC {$code})"); } if (($noDebugLog != true) && (E107_DBG_BBSC || E107_DBG_SC || E107_DBG_TIMEDETAILS)) diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index c5449c7a5..6a830d351 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -9,7 +9,7 @@ */ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_sitelinks.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_sitelinks.php'); class sitelinks { @@ -150,12 +150,17 @@ class sitelinks $link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !vartrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE; $render_link[$key] = $this->makeLink($link,'', $style, $css_class); - if(!defined("LINKSRENDERONLYMAIN") && !varset($style['linkmainonly'])) /* if this is defined in theme.php only main links will be rendered */ + if(!defined("LINKSRENDERONLYMAIN") && !isset($style['linkmainonly'])) /* if this is defined in theme.php only main links will be rendered */ { $render_link[$key] .= $this->subLink($main_linkid,$aSubStyle,$css_class); } } - $text .= implode(varset($style['linkseparator']), $render_link); + + if(!empty($style['linkseparator'])) + { + $text .= implode($style['linkseparator'], $render_link); + } + $text .= $style['postlink']; if ($style['linkdisplay'] == 2) { @@ -266,7 +271,7 @@ class sitelinks $tmp = explode('.', $linkInfo['link_name'], 3); $linkInfo['link_name'] = $tmp[2]; } - $indent = ($style['linkdisplay'] != 3) ? varset($style['subindent']) : ""; + $indent = ($style['linkdisplay'] != 3) ? ($style['subindent']) : ""; } // Convert any {e_XXX} to absolute URLs (relative ones sometimes get broken by adding e_HTTP at the front) @@ -316,7 +321,9 @@ class sitelinks $linkstart = (isset($style['linkstart_hilite'])) ? $style['linkstart_hilite'] : ""; $highlighted = TRUE; } - if ($this->hilite(varset($linkInfo['link_url']), varset($style['linkclass_hilite']))== TRUE) + + + if ($this->hilite(varset($linkInfo['link_url']), !empty($style['linkclass_hilite']))) { $linkadd = (isset($style['linkclass_hilite'])) ? " class='".$style['linkclass_hilite']."'" : ""; $highlighted = TRUE; @@ -358,7 +365,7 @@ e107::getDebug()->log($linkInfo['link_url']); // If its a link.. make a link $_link = ""; $_link .= $accessdigit; - if (!empty($href) && ((varset($style['hilite_nolink']) && $highlighted)!=TRUE)) + if (!empty($href) && ((isset($style['hilite_nolink']) && $highlighted)!=TRUE)) { $_link .= "".$tp->toHTML($linkInfo['link_name'],"","emotes_off, defs, no_hook").""; } @@ -1236,27 +1243,24 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; } // $temp = $tmpl['button'.$kpost]; // echo "ap = ".$active_page; // echo " act = ".$act."

"; + + + if($rid == 'adminhome') { $temp = $tmpl['button_other'.$kpost]; } + + if(!empty($e107_vars[$act]['template'])) + { + $tmplateKey = 'button_'.$e107_vars[$act]['template'].$kpost; + $temp = $tmpl[$tmplateKey]; + + // e107::getDebug()->log($tmplateKey); + } - if($rid == 'home') - { - $temp = $tmpl['button_home'.$kpost]; - } - - if($rid == 'language') - { - $temp = $tmpl['button_language'.$kpost]; - } - - if($rid == 'logout') - { - $temp = $tmpl['button_logout'.$kpost]; - } - + $replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']); // valid URLs $replace[1] = str_replace(array('&', '&'), array('&', '&'), vartrue($e107_vars[$act]['link'], "#{$act}")); @@ -1781,6 +1785,26 @@ class navigation_shortcodes extends e_shortcode return $url; } + + + /** + * Returns only the anchor target in the URL if one is found. + * @param null $parm + * @return null|string + */ + function sc_link_target($parm=null) + { + if(strpos($this->var['link_url'],'#')!==false) + { + list($tmp,$segment) = explode('#',$this->var['link_url'],2); + return '#'.$segment; + + } + + return '#'; + } + + function sc_link_open($parm = '') { diff --git a/e107_handlers/theme_handler.php b/e107_handlers/theme_handler.php index e9df4c2b3..91fdfadd2 100644 --- a/e107_handlers/theme_handler.php +++ b/e107_handlers/theme_handler.php @@ -329,7 +329,7 @@ class e_theme $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]); + $vars['thumbnail'] = isset($vars['preview'][0]) ? $vars['preview'][0] : ''; if(!empty($vars['themePrefs'])) @@ -653,7 +653,7 @@ class themeHandler { $key = key($_POST['installplugin']); - include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_plugin.php"); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_plugin.php"); require_once (e_HANDLER."plugin_class.php"); $eplug = new e107plugin; @@ -664,7 +664,7 @@ class themeHandler if(isset($_POST['setMenuPreset'])) { $key = key($_POST['setMenuPreset']); - include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php"); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php"); require_once (e_HANDLER."menumanager_class.php"); $men = new e_menuManager(); $men->curLayout = $key; @@ -1422,7 +1422,7 @@ class themeHandler $text .= "
- \"".$theme['name']."\" + \"".$theme['name']."\"
"; } @@ -2290,7 +2290,7 @@ class themeHandler function showPreview() { - include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php"); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php"); $text = "
".TPVLAN_1.".

"; global $ns; $ns->tablerender(TPVLAN_2, $text); diff --git a/e107_handlers/upload_handler.php b/e107_handlers/upload_handler.php index 936b53926..5735d1582 100644 --- a/e107_handlers/upload_handler.php +++ b/e107_handlers/upload_handler.php @@ -30,7 +30,7 @@ if (!defined('e107_INIT')) exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_upload_handler.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_upload_handler.php'); //define("UH_DEBUG",TRUE); diff --git a/e107_handlers/user_extended_class.php b/e107_handlers/user_extended_class.php index 8488a8b78..a047bb4a4 100644 --- a/e107_handlers/user_extended_class.php +++ b/e107_handlers/user_extended_class.php @@ -50,7 +50,7 @@ class e107_user_extended private $nameIndex = array(); // Array for field name lookup - initialised by constructor public $systemCount = 0; // Count of system fields - always zero ATM public $userCount = 0; // Count of non-system fields - private $fieldPermissions = array(); // Field Permissionss with field name as key. + private $fieldAttributes = array(); // Field Permissionss with field name as key. public function __construct() { @@ -67,20 +67,22 @@ class e107_user_extended define('EUF_CHECKBOX',10); define('EUF_PREFIELD',11); // should be EUF_PREDEFINED, useful when creating fields from e.g. plugin XML define('EUF_ADDON', 12); // defined within e_user.php addon + define('EUF_COUNTRY', 13); // $frm->country() $this->typeArray = array( - 'text' => 1, - 'radio' => 2, - 'dropdown' => 3, - 'db field' => 4, - 'textarea' => 5, - 'integer' => 6, - 'date' => 7, - 'language' => 8, - 'list' => 9, - 'checkbox' => 10, - 'predefined' => 11, // DON'T USE IT IN PREDEFINED FIELD XML!!! Used in plugin installation routine. - 'addon' => 12 + 'text' => EUF_TEXT, + 'radio' => EUF_RADIO, + 'dropdown' => EUF_DROPDOWN, + 'db field' => EUF_DB_FIELD, + 'textarea' => EUF_TEXTAREA, + 'integer' => EUF_INTEGER, + 'date' => EUF_DATE, + 'language' => EUF_LANGUAGE, + 'list' => EUF_PREDEFINED, + 'checkbox' => EUF_CHECKBOX, + 'predefined' => EUF_PREFIELD, // DON'T USE IT IN PREDEFINED FIELD XML!!! Used in plugin installation routine. + 'addon' => EUF_ADDON, + 'country' => EUF_COUNTRY, ); $this->user_extended_types = array( @@ -93,7 +95,8 @@ class e107_user_extended 7 => LAN_DATE, 8 => UE_LAN_8, 9 => UE_LAN_9, - 10=> UE_LAN_10 + 10=> UE_LAN_10, + 13=> UE_LAN_13 // 12=> UE_LAN_10 ); @@ -128,10 +131,16 @@ class e107_user_extended else { // Its a field definition $this->fieldDefinitions[$row['user_extended_struct_id']] = $row; - $id = 'user_'.$row['user_extended_struct_name']; - $this->fieldPermissions[$id] = array('read'=>$row['user_extended_struct_read'], 'write'=>$row['user_extended_struct_write']); - $this->nameIndex['user_'.$row['user_extended_struct_name']] = $row['user_extended_struct_id']; // Create name to ID index - if ($row['user_extended_struct_text'] == '_system_') + $id = 'user_' . $row['user_extended_struct_name']; + + $this->fieldAttributes[$id] = array( + 'read' => $row['user_extended_struct_read'], + 'write' => $row['user_extended_struct_write'], + 'type' => $row['user_extended_struct_type'] + ); + $this->nameIndex['user_' . $row['user_extended_struct_name']] = $row['user_extended_struct_id']; // Create name to ID index + + if($row['user_extended_struct_text'] == '_system_') { $this->systemCount++; } @@ -152,7 +161,7 @@ class e107_user_extended */ public function hasPermission($field, $type='read') { - $class = ($type == 'read') ? $this->fieldPermissions[$field]['read'] : $this->fieldPermissions[$field]['write']; + $class = ($type == 'read') ? $this->fieldAttributes[$field]['read'] : $this->fieldAttributes[$field]['write']; return check_class($class); } @@ -258,24 +267,40 @@ class e107_user_extended function user_extended_validate_entry($val, $params) { $tp = e107::getParser(); - + $parms = explode('^,^', $params['user_extended_struct_parms']); $requiredField = $params['user_extended_struct_required'] == 1; $regex = $tp->toText($parms[1]); $regexfail = $tp->toText($parms[2]); - if (defined($regexfail)) { $regexfail = constant($regexfail); } - if($val == '' && $requiredField) return TRUE; - switch ($type) + if(defined($regexfail)) + { + $regexfail = constant($regexfail); + } + if($val == '' && $requiredField) + { + return true; + } + + $type = $params['user_extended_struct_type']; + + switch($type) { case EUF_DATE : - if ($requiredField && ($val == '0000-00-00')) return TRUE; + if($requiredField && ($val == '0000-00-00')) + { + return true; + } break; } if($regex != "" && $val != "") { - if(!preg_match($regex, $val)) return $regexfail ? $regexfail : TRUE; + if(!preg_match($regex, $val)) + { + return $regexfail ? $regexfail : true; + } } - return FALSE; // Pass by default here + + return false; // Pass by default here } @@ -466,10 +491,35 @@ class e107_user_extended return $ret; } - - + /** + * Get the field-type of a given field-name. + * @param $field + * @return bool|int + */ + public function getFieldType($field) + { + + if(!empty($this->fieldAttributes[$field]['type'])) + { + return (int) $this->fieldAttributes[$field]['type']; + } + + return false; + } + + + /** + * Return a list of all field types. + * @return array + */ + public function getFieldTypes() + { + return $this->user_extended_types; + + } + // Return the field creation text for a definition /** @@ -488,6 +538,10 @@ class e107_user_extended switch ($type) { + case EUF_COUNTRY : + $db_type = 'VARCHAR(2)'; + break; + case EUF_INTEGER : $db_type = 'INT(11)'; break; @@ -529,7 +583,11 @@ class e107_user_extended { $default_text = ''; } + + return $db_type.$default_text; + + } @@ -577,6 +635,7 @@ class e107_user_extended if ($this->user_extended_reserved($name)) { + e107::getMessage()->addDebug("Reserved Field"); return false; } @@ -753,6 +812,12 @@ class e107_user_extended switch($struct['user_extended_struct_type']) { + + case EUF_COUNTRY: + return e107::getForm()->country($fname,$curval); + break; + + case EUF_TEXT : //textbox case EUF_INTEGER : //integer $ret = ""; @@ -921,6 +986,11 @@ class e107_user_extended { $curval = ''; } + + if(THEME_LEGACY === true) + { + return e107::getForm()->text($fname,$curval,10,array('placeholder'=>'yyyy-mm-dd')); + } return e107::getForm()->datepicker($fname,$curval,array('format'=>'yyyy-mm-dd','return'=>'string')); break; @@ -1155,13 +1225,26 @@ class e107_user_extended * @param $type * @return array|string */ - function renderValue($value, $type='') + public function renderValue($value, $type=null) { + //TODO FIXME Add more types. switch($type) { + + case EUF_COUNTRY: + if(!empty($value)) + { + return e107::getForm()->getCountry($value); + } + + return null; + break; + + + case EUF_CHECKBOX: $value = e107::unserialize($value); diff --git a/e107_handlers/user_handler.php b/e107_handlers/user_handler.php index c21ac88f0..7097a530a 100644 --- a/e107_handlers/user_handler.php +++ b/e107_handlers/user_handler.php @@ -46,7 +46,7 @@ define ('PASSWORD_DEFAULT_TYPE',PASSWORD_E107_MD5); //define ('PASSWORD_DEFAULT_TYPE',PASSWORD_E107_SALT); // Required language file - if not loaded elsewhere, uncomment next line -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php'); class UserHandler { diff --git a/e107_handlers/user_select_class.php b/e107_handlers/user_select_class.php index 0e2a8f988..7362309f0 100644 --- a/e107_handlers/user_select_class.php +++ b/e107_handlers/user_select_class.php @@ -15,7 +15,7 @@ /* @DEPRECATED - SUBJECT TO REMOVAL */ // Possible replacements: $frm->userpicker(); -include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php"); class user_select { diff --git a/e107_handlers/userclass_class.php b/e107_handlers/userclass_class.php index b18ab31b4..760dde674 100644 --- a/e107_handlers/userclass_class.php +++ b/e107_handlers/userclass_class.php @@ -21,7 +21,7 @@ if (!defined('e107_INIT')) { exit; } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_userclass.php'); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_userclass.php'); /* diff --git a/e107_languages/English/admin/lan_language.php b/e107_languages/English/admin/lan_language.php index 1786c8eae..a13c8f7b6 100644 --- a/e107_languages/English/admin/lan_language.php +++ b/e107_languages/English/admin/lan_language.php @@ -61,6 +61,8 @@ define("LANG_LAN_141", "Select Script..."); define("LANG_LAN_142", "Auto-Detect"); define("LANG_LAN_143", "Specific LAN file:"); define("LANG_LAN_144", "Must be re-enabled"); + +define("LANG_LAN_148", "Normal Mode"); define("LANG_LAN_149", "Value"); define("LANG_LAN_150", "[b]Search ENTIRE core before commenting out ANY LAN from ANY language file.[/b]"); ?> diff --git a/e107_languages/English/admin/lan_mailout.php b/e107_languages/English/admin/lan_mailout.php index 35121df36..bb7432049 100644 --- a/e107_languages/English/admin/lan_mailout.php +++ b/e107_languages/English/admin/lan_mailout.php @@ -280,7 +280,13 @@ define("LAN_HOLD", "Hold"); define("LAN_MAILOUT_260", "User-Type"); define("LAN_MAILOUT_261", "SMTP Port"); - +define("LAN_MAILOUT_262", "Template Preview"); +define("LAN_MAILOUT_263", "Total Recipients"); +define("LAN_MAILOUT_264", "Embed Media"); +define("LAN_MAILOUT_265", "Pending"); +define("LAN_MAILOUT_266", "Max Active"); +define("LAN_MAILOUT_267", "Generate Public/Private keys"); +define("LAN_MAILOUT_268", "Developer Mode Only"); //define("LAN_SUBMIT", "Do it!"); LAN_RUN -?> \ No newline at end of file +?> diff --git a/e107_languages/English/admin/lan_menus.php b/e107_languages/English/admin/lan_menus.php index 35ea84c60..90a2f8098 100644 --- a/e107_languages/English/admin/lan_menus.php +++ b/e107_languages/English/admin/lan_menus.php @@ -72,5 +72,5 @@ define("MENLAN_54", "Theme Layout"); define("MENLAN_55", "Menu Layout"); define("MENLAN_56", "Custom Pages"); define("MENLAN_57", "Drag-and-Drop Menus"); - +define("MENLAN_58", "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."); ?> diff --git a/e107_languages/English/admin/lan_newspost.php b/e107_languages/English/admin/lan_newspost.php index 3ee443d04..61df9c647 100644 --- a/e107_languages/English/admin/lan_newspost.php +++ b/e107_languages/English/admin/lan_newspost.php @@ -232,4 +232,7 @@ define("LAN_NEWS_105", "Email notification triggered!"); define("LAN_NEWS_106", "News item visibility must include 'everyone' for email notifications to work."); define("LAN_NEWS_107", "Checking for Ping Status"); -?> +//v2.1.4 +define("LAN_NEWS_108", "The SEF URL is unlike the title of your news item."); + +?> \ No newline at end of file diff --git a/e107_languages/English/admin/lan_userclass2.php b/e107_languages/English/admin/lan_userclass2.php index 9401dab04..071b5752d 100644 --- a/e107_languages/English/admin/lan_userclass2.php +++ b/e107_languages/English/admin/lan_userclass2.php @@ -103,10 +103,9 @@ define("UCSLAN_87", "Recently joined users"); define("UCSLAN_88", "Identified search bots"); define("UCSLAN_89", "Checked classes are members of the group"); define("UCSLAN_90", "You can't edit certain system user classes!"); -//define("UCSLAN_91", "");//NOT USED - +define("UCSLAN_91", "Class Structure"); //define("UCSLAN_UPDATE", "Update");//NOT USED ... LAN_UPDATE -?> \ No newline at end of file +?> diff --git a/e107_languages/English/admin/lan_users_extended.php b/e107_languages/English/admin/lan_users_extended.php index 4bf83eb93..eca990a17 100755 --- a/e107_languages/English/admin/lan_users_extended.php +++ b/e107_languages/English/admin/lan_users_extended.php @@ -94,7 +94,13 @@ define("EXTLAN_78", "Cannot find file --FILE-- needed to create data table"); define("EXTLAN_79", "Label"); define("EXTLAN_80", "Validation error - aborted."); - +define("EXTLAN_81", "Add Custom Field"); +define("EXTLAN_82", "Values"); +define("EXTLAN_83", "Placeholder"); +define("EXTLAN_84", "Help Tip"); + +define("EXTLAN_86", "User Extended Column deleted from table"); +define("EXTLAN_87", "Sort values"); //textbox define("EXTLAN_HELP_1", "Parameters:
size - size of field
maxlength - max length of field

class - css class of field
style - css style string

regex - regex validation code
regexfail - validation fail text"); @@ -115,4 +121,4 @@ define("EXTLAN_HELP_8", "Allow user to select from installed languages"); // Predefined list define("EXTLAN_HELP_9", "Specify a predefined list. The value field selects the type of list - at present only 'timezones' is a valid entry"); -?> \ No newline at end of file +?> diff --git a/e107_languages/English/lan_form_handler.php b/e107_languages/English/lan_form_handler.php index 05be8335d..e0f24a70b 100644 --- a/e107_languages/English/lan_form_handler.php +++ b/e107_languages/English/lan_form_handler.php @@ -14,7 +14,7 @@ define("LAN_EFORM_002", "Choose Avatar"); define("LAN_EFORM_003", "OR"); define("LAN_EFORM_004", "Choose this avatar"); define("LAN_EFORM_005", "No Avatars Available"); -define("LAN_EFORM_006", "Admin-Only Notice: The folder [x] is empty. Upload some default avatars images to this folder for users to choose avatars from."); +define("LAN_EFORM_006", "Admin-Only Notice:[br]The folder [b][x][/b] is empty.[br]Upload some default avatars images to this folder for users to choose avatars from."); define("LAN_EFORM_007", "Media Manager"); define("LAN_EFORM_008", "Select columns to display"); define("LAN_EFORM_009", "Display Columns"); @@ -25,3 +25,4 @@ define("LAN_EFORM_013", "go to list"); define("LAN_EFORM_014", "create another"); define("LAN_EFORM_015", "edit current"); define("LAN_EFORM_016", "After submit:"); +?> diff --git a/e107_languages/English/lan_signup.php b/e107_languages/English/lan_signup.php index aa0e447ae..f20fd3e55 100644 --- a/e107_languages/English/lan_signup.php +++ b/e107_languages/English/lan_signup.php @@ -159,4 +159,4 @@ 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"); - +define("LAN_SIGNUP_120", "OR"); diff --git a/e107_languages/English/lan_user_extended.php b/e107_languages/English/lan_user_extended.php index 7b59afecc..00cddfb6b 100644 --- a/e107_languages/English/lan_user_extended.php +++ b/e107_languages/English/lan_user_extended.php @@ -20,6 +20,9 @@ define("UE_LAN_6", "Integer"); define("UE_LAN_8", "Language"); define("UE_LAN_9", "Predefined list"); define("UE_LAN_10", "Checkboxes"); +//v2.1.5 +define("UE_LAN_13", "Country"); + // Leave a gap to allow for more field types define("UE_LAN_21", "Name"); define("UE_LAN_22", "Type"); @@ -44,7 +47,7 @@ define("UE_LAN_BIRTHDAY_DESC", "Birthday"); define("UE_LAN_LANGUAGE", "Language"); define("UE_LAN_LANGUAGE_DESC", "User Language"); define("UE_LAN_COUNTRY", "Country"); -define("UE_LAN_COUNTRY_DESC", "User Country (includes db table)"); +define("UE_LAN_COUNTRY_DESC", "User Country"); define("UE_LAN_TIMEZONE", "Timezone"); define("UE_LAN_TIMEZONE_DESC", "User Timezone (from predefined list)"); diff --git a/e107_plugins/alt_auth/alt_auth_conf.php b/e107_plugins/alt_auth/alt_auth_conf.php index 2361df210..8598accbb 100755 --- a/e107_plugins/alt_auth/alt_auth_conf.php +++ b/e107_plugins/alt_auth/alt_auth_conf.php @@ -37,7 +37,7 @@ if(!getperms('P') || !e107::isInstalled('alt_auth')) require_once(e_HANDLER.'form_handler.php'); $frm = e107::getForm(); require_once(e_ADMIN.'auth.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define('ALT_AUTH_ACTION', 'main'); require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); require_once(e_HANDLER.'user_extended_class.php'); @@ -178,7 +178,7 @@ $ns->tablerender(LAN_ALT_3, $text); if ($euf->userCount) { - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user_extended.php'); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user_extended.php'); $fl = &$euf->fieldDefinitions; $text = "
diff --git a/e107_plugins/alt_auth/e107db_conf.php b/e107_plugins/alt_auth/e107db_conf.php index 12462d581..e612bc567 100644 --- a/e107_plugins/alt_auth/e107db_conf.php +++ b/e107_plugins/alt_auth/e107db_conf.php @@ -23,8 +23,8 @@ $eplug_admin = true; require_once('../../class2.php'); require_once(e_ADMIN.'auth.php'); require_once(e_HANDLER.'form_handler.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_e107db_conf.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_e107db_conf.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define('ALT_AUTH_ACTION', 'e107db'); require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); require_once(e_PLUGIN.'alt_auth/extended_password_handler.php'); diff --git a/e107_plugins/alt_auth/e_help.php b/e107_plugins/alt_auth/e_help.php index 13ad6a423..cf43e1b34 100644 --- a/e107_plugins/alt_auth/e_help.php +++ b/e107_plugins/alt_auth/e_help.php @@ -28,13 +28,13 @@ define('ALT_AUTH_PATH', e_PLUGIN.'alt_auth/'); if (e_PAGE == 'alt_auth_conf.php') { - include_lan(ALT_AUTH_PATH.'languages/'.e_LANGUAGE.'/admin_alt_auth.php'); + e107::includeLan(ALT_AUTH_PATH.'languages/'.e_LANGUAGE.'/admin_alt_auth.php'); $ns -> tablerender('help',LAN_ALT_AUTH_HELP); } else { - include_lan(ALT_AUTH_PATH.'languages/'.e_LANGUAGE.'/admin_'.e_PAGE); - if (!defined('LAN_ALT_VALIDATE_HELP')) include_lan(ALT_AUTH_PATH.'languages/'.e_LANGUAGE.'/admin_alt_auth.php'); + e107::includeLan(ALT_AUTH_PATH.'languages/'.e_LANGUAGE.'/admin_'.e_PAGE); + if (!defined('LAN_ALT_VALIDATE_HELP')) e107::includeLan(ALT_AUTH_PATH.'languages/'.e_LANGUAGE.'/admin_alt_auth.php'); $ns -> tablerender('help',LAN_AUTHENTICATE_HELP.'

'.(defined('SHOW_COPY_HELP') ? LAN_ALT_COPY_HELP : '').(defined('SHOW_CONVERSION_HELP') ? LAN_ALT_CONVERSION_HELP : '').LAN_ALT_VALIDATE_HELP); } diff --git a/e107_plugins/alt_auth/importdb_conf.php b/e107_plugins/alt_auth/importdb_conf.php index c4c7a7c2e..d9350e2ff 100644 --- a/e107_plugins/alt_auth/importdb_conf.php +++ b/e107_plugins/alt_auth/importdb_conf.php @@ -25,8 +25,8 @@ $eplug_admin = true; require_once('../../class2.php'); require_once(e_ADMIN.'auth.php'); require_once(e_HANDLER.'form_handler.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_importdb_conf.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_importdb_conf.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define('ALT_AUTH_ACTION', 'importdb'); require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); require_once(e_PLUGIN.'alt_auth/extended_password_handler.php'); diff --git a/e107_plugins/alt_auth/ldap_conf.php b/e107_plugins/alt_auth/ldap_conf.php index 2dbd4dd63..9ee37f13e 100755 --- a/e107_plugins/alt_auth/ldap_conf.php +++ b/e107_plugins/alt_auth/ldap_conf.php @@ -24,8 +24,8 @@ $eplug_admin = true; require_once('../../class2.php'); require_once(e_ADMIN.'auth.php'); require_once(e_HANDLER.'form_handler.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_ldap_conf.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_ldap_conf.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define('ALT_AUTH_ACTION', 'ldap'); require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); diff --git a/e107_plugins/alt_auth/otherdb_conf.php b/e107_plugins/alt_auth/otherdb_conf.php index 50738ee38..93c2c757a 100644 --- a/e107_plugins/alt_auth/otherdb_conf.php +++ b/e107_plugins/alt_auth/otherdb_conf.php @@ -24,8 +24,8 @@ $eplug_admin = true; require_once('../../class2.php'); require_once(e_ADMIN.'auth.php'); require_once(e_HANDLER.'form_handler.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_otherdb_conf.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_otherdb_conf.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define('ALT_AUTH_ACTION', 'otherdb'); require_once(e_PLUGIN.'alt_auth/alt_auth_adminmenu.php'); require_once(e_PLUGIN.'alt_auth/extended_password_handler.php'); diff --git a/e107_plugins/alt_auth/radius_conf.php b/e107_plugins/alt_auth/radius_conf.php index 5cb57fabb..e735dbe58 100644 --- a/e107_plugins/alt_auth/radius_conf.php +++ b/e107_plugins/alt_auth/radius_conf.php @@ -20,8 +20,8 @@ $eplug_admin = true; require_once("../../class2.php"); require_once(e_ADMIN."auth.php"); require_once(e_HANDLER."form_handler.php"); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_radius_conf.php'); -include_lan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_radius_conf.php'); +e107::includeLan(e_PLUGIN.'alt_auth/languages/'.e_LANGUAGE.'/admin_alt_auth.php'); define("ALT_AUTH_ACTION", "radius"); require_once(e_PLUGIN."alt_auth/alt_auth_adminmenu.php"); $mes = e107::getMessage(); diff --git a/e107_plugins/banner/e_help.php b/e107_plugins/banner/e_help.php index 920a17e0f..aef545643 100644 --- a/e107_plugins/banner/e_help.php +++ b/e107_plugins/banner/e_help.php @@ -15,7 +15,7 @@ if (!e107::isInstalled('banner')) return; } -include_lan(e_PLUGIN.'banner/languages/'.e_LANGUAGE.'admin_banner.php'); +e107::includeLan(e_PLUGIN.'banner/languages/'.e_LANGUAGE.'admin_banner.php'); $ns->tablerender(BNRLAN_HELP_01, BNRLAN_HELP_02); ?> diff --git a/e107_plugins/banner/e_shortcode.php b/e107_plugins/banner/e_shortcode.php index 5ad7ba6ee..8ba84db87 100644 --- a/e107_plugins/banner/e_shortcode.php +++ b/e107_plugins/banner/e_shortcode.php @@ -83,7 +83,7 @@ class banner_shortcodes extends e_shortcode default: - $class = empty($parm['class']) ? "e-banner img-responsive" : $parm['class']; + $class = empty($parm['class']) ? "e-banner img-responsive img-fluid" : $parm['class']; $ban_ret = $tp->toImage($row['banner_image'], array('class'=> $class , 'alt'=>basename($row['banner_image']), 'legacy'=>'{e_IMAGE}banners')); break; diff --git a/e107_plugins/blogcalendar_menu/archive.php b/e107_plugins/blogcalendar_menu/archive.php index fc7de5d93..9c96b7aeb 100644 --- a/e107_plugins/blogcalendar_menu/archive.php +++ b/e107_plugins/blogcalendar_menu/archive.php @@ -20,7 +20,7 @@ require_once("../../class2.php"); require_once(e_HANDLER."userclass_class.php"); -include_lan(e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php"); +e107::includeLan(e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php"); require_once("calendar.php"); require_once("functions.php"); require_once(HEADERF); diff --git a/e107_plugins/blogcalendar_menu/config.php b/e107_plugins/blogcalendar_menu/config.php index 21e9ed25a..c9a829681 100644 --- a/e107_plugins/blogcalendar_menu/config.php +++ b/e107_plugins/blogcalendar_menu/config.php @@ -13,7 +13,7 @@ $eplug_admin = TRUE; require_once("../../class2.php"); require_once(e_HANDLER."userclass_class.php"); -include_lan(e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php"); +e107::includeLan(e_PLUGIN."blogcalendar_menu/languages/".e_LANGUAGE.".php"); if (!getperms("1")) { e107::redirect('admin'); diff --git a/e107_plugins/clock_menu/config.php b/e107_plugins/clock_menu/config.php index ba2302f6c..f56718880 100644 --- a/e107_plugins/clock_menu/config.php +++ b/e107_plugins/clock_menu/config.php @@ -19,7 +19,7 @@ if (!getperms('1')) exit ; } require_once(e_ADMIN.'auth.php'); -include_lan(e_PLUGIN.'clock_menu/languages/admin/'.e_LANGUAGE.'.php'); +e107::includeLan(e_PLUGIN.'clock_menu/languages/admin/'.e_LANGUAGE.'.php'); $frm = e107::getForm(); $mes = e107::getMessage(); diff --git a/e107_plugins/comment_menu/config.php b/e107_plugins/comment_menu/config.php index 71f5fa1f3..730b5b13b 100644 --- a/e107_plugins/comment_menu/config.php +++ b/e107_plugins/comment_menu/config.php @@ -14,7 +14,7 @@ $eplug_admin = TRUE; require_once("../../class2.php"); require_once(e_HANDLER."userclass_class.php"); -include_lan(e_PLUGIN."comment_menu/languages/".e_LANGUAGE.".php"); +e107::includeLan(e_PLUGIN."comment_menu/languages/".e_LANGUAGE.".php"); if (!getperms("1")) { e107::redirect('admin'); diff --git a/e107_plugins/download/download_shortcodes.php b/e107_plugins/download/download_shortcodes.php index e2f617788..046ff63e8 100644 --- a/e107_plugins/download/download_shortcodes.php +++ b/e107_plugins/download/download_shortcodes.php @@ -327,7 +327,7 @@ class download_shortcodes extends e_shortcode { $opts = array( 'legacy' => "{e_FILE}downloadthumbs/", - 'class' => 'download-image img-responsive', + 'class' => 'download-image img-responsive img-fluid', 'alt' => $this->var['download_name'] ); @@ -583,7 +583,7 @@ class download_shortcodes extends e_shortcode { $opts = array( 'legacy' => "{e_FILE}downloadthumbs/", - 'class' => 'download-image dl_image img-responsive' + 'class' => 'download-image dl_image img-responsive img-fluid' ); $image = $tp->toImage($this->var['download_thumb'], $opts); @@ -610,7 +610,7 @@ class download_shortcodes extends e_shortcode $opts = array( 'legacy' => "{e_FILE}downloadimages/", - 'class' => 'download-image dl_image download-view-image img-responsive '.vartrue($parm['class']), + 'class' => 'download-image dl_image download-view-image img-responsive img-fluid '.vartrue($parm['class']), 'alt' => basename($this->var['download_image']) ); diff --git a/e107_plugins/download/includes/admin.php b/e107_plugins/download/includes/admin.php index b2a0d6c0e..3df003148 100644 --- a/e107_plugins/download/includes/admin.php +++ b/e107_plugins/download/includes/admin.php @@ -56,13 +56,13 @@ class plugin_download_admin extends e_admin_dispatcher * @var array */ protected $adminMenu = array( - 'main/list' => array('caption'=> 'Manage', 'perm' => 'P'), + 'main/list' => array('caption'=> LAN_MANAGE, 'perm' => 'P'), 'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'P'), 'other0' => array('divider'=> true), 'cat/list' => array('caption'=> LAN_CATEGORIES, 'perm'=>'P'), - 'cat/create' => array('caption'=> "Create Category", 'perm' => 'Q'), + 'cat/create' => array('caption'=> LAN_CREATE_CATEGORY, 'perm' => 'Q'), 'other1' => array('divider'=> true), @@ -144,7 +144,7 @@ class download_cat_ui extends e_admin_ui 'download_category_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'inline' => true, 'width' => 'auto', 'thclass' => 'left', 'writeParms'=>'size=xxlarge'), 'download_category_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name - 'download_category_parent' => array('title'=> 'Parent', 'type' => 'method', 'width' => '5%', 'batch' => TRUE, 'filter'=>TRUE), + 'download_category_parent' => array('title'=> LAN_PARENT, 'type' => 'method', 'width' => '5%', 'batch' => TRUE, 'filter'=>TRUE), 'download_category_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'inline' => true, 'width' => 'auto', 'data' => 'int', 'batch' => TRUE, 'filter'=>TRUE), 'download_category_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=>'int', 'width' => '5%', 'thclass' => 'right', 'class'=> 'right' ), 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'center') @@ -2389,7 +2389,7 @@ class download_main_admin_form_ui extends e_admin_form_ui class download_mirror_ui extends e_admin_ui { - protected $pluginTitle = 'Downloads'; + protected $pluginTitle = LAN_PLUGIN_DOWNLOAD_NAME; protected $pluginName = 'download'; protected $table = 'download_mirror'; protected $pid = 'mirror_id'; @@ -2409,10 +2409,10 @@ class download_mirror_ui extends e_admin_ui 'mirror_name' => array ( 'title' => LAN_TITLE, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'mirror_url' => array ( 'title' => LAN_URL, 'type' => 'url', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'mirror_image' => array ( 'title' => LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'mirror_location' => array ( 'title' => 'Location', 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'mirror_location' => array ( 'title' => DOWLAN_141, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), 'mirror_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'bbarea', 'data' => 'str', 'width' => '40%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), 'mirror_count' => array ( 'title' => 'Count', 'type' => 'hidden', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'options' => array ( 'title' => 'Options', 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ), + 'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ), ); protected $fieldpref = array('mirror_name', 'mirror_url', 'mirror_image', 'mirror_location'); diff --git a/e107_plugins/download/languages/English/English_admin.php b/e107_plugins/download/languages/English/English_admin.php index 585db81c6..6262b1f4d 100644 --- a/e107_plugins/download/languages/English/English_admin.php +++ b/e107_plugins/download/languages/English/English_admin.php @@ -50,6 +50,7 @@ define("DOWLAN_25", "Submit Download"); // define("DOWLAN_26", "Uploads enabled?"); define("DOWLAN_27", "Download"); define("DOWLAN_28", "None"); +define("DOWLAN_29", "Requested"); define("DOWLAN_31", "Categories"); define("DOWLAN_32", "Downloads"); define("DOWLAN_33", "Are you sure you want to delete this download?"); //FIXME Use Generic @@ -229,4 +230,4 @@ define("DOWLAN_HELP_10", "Help for upload options"); // define("DOWLAN_INSTALL_DONE", "Your download plugin is now installed"); // define("DOWLAN_DESCRIPTION", "This plugin is a fully featured Download system"); // define("DOWLAN_CAPTION", "Configure Download"); -?> \ No newline at end of file +?> diff --git a/e107_plugins/download/request.php b/e107_plugins/download/request.php index d739d0e79..979731318 100644 --- a/e107_plugins/download/request.php +++ b/e107_plugins/download/request.php @@ -321,16 +321,16 @@ else 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 = "
"; + $disp = "
"; } $disp .= "
"; diff --git a/e107_plugins/featurebox/includes/item.php b/e107_plugins/featurebox/includes/item.php index 2d6b2b35a..74d31fef8 100644 --- a/e107_plugins/featurebox/includes/item.php +++ b/e107_plugins/featurebox/includes/item.php @@ -156,7 +156,7 @@ class plugin_featurebox_item extends e_model { return $src; } - $tag = ''.$tp->toAttribute($this->get('fb_title')).''; + $tag = ''.$tp->toAttribute($this->get('fb_title')).''; if(isset($parm['nourl']) || !$this->get('fb_imageurl')) { return $tag; diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index a98a3acab..14ee26b94 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -18,10 +18,7 @@ if (!defined('e107_INIT')) { exit; } e107::js('forum', 'js/forum.js', 'jquery', 5); e107::css('forum','forum.css'); - -e107::lan('forum','English_front'); - - +e107::lan('forum', "front", true); // include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum.php'); if(!defined('IMAGE_new') && !defined('IMAGE_e')) diff --git a/e107_plugins/forum/forum_mod.php b/e107_plugins/forum/forum_mod.php index 158fb0284..3b70547de 100644 --- a/e107_plugins/forum/forum_mod.php +++ b/e107_plugins/forum/forum_mod.php @@ -9,7 +9,7 @@ */ if (!defined('e107_INIT')) { exit(); } -include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php'); +e107::includeLan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_admin.php'); function forum_thread_moderate($p) { diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php index 3711c2482..03b00577b 100644 --- a/e107_plugins/forum/forum_post.php +++ b/e107_plugins/forum/forum_post.php @@ -1228,7 +1228,7 @@ class forum_post_handler if($postResult === -1 || $newPostId === -1) //Duplicate post { require_once(HEADERF); - $message = LAN_FORUM_3006."
Return"; + $message = LAN_FORUM_3006."
".LAN_FORUM_8028.""; $text = e107::getMessage()->addError($message)->render(); e107::getRender()->tablerender(LAN_PLUGIN_FORUM_NAME, $text); // change to forum-title pref. require_once(FOOTERF); @@ -1282,7 +1282,7 @@ class forum_post_handler $txt = e107::getParser()->parseTemplate($txt,true, $SHORTCODES); - e107::getRender()->tablerender('Forums', e107::getMessage()->render().$txt); + e107::getRender()->tablerender(e_PAGETITLE, e107::getMessage()->render().$txt); require_once(FOOTERF); exit; } diff --git a/e107_plugins/forum/languages/English/English_front.php b/e107_plugins/forum/languages/English/English_front.php index 5c63053ef..8e0247810 100644 --- a/e107_plugins/forum/languages/English/English_front.php +++ b/e107_plugins/forum/languages/English/English_front.php @@ -343,6 +343,8 @@ define("LAN_FORUM_8024", "Failed to open thread"); define("LAN_FORUM_8025", "Failed to stick thread"); define("LAN_FORUM_8026", "Failed to unstick thread"); define("LAN_FORUM_8027", "No action selected"); +define("LAN_FORUM_8028", "Return"); +define("LAN_FORUM_8029", "New topic created!"); /* THIS WILL BE DELETED ONCE THE REWRITE IS DONE ================================================== diff --git a/e107_plugins/forum/newforumposts_menu.php b/e107_plugins/forum/newforumposts_menu.php index 8fa1a1bbd..8e9c27a46 100755 --- a/e107_plugins/forum/newforumposts_menu.php +++ b/e107_plugins/forum/newforumposts_menu.php @@ -75,6 +75,12 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php) if($results = $sql->gen($qry)) { + + if($tp->thumbWidth() > 250) // Fix for unset image size. + { + $tp->setThumbSize(40,40,true); + } + $list = "
    "; while($row = $sql->fetch()) diff --git a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php index e53d92506..e2238ee55 100644 --- a/e107_plugins/forum/shortcodes/batch/post_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/post_shortcodes.php @@ -434,6 +434,29 @@ class plugin_forum_post_shortcodes extends e_shortcode return $_tmp['breadcrumb']; } + function sc_forum_post_caption() + { +// global $forumInfo; + $tp = e107::getParser(); +// var_dump ($this); +//$this->forumObj->threadGet($this->id, false) + if ($this->var['action'] == "rp") + { + $pre = LAN_FORUM_1003; + $name = $tp->toHTML($this->var['thread_name'], false, 'no_hook, emotes_off'); + $url = e107::url('forum', 'topic', $this->var); + $post = LAN_FORUM_2006; + } + if ($this->var['action'] == "nt") + { + $pre = LAN_FORUM_1001; + $name = $tp->toHTML($this->var['forum_name'], false, 'no_hook, emotes_off'); + $url = e107::url('forum', 'forum', $this->var); + $post = LAN_FORUM_2005; + } + return $pre.($url?": {$name} - ":$name).$post; + } + function sc_noemotes() { if(vartrue($eaction) == true) { return null; } diff --git a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php index dc9dd0742..d141435cf 100644 --- a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php @@ -802,7 +802,13 @@ } - function sc_threadname() + /** + * + * @outdated use {TOPIC_TITLE} or {TOPIC_URL} + * @param null $parm + * @return string + */ + function sc_threadname($parm=null) { global $menu_pref, $forum; $tp = e107::getParser(); @@ -845,9 +851,43 @@ $this->addVars($temp); $url = e107::url('forum', 'topic', $this->var); + + if($parm === 'url') + { + return $url; + } + + if($parm === 'title') + { + return $thread_name; + } + + return "{$thread_name}"; } + //v2.1.4 + function sc_topic_title($parm=null) + { + return $this->sc_threadname('title'); + } + + //v2.1.4 + function sc_topic_url($parm=null) + { + return $this->sc_threadname('url'); + } + + //v2.1.4 + function sc_topic_date($parm=null) + { + return $this->sc_threaddate(); + } + + + //@todo more topic_xxxx shortcode aliases. + + function sc_pages() { diff --git a/e107_plugins/forum/templates/forum_post_template.php b/e107_plugins/forum/templates/forum_post_template.php index 86361230a..faf8c055d 100644 --- a/e107_plugins/forum/templates/forum_post_template.php +++ b/e107_plugins/forum/templates/forum_post_template.php @@ -12,7 +12,7 @@ if (!defined('e107_INIT')) { exit; } // New in v2.x - requires a bootstrap theme be loaded. -//$FORUM_POST_TEMPLATE['caption'] = "Custom caption"; +//$FORUM_POST_TEMPLATE['caption'] = "{FORUM_POST_CAPTION}"; $FORUM_POST_TEMPLATE['form'] = " {FORUM_POST_FORM_START}
    diff --git a/e107_plugins/forum/templates/forum_posted_template.php b/e107_plugins/forum/templates/forum_posted_template.php index 4763c727d..c8d7b74a2 100644 --- a/e107_plugins/forum/templates/forum_posted_template.php +++ b/e107_plugins/forum/templates/forum_posted_template.php @@ -66,13 +66,13 @@ $FORUMREPLYPOSTED = " $FORUM_POSTED_TEMPLATE['poll'] = $FORUMPOLLPOSTED; $FORUM_POSTED_TEMPLATE['thread'] = "
    -

    New topic created.

    +

    ".LAN_FORUM_8029."

    ".LAN_FORUM_3048." ".LAN_FORUM_2022."
    "; $FORUM_POSTED_TEMPLATE['reply'] = "
    -

    New reply created.

    +

    ".LAN_FORUM_3049."

    ".LAN_FORUM_3048." ".LAN_FORUM_2022."
    "; @@ -82,4 +82,4 @@ $FORUM_POSTED_TEMPLATE['reply'] = "
    -?> \ No newline at end of file +?> diff --git a/e107_plugins/gallery/e_shortcode.php b/e107_plugins/gallery/e_shortcode.php index 5bffb88bc..d52119e24 100644 --- a/e107_plugins/gallery/e_shortcode.php +++ b/e107_plugins/gallery/e_shortcode.php @@ -103,7 +103,7 @@ class gallery_shortcodes extends e_shortcode $w = vartrue($parms['w']) ? $parms['w'] : $tp->thumbWidth(); // 190; // 160; $h = vartrue($parms['h']) ? $parms['h'] : $tp->thumbHeight(); // 130; - $class = ($this->slideMode == true) ? 'gallery-slideshow-thumb img-responsive img-rounded' : varset($parms['class'], 'gallery-thumb img-responsive'); + $class = ($this->slideMode == true) ? 'gallery-slideshow-thumb img-responsive img-fluid img-rounded rounded' : varset($parms['class'], 'gallery-thumb img-responsive img-fluid'); $rel = ($this->slideMode == true) ? 'prettyPhoto[pp_gal]' : 'prettyPhoto[pp_gal]'; //$att = array('aw'=>$w, 'ah'=>$h, 'x'=>1, 'crop'=>1); @@ -186,7 +186,7 @@ class gallery_shortcodes extends e_shortcode } $text = ""; - $text .= ""; + $text .= ""; $text .= ""; return $text; } @@ -263,7 +263,7 @@ class gallery_shortcodes extends e_shortcode if(empty($template['item'])) { - $text .= $ns->tablerender('', $this->sc_gallery_thumb('class=gallery_thumb img-responsive img-home-portfolio'), 'gallery_portfolio', true); + $text .= $ns->tablerender('', $this->sc_gallery_thumb('class=gallery_thumb img-responsive img-fluid img-home-portfolio'), 'gallery_portfolio', true); } else { diff --git a/e107_plugins/list_new/list_class.php b/e107_plugins/list_new/list_class.php index f23c436fd..2740d62f8 100644 --- a/e107_plugins/list_new/list_class.php +++ b/e107_plugins/list_new/list_class.php @@ -49,7 +49,7 @@ class listclass $this->e107 = e107::getInstance(); //language - include_lan($this->plugin_dir."languages/".e_LANGUAGE.".php"); + e107::includeLan($this->plugin_dir."languages/".e_LANGUAGE.".php"); //template if (is_readable(THEME."list_template.php")) diff --git a/e107_plugins/log/admin_config.php b/e107_plugins/log/admin_config.php index 1072ad67d..3a5e845be 100644 --- a/e107_plugins/log/admin_config.php +++ b/e107_plugins/log/admin_config.php @@ -88,8 +88,8 @@ if(e_AJAX_REQUEST && varset($_GET['action']) == 'rebuild') define('LogFlagFile', 'LogFlag.php'); -include_lan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'.php'); -include_lan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'_admin.php'); +e107::includeLan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'.php'); +e107::includeLan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'_admin.php'); if(!is_writable(e_LOG)) { diff --git a/e107_plugins/log/e_help.php b/e107_plugins/log/e_help.php index 62c9f7f1b..fd4d468d1 100644 --- a/e107_plugins/log/e_help.php +++ b/e107_plugins/log/e_help.php @@ -23,7 +23,7 @@ if (!defined('e107_INIT')) { exit; } -include_lan(e_PLUGIN.'log/languages/'.e_LANGUAGE."_log_help.php"); +e107::includeLan(e_PLUGIN.'log/languages/'.e_LANGUAGE."_log_help.php"); if (e_QUERY) list($action,$junk) = explode('.',e_QUERY); else $action = 'list'; diff --git a/e107_plugins/log/stats_csv.php b/e107_plugins/log/stats_csv.php index fb2ffd332..7198328b8 100644 --- a/e107_plugins/log/stats_csv.php +++ b/e107_plugins/log/stats_csv.php @@ -37,7 +37,7 @@ if (($action != 'export') || $params) exit; } -include_lan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'_admin_log.php'); // LANs may be needed for error messages +e107::includeLan(e_PLUGIN.'log/languages/'.e_LANGUAGE.'_admin_log.php'); // LANs may be needed for error messages // List of the non-page-based info which is gathered - historically only 'all-time' stats, now we support monthly as well. (Here, only keys are used for validation) diff --git a/e107_plugins/login_menu/config.php b/e107_plugins/login_menu/config.php index 12a600ed4..c92a78e7d 100644 --- a/e107_plugins/login_menu/config.php +++ b/e107_plugins/login_menu/config.php @@ -32,7 +32,7 @@ if (!getperms('4')) exit() ; } -include_lan(e_PLUGIN.'login_menu/languages/'.e_LANGUAGE.'.php'); +e107::includeLan(e_PLUGIN.'login_menu/languages/'.e_LANGUAGE.'.php'); require_once(e_ADMIN.'auth.php'); require_once(e_PLUGIN.'login_menu/login_menu_class.php'); diff --git a/e107_plugins/metaweblog/admin_config.php b/e107_plugins/metaweblog/admin_config.php index fb42f7d5f..5288248a6 100644 --- a/e107_plugins/metaweblog/admin_config.php +++ b/e107_plugins/metaweblog/admin_config.php @@ -12,7 +12,7 @@ require_once("../../class2.php"); if(!getperms("P")){ e107::redirect('admin');exit; } -include_lan(e_PLUGIN."metaweblog/languages/".e_LANGUAGE.".php"); +e107::includeLan(e_PLUGIN."metaweblog/languages/".e_LANGUAGE.".php"); require_once(e_ADMIN."auth.php"); $text = "
    ".XMLRPC_HELP_011."
    "; diff --git a/e107_plugins/metaweblog/e_help.php b/e107_plugins/metaweblog/e_help.php index fcd0d274e..4116d8cc8 100644 --- a/e107_plugins/metaweblog/e_help.php +++ b/e107_plugins/metaweblog/e_help.php @@ -3,7 +3,7 @@ // BEGIN CONFIGURATION AREA //--------------------------------------------------------------- if (!defined('e107_INIT')){ exit; } -include_lan(e_PLUGIN."metaweblog/languages/".e_LANGUAGE.".php"); +e107::includeLan(e_PLUGIN."metaweblog/languages/".e_LANGUAGE.".php"); $helptitle = XMLRPC_HELP_001; // diff --git a/e107_plugins/newforumposts_main/admin_config.php b/e107_plugins/newforumposts_main/admin_config.php index 5d8102f18..ea3d7e948 100644 --- a/e107_plugins/newforumposts_main/admin_config.php +++ b/e107_plugins/newforumposts_main/admin_config.php @@ -17,7 +17,7 @@ if(!getperms('1')) require_once (e_HANDLER.'userclass_class.php'); -include_lan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php'); +e107::includeLan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php'); require_once (e_ADMIN.'auth.php'); $frm = e107::getForm(); diff --git a/e107_plugins/newforumposts_main/newforumposts_main.php b/e107_plugins/newforumposts_main/newforumposts_main.php index ec553e765..955436f7d 100644 --- a/e107_plugins/newforumposts_main/newforumposts_main.php +++ b/e107_plugins/newforumposts_main/newforumposts_main.php @@ -18,7 +18,7 @@ if(!defined('e107_INIT')) { exit();} require_once (e_HANDLER.'userclass_class.php'); $query = ($pref['nfp_posts'] ? 'thread_lastpost' : 'thread_datestamp'); -include_lan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php'); +e107::includeLan(e_PLUGIN.'newforumposts_main/languages/'.e_LANGUAGE.'.php'); $path = e_PLUGIN.'forum/'; global $sql, $ns; diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php index cd7a4970c..6eccc4f47 100644 --- a/e107_plugins/news/news.php +++ b/e107_plugins/news/news.php @@ -40,8 +40,8 @@ class news_front { global $NEWSHEADER; - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_news.php'); // Temporary + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); + e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_news.php'); // Temporary $this->pref = e107::getPref(); diff --git a/e107_plugins/news/news_carousel_menu.php b/e107_plugins/news/news_carousel_menu.php index 4d4fd4a63..b25bc41e4 100644 --- a/e107_plugins/news/news_carousel_menu.php +++ b/e107_plugins/news/news_carousel_menu.php @@ -59,8 +59,13 @@ $query .= " ORDER BY n.news_sticky DESC, n.news_datestamp DESC LIMIT ".$limit; + + + $data = $sql->retrieve($query,true); + + if(empty($data)) { e107::getMessage()->addDebug( "No News items found with 'carousel' as the template ")->render(); @@ -73,7 +78,7 @@ $count = 0; $sc = e107::getScBatch('news'); $text = ''; - +$nav = array(); foreach($data as $row) { diff --git a/e107_plugins/news/news_months_menu.php b/e107_plugins/news/news_months_menu.php index 80a90444a..c75043f0c 100644 --- a/e107_plugins/news/news_months_menu.php +++ b/e107_plugins/news/news_months_menu.php @@ -122,9 +122,18 @@ if(false === $cached) $menu_text[] = $tp->simpleParse($template['item'], $vars); } $cached = $template['start'].implode(varset($template['separator'],''), $menu_text).$template['end']; + + $ns->setContent('text', $cached); + if($cached) { - if(!$parms['showarchive']) $cached .= ''; + if(!$parms['showarchive']) + { + $footer = ''; + $ns->setContent('footer', $footer); + $cached .= $footer; + + } $cached = $ns->tablerender(BLOGCAL_L1." ".$req_year, $cached, 'news_months_menu', true); } e107::getCache()->set($cString, $cached); diff --git a/e107_plugins/news/templates/news_menu_template.php b/e107_plugins/news/templates/news_menu_template.php index 5a78e3a0a..853733492 100644 --- a/e107_plugins/news/templates/news_menu_template.php +++ b/e107_plugins/news/templates/news_menu_template.php @@ -124,7 +124,7 @@ $NEWS_MENU_TEMPLATE['carousel']['end'] = ' $NEWS_MENU_TEMPLATE['carousel']['item'] = '
    {SETIMAGE: w=800&h=370&crop=1} - {NEWS_IMAGE: class=img-responsive} + {NEWS_IMAGE: class=img-responsive img-fluid} '; + + ### Additional control over image thumbnailing is possible via SETIMAGE e.g. {SETIMAGE: w=200&h=150&crop=1} + $MENU_TEMPLATE['buttom-image']['start'] = '
    '; + $MENU_TEMPLATE['buttom-image']['body'] = '
    {CMENUIMAGE}
    {CPAGEBUTTON}'; + $MENU_TEMPLATE['buttom-image']['end'] = '
    '; + + + $MENU_TEMPLATE['aboutmodal']['start'] = ''; + + /*

    need be inserted in menu body */ + $MENU_TEMPLATE['sectionone']['start'] = ''; + $MENU_TEMPLATE['sectionone']['body'] = ' +

    +

    {CMENUTITLE}

    +
    +

    {CMENUBODY}

    + {CMENUTEXT} +
    '; + $MENU_TEMPLATE['sectionone']['end'] = ''; + + + $MENU_TEMPLATE['sectiontwo']['start'] = ''; + $MENU_TEMPLATE['sectiontwo']['body'] = ' +
    +
    + +

    {CMENUTITLE}

    +

    {CMENUBODY}

    +
    +
    '; + $MENU_TEMPLATE['sectiontwo']['end'] = ''; + + + $MENU_TEMPLATE['verticalfeatures-fadeInRight']['start'] = ''; + $MENU_TEMPLATE['verticalfeatures-fadeInRight']['body'] = ' +
    +

    {CMENUTITLE}

    +
    +

    {CMENUBODY}

    +
    +
    + +
    +
    '; + $MENU_TEMPLATE['verticalfeatures-fadeInRight']['end'] = ''; + + $MENU_TEMPLATE['verticalfeatures-fadeIn']['start'] = ''; + $MENU_TEMPLATE['verticalfeatures-fadeIn']['body'] = ' +
    +

    {CMENUTITLE}

    +
    + +
    +
    +

    {CMENUBODY}

    +
    +
    '; + $MENU_TEMPLATE['verticalfeatures-fadeIn']['end'] = ''; + + $MENU_TEMPLATE['call-to-action']['start'] = ''; + $MENU_TEMPLATE['call-to-action']['body'] = ' +
    +

    {CMENUTITLE}

    + {CMENUTEXT} +
    +
    +
    +
    +
    +
    +
    +
    {CPAGETITLE}
    + {CPAGEBODY} +
    +
    +
    '; + $MENU_TEMPLATE['call-to-action']['end'] = ''; + + + +?> + + diff --git a/e107_themes/landingzero/templates/navigation_template.php b/e107_themes/landingzero/templates/navigation_template.php new file mode 100644 index 000000000..2ee7e2cff --- /dev/null +++ b/e107_themes/landingzero/templates/navigation_template.php @@ -0,0 +1,148 @@ +'; + +// Main Link +$NAVIGATION_TEMPLATE['main']['item'] = ' +
  • + + {LINK_ICON}{LINK_NAME} + +
  • +'; + +// Main Link - active state +$NAVIGATION_TEMPLATE['main']['item_active'] = ' +
  • + + {LINK_ICON} {LINK_NAME} + +
  • +'; + +// Main Link which has a sub menu. +$NAVIGATION_TEMPLATE['main']['item_submenu'] = ' + +'; + +// Main Link which has a sub menu - active state. +$NAVIGATION_TEMPLATE['main']['item_submenu_active'] = ' + +'; + +$NAVIGATION_TEMPLATE['main']['end'] = '
'; + +// Sub menu +$NAVIGATION_TEMPLATE['main']['submenu_start'] = ' + '; + + +// TEMPLATE FOR {NAVIGATION=side} + +$NAVIGATION_TEMPLATE['side']['start'] = ' + '; + +$NAVIGATION_TEMPLATE['side']['submenu_start'] = ''; + +$NAVIGATION_TEMPLATE['side']['submenu_item'] = '
  • {LINK_ICON}{LINK_NAME}
  • '; + +$NAVIGATION_TEMPLATE['side']['submenu_loweritem'] = ' + +'; + +$NAVIGATION_TEMPLATE['side']['submenu_item_active'] = '
  • {LINK_ICON}{LINK_NAME}
  • '; + +$NAVIGATION_TEMPLATE['side']['submenu_end'] = ''; + + +// Footer links. - ie. 3 columns of links. + +$NAVIGATION_TEMPLATE["footer"]["start"] = "\n"; +$NAVIGATION_TEMPLATE["footer"]["submenu_start"] = ""; + + + + +$NAVIGATION_TEMPLATE['alt'] = $NAVIGATION_TEMPLATE['side']; +$NAVIGATION_TEMPLATE['alt5'] = $NAVIGATION_TEMPLATE['side']; +$NAVIGATION_TEMPLATE['alt6'] = $NAVIGATION_TEMPLATE['side']; + +?> diff --git a/e107_themes/landingzero/templates/news/news_menu_template.php b/e107_themes/landingzero/templates/news/news_menu_template.php new file mode 100644 index 000000000..52500e336 --- /dev/null +++ b/e107_themes/landingzero/templates/news/news_menu_template.php @@ -0,0 +1,105 @@ +'; +$NEWS_MENU_TEMPLATE['category']['end'] = ''; +$NEWS_MENU_TEMPLATE['category']['item'] = ' +
  • {NEWS_CATEGORY_TITLE} {NEWS_CATEGORY_NEWS_COUNT}
  • +'; + +//$NEWS_MENU_WRAPPER['category']['NEWS_CATEGORY_NEWS_COUNT'] = "({---})"; // Wrap brackets around the news count when value is returned. +//$NEWS_MENU_TEMPLATE['category']['separator'] = '
    '; + + + + + + +// months menu +$NEWS_MENU_TEMPLATE['months']['start'] = ''; +$NEWS_MENU_TEMPLATE['months']['item'] = ' +
  • {month} {count}
  • +'; +//$NEWS_MENU_TEMPLATE['months']['separator'] = '
    '; + + + + + + +// latest menu +$NEWS_MENU_TEMPLATE['latest']['start'] = ''; // Example: $NEWS_MENU_TEMPLATE['latest']['end'] '
    {currentTotal} from {total}'; +$NEWS_MENU_TEMPLATE['latest']['item'] = '
  • {NEWSTITLE} {NEWSCOMMENTCOUNT}
  • '; + +$NEWS_MENU_WRAPPER['latest']['NEWSCOMMENTCOUNT'] = "({---})"; + + + + + +// Other News Menu. +$NEWS_MENU_TEMPLATE['other']['caption'] = ''; +$NEWS_MENU_TEMPLATE['other']['start'] = " + {SETIMAGE: w=700&h=400&crop=1}"; // set the {NEWSIMAGE} dimensions. +$NEWS_MENU_TEMPLATE['other']['item'] = ' + {NEWSIMAGE: type=tag&item=1} +

    {NEWSTITLE}

    +

    {NEWSBODY}

    + '; +$NEWS_MENU_TEMPLATE['other']['end'] = ""; + + + + + + + + +// Other News Menu. 2 + +$NEWS_MENU_TEMPLATE['other2']['caption'] = TD_MENU_L2; +$NEWS_MENU_TEMPLATE['other2']['start'] = "
      {SETIMAGE: w=100&h=100&crop=1}"; // set the {NEWSIMAGE} dimensions. +$NEWS_MENU_TEMPLATE['other2']['item'] = "
    • + {NEWSTHUMBNAIL=placeholder} +

      {NEWSTITLELINK}

      +

      ".LAN_READ_MORE." »

      +
      +
    • \n"; + +$NEWS_MENU_TEMPLATE['other2']['end'] = "
    "; + + + + + + + +//$NEWS_MENU_TEMPLATE['latest']['separator'] = '
    '; // Shouldn't be needed. diff --git a/e107_themes/landingzero/templates/news/news_template.php b/e107_themes/landingzero/templates/news/news_template.php new file mode 100644 index 000000000..4b926d594 --- /dev/null +++ b/e107_themes/landingzero/templates/news/news_template.php @@ -0,0 +1,220 @@ +'; +//$NEWS_MENU_TEMPLATE['list']['end'] = ''; + +$NEWS_MENU_TEMPLATE['list']['start'] = '
    '; +$NEWS_MENU_TEMPLATE['list']['end'] = '
    '; + + +// XXX The ListStyle template offers a listed summary of items with a minimum of 10 items per page. +// As displayed by news.php?cat.1 OR news.php?all +// {NEWSBODY} should not appear in the LISTSTYLE as it is NOT the same as what would appear on news.php (no query) + +// Template/CSS to be reviewed for best bootstrap implementation +$NEWS_TEMPLATE['list']['caption'] = '{NEWSCATEGORY}'; +$NEWS_TEMPLATE['list']['start'] = '{SETIMAGE: w=400&h=350&crop=1}'; +$NEWS_TEMPLATE['list']['end'] = ''; +$NEWS_TEMPLATE['list']['item'] = ' + +
    +
    +
    + {NEWSTHUMBNAIL=placeholder} +
    +
    +
    +

    {NEWSTITLELINK}

    +

    + {NEWSSUMMARY} +

    +

    + '.LAN_READ_MORE.' +

    +
    +
    +
    + +'; + + + + + + +//$NEWS_MENU_TEMPLATE['list']['separator'] = '
    '; + + + +// XXX As displayed by news.php (no query) or news.php?list.1.1 (ie. regular view of a particular category) +//XXX TODO GEt this looking good in the default Bootstrap theme. +/* +$NEWS_TEMPLATE['default']['item'] = ' + {SETIMAGE: w=400} +
    +

    {NEWSTITLE}

    + + {NEWSDATE=short} by {NEWSAUTHOR} + + +
    + {NEWSIMAGE} + {NEWSBODY} + {EXTENDED} +
    +
    + {NEWSCATEGORY} {NEWSTAGS} {NEWSCOMMENTS} {EMAILICON} {PRINTICON} {PDFICON} {ADMINOPTIONS} +
    +
    +'; +*/ + + +$NEWS_WRAPPER['default']['item']['NEWSIMAGE: item=1'] = ' '; + +$NEWS_TEMPLATE['default']['item'] = ' + {SETIMAGE: w=600&h=600} +
    +
    +
    +

    {NEWSTITLE}

    +
    +
    + {NEWSIMAGE: item=1} +
    +
    +

    {NEWSSUMMARY}

    +
    +
    +
    + +
    +
    +'; + + + +###### Default view item (temporary) ###### +//$NEWS_MENU_TEMPLATE['view']['start'] = ''; + +// As displayed by news.php?extend.1 + + +$NEWS_WRAPPER['view']['item']['NEWSIMAGE: item=1'] = '{---}'; + +$NEWS_TEMPLATE['view']['item'] = ' +{SETIMAGE: w=900&h=600} +
    +

    {NEWSTITLELINK}

    {TAGS} + {NEWSTITLE} +
    +
    +
    {GLYPH=user}  {NEWSAUTHOR}   {GLYPH=time}  {NEWSDATE=short}
    +
    {GLYPH=tags}  {NEWSTAGS}   {GLYPH=folder-open}  {NEWSCATEGORY}
    +
    +
    + + +
    +

    {NEWSSUMMARY}

    +
    + {NEWSBODY=body} +
    +
    + {NEWSVIDEO: item=1} + {NEWSVIDEO: item=2} + {NEWSVIDEO: item=3} +
    + + +
    + {SETIMAGE: w=400&h=400} + +
    +
    {NEWSIMAGE: item=2}
    +
    {NEWSIMAGE: item=3}
    +
    +
    +
    {NEWSIMAGE: item=4}
    +
    {NEWSIMAGE: item=5}
    +
    + + {NEWSVIDEO: item=4} + {NEWSVIDEO: item=5} + +
    + {NEWSBODY=extended} +
    + + +
    +
    + +
    +
    {NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{ADMINOPTIONS: class=btn btn-default}{SOCIALSHARE}
    +
    + +
    + {NEWSRELATED} +
    + {NEWSNAVLINK} + +'; +//$NEWS_MENU_TEMPLATE['view']['separator'] = '
    '; + + +###### news_categories.sc +$NEWS_TEMPLATE['category']['body'] = ' +
    + {NEWSCATICON} {NEWSCATEGORY} +
    + {NEWSCAT_ITEM} +
    +'; + +$NEWS_TEMPLATE['category']['item'] = ' +
    + + + + +
    • + + {NEWSTITLELINK} +
    +
    +
    +'; + +### Related 'start' - Options: Core 'single' shortcodes including {SETIMAGE} +### Related 'item' - Options: {RELATED_URL} {RELATED_IMAGE} {RELATED_TITLE} {RELATED_SUMMARY} +### Related 'end' - Options: Options: Core 'single' shortcodes including {SETIMAGE} +/* +$NEWS_TEMPLATE['related']['start'] = "

    ".defset('LAN_RELATED', 'Related')."

    ";*/ + +$NEWS_TEMPLATE['related']['start'] = '{SETIMAGE: w=350&h=350&crop=1}

    '.LAN_LZ_THEME_18.'

    '; +$NEWS_TEMPLATE['related']['item'] = ''; +$NEWS_TEMPLATE['related']['end'] = '
    '; diff --git a/e107_themes/landingzero/theme.php b/e107_themes/landingzero/theme.php new file mode 100644 index 000000000..18de9d3a5 --- /dev/null +++ b/e107_themes/landingzero/theme.php @@ -0,0 +1,370 @@ +toGlyph('fa-comment')); +define('COMMENTOFFSTRING', ''); + +define('PRE_EXTENDEDSTRING', '
    '); + +/** + * @param string $caption + * @param string $text + * @param string $id : id of the current render + * @param array $info : current style and other menu data. + */ +function tablestyle($caption, $text, $id='', $info=array()) +{ +// global $style; // no longer needed. + + $style = $info['setStyle']; + + echo "\n\n"; + + $type = $style; + if(empty($caption)) + { + $type = 'box'; + } + + if($id == 'wm') // Example - If rendered from 'welcome message' + { + echo '

    '.$caption.'

    '.str_replace(array("

    ","

    "), "", $text).'

    '; + return; + } + + if($style == 'col-md-4' || $style == 'col-md-6' || $style == 'col-md-8') + { + echo '
    '; + + if(!empty($caption)) + { + echo '

    '.$caption.'

    '; + } + + echo ' + '.$text.' +
    '; + return; + + } + + if($style === 'menu' && !empty($info['footer']) && !empty($info['text'])) + { + $style = 'menu-footer'; + } + + + + if($style == 'menu') + { + echo '
    +
    '.$caption.'
    +
    + '.$text.' +
    +
    '; + return; + + } + + if($style == 'menu-footer') + { + echo '
    +
    '.$caption.'
    +
    + '.$info['text'].' +
    + +
    '; + return; + + } + + if($style == 'portfolio') + { + echo ' +
    + '.$text.' +
    '; + return; + } + + if($style == 'nocaption') + { + echo str_replace(array("

    ","

    "), "", $text); + return; + } + + if ($style == 'footercolumn') + { + echo '

    ' . $caption . '

    ' . str_replace(array("

    ","

    "), "", $text); + return; + } + + if ($style == 'footercolumn-12') + { + echo '
    +

    ' . $caption . '

    ' . $text . '
    '; + return; + } + // default. + + if(!empty($caption)) + { + echo '

    '.$caption.'

    '; + } + + echo $text; + + + + return; + + + +} + +// applied before every layout. +$LAYOUT['_header_'] = ' + +'; + +// applied after every layout. +$LAYOUT['_footer_'] = '
    +
    +
    +
    + {SETSTYLE=footercolumn} +
    {NAVIGATION=footer}
    +
    {LZ_SUBSCRIBE}
    +

    '.LAN_LZ_THEME_10.'

    {XURL_ICONS}
    +
    +
    + {SITEDISCLAIMER=2016} +
    +
    + + {SETSTYLE=nocaption} + {ABOUTMODAL} +'; + + + + +// $LAYOUT is a combined $HEADER and $FOOTER, automatically split at the point of "{---}" +// Frontpage has to be welcome message +$LAYOUT['homepage'] = ' +
    +
    +
    + {WMESSAGE=force} + {LANDING_TOGGLE}'.LAN_LZ_THEME_01.' +
    +
    + {VIDEOBACKGROUND} +
    +
    +
    +
    + {ALERTS} + {SETSTYLE=nocaption} + {MENU=1} +
    +
    +
    +
    +
    +
    +
    +

    '.LAN_LZ_THEME_04.'

    +
    +
    +
    +
    +
    +
    + {MENU=10} +
    +
    +
    + + {GALLERY_PORTFOLIO: limit=6} + +
    +
    +
    +

    '.LAN_LZ_THEME_06.'

    +
    + {MENU=9} +
    +
    +
    + +
    +
    +
    +
    +

    '.LAN_LZ_THEME_13.'

    +
    +

    '.LAN_LZ_THEME_14.'

    +
    +
    + {MENU=contact/contact} +
    +
    +
    +
    + {---} +'; + +$LAYOUT['full'] = ' + +{SETSTYLE=default} +
    + {ALERTS} + {MENU=1} + {---} +
    '; + +$LAYOUT['sidebar_right'] = ' +{SETSTYLE=default} +
    + {ALERTS} +
    +
    + {---} +
    + +
    + {SETSTYLE=menu} + {MENU=2} +
    +
    +
    '; + +$LAYOUT['sidebar_left'] = $LAYOUT['sidebar_right']; + + +$NEWSCAT = "\n\n\n\n\n\n\n\n +
    +
    + {NEWSCATEGORY} +
    +
    + {NEWSCAT_ITEM} +
    +
    +"; + + +$NEWSCAT_ITEM = "\n\n\n\n\n\n\n\n +
    + + +
    •  + {NEWSTITLELINK} +
    +"; + +?> diff --git a/e107_themes/landingzero/theme.xml b/e107_themes/landingzero/theme.xml new file mode 100644 index 000000000..ac096cc18 --- /dev/null +++ b/e107_themes/landingzero/theme.xml @@ -0,0 +1,49 @@ + + + + A free landing page theme with video background + Landing Zero Theme by bootstrapzero.com is a device-agnostic, modern responsive design that is customizable. It's designed to work well on desktops, laptops, tablets and mobile phones. Home page contains a video background. This single-page Bootstrap template has a sleek darkgrey color scheme, accent color and smooth scrolling. + generic + + + + + + + bootstrap + clean + video + + + preview_default.jpg + preview_onepage.jpg + + + + + + + FRONTPAGE + + + forum gallery + + + /news + + + + + + + + + + + /page + + + + + + \ No newline at end of file diff --git a/e107_themes/landingzero/theme_config.php b/e107_themes/landingzero/theme_config.php new file mode 100644 index 000000000..ceb563d97 --- /dev/null +++ b/e107_themes/landingzero/theme_config.php @@ -0,0 +1,46 @@ + array('title' => LAN_LZ_THEMEPREF_00, 'type'=>'image', 'help'=>''), + 'videomobilebackground' => array('title' => LAN_LZ_THEMEPREF_01, 'type'=>'image', 'help'=>''), + 'videoposter' => array('title' => LAN_LZ_THEMEPREF_02, 'type'=>'image', 'help'=>''), + 'videourl' => array('title' => LAN_LZ_THEMEPREF_03, 'type'=>'text', 'writeParms'=>array('size'=>'xxlarge'),'help'=>''), + 'usernav_placement' => array('title' => LAN_LZ_THEMEPREF_04, 'type'=>'dropdown', 'writeParms'=>array('optArray'=>array(LAN_LZ_THEMEPREF_05, LAN_LZ_THEMEPREF_06), 'useValues'=>1)), + 'cdn' => array('title' => 'CDN', 'type'=>'dropdown', 'writeParms'=>array('optArray'=>array( 'cdnjs' => 'CDNJS (Cloudflare)', 'jsdelivr' => 'jsDelivr'))) + ); + + return $fields; + + } + + function help() + { + return null; + } + + function process() + { + return null; + } +} + + +?> diff --git a/e107_themes/landingzero/theme_shortcodes.php b/e107_themes/landingzero/theme_shortcodes.php new file mode 100644 index 000000000..124b0740d --- /dev/null +++ b/e107_themes/landingzero/theme_shortcodes.php @@ -0,0 +1,382 @@ +sc_videobackground('file')) + { + $inlinecss = 'header { background-image: url('.$img.') }'; + e107::css("inline", $inlinecss); + } + + } + + function sc_aboutmodal() + { + $text = e107::getParser()->parseTemplate('{CMENU=aboutmodal}'); + return $text; + } + + function sc_videobackground($parm=null) + { + + if($this->isMobile() ) //|| !empty($_GET['configure']) + { + return null; + } + + /* first frame */ + if($videoposter = e107::pref('theme', 'videoposter', false)) + { + $videoposter = e107::getParser()->thumbURL($videoposter); + } + else + { + $videoposter = SITEURLBASE.THEME_ABS."images/background01.jpg"; + } + + if($parm == 'file') + { + return $videoposter; + } + + + + /* mp4 video url */ + + if(!$videourl = e107::pref('theme', 'videourl', false)) + { + $videourl = "https://s3-us-west-2.amazonaws.com/coverr/mp4/Traffic-blurred2.mp4"; + } + + $text = ' + '; + + return $text; + } + + + function isMobile() + { + return preg_match("/\b(?:a(?:ndroid|vantgo)|b(?:lackberry|olt|o?ost)|cricket|do‌​como|hiptop|i(?:emob‌​ile|p[ao]d)|kitkat|m‌​(?:ini|obi)|palm|(?:‌​i|smart|windows )phone|symbian|up\.(?:browser|link)|tablet(?: browser| pc)|(?:hp-|rim |sony )tablet|w(?:ebos|indows ce|os))/i", $_SERVER["HTTP_USER_AGENT"]); + } + + function sc_landing_toggle() + { + if($this->isMobile() || (e_ADMIN_AREA === true)) + { + return null; + } + + + return '
    '.LAN_LZ_THEME_02.' +   '; + + + } + + + + function sc_cmenutext() + { + $sc = e107::getScBatch('page', null, 'cpage'); + $data = $sc->getVars(); + return vartrue($data['menu_button_text'],''); + } + + + function sc_sitedisclaimer($copyYear = NULL) + { + $default = "Proudly powered by e107 which is released under the terms of the GNU GPL License."; + $sitedisclaimer = deftrue('SITEDISCLAIMER',$default); + + $copyYear = vartrue($copyYear,'2013'); + $curYear = date('Y'); + $text = '© '. $copyYear . (($copyYear != $curYear) ? ' - ' . $curYear : ''); + + $text .= ' '.$sitedisclaimer; + return e107::getParser()->toHtml($text, true, 'SUMMARY'); + } + + function sc_xurl_icons() { + $social = array( + 'rss' => array('href'=> (e107::isInstalled('rss_menu') ? e107::url('rss_menu', 'index', array('rss_url'=>'news')) : ''), 'title'=>'RSS/Atom Feed'), + 'facebook' => array('href'=> deftrue('XURL_FACEBOOK'), 'title'=>'Facebook'), + 'twitter' => array('href'=> deftrue('XURL_TWITTER'), 'title'=>'Twitter'), + 'google' => array('href'=> deftrue('XURL_GOOGLE'), 'title'=>'Google Plus'), + 'linkedin' => array('href'=> deftrue('XURL_LINKEDIN'), 'title'=>'LinkedIn'), + 'github' => array('href'=> deftrue('XURL_GITHUB'), 'title'=>'Github'), + 'pinterest' => array('href'=> deftrue('XURL_PINTEREST'), 'title'=>'Pinterest'), + 'flickr' => array('href'=> deftrue('XURL_FLICKR'), 'title'=>'Flickr'), + 'instagram' => array('href'=> deftrue('XURL_INSTAGRAM'), 'title'=>'Instagram'), + 'youtube' => array('href'=> deftrue('XURL_YOUTUBE'), 'title'=>'YouTube'), + 'question-circle' => array('href'=> deftrue('XURL_VIMEO'), 'title'=>'e107 HELP') + ); + + //Fixme - GooglePlus not working. + + $text = ''; + $textstart ='
      '; + $textend = '
    '; + foreach($social as $id => $data) + { + if($data['href'] != '') + { + $text .= ' +
  •  
  • '; + $text .= "\n"; + } + } + if($text !='') + { + return $textstart.$text.$textend; + } + } + + + function sc_lz_subscribe() + { + $pref = e107::pref('core'); + $ns = e107::getRender(); + + if(empty($pref['signup_option_class'])) + { + return false; + } + + $frm = e107::getForm(); + $text = $frm->open('lz-subscribe','post', e_SIGNUP); + $text .= "
    "; + $text .= $frm->text('email','', null, array('placeholder'=>LAN_LZ_THEME_15, 'size'=>'xxlarge')); + $text .= "
    "; + $text .= "
    "; + $text .= " ".$frm->button('subscribe', 1, 'submit', LAN_LZ_THEME_16, array('class'=>'btn-primary')); + $text .= "
    "; + $text .= $frm->close(); + + $caption = LAN_LZ_THEME_17; + + return $ns->tablerender($caption,$text,'lz-subscribe', true); + } + + + + + function sc_lz_contactform() //FIXME Use contact_template.php instead ie. $CONTACT_TEMPLATE['menu'] + { + + // + + $text = ' +
    +

    Get in Touch

    +
    +

    We love feedback. Fill out the form below and we\'ll get back to you as soon as possible.

    +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +'; + + return $text; + + } + + function sc_contact_submit_button($parm='') + { + return ""; + } + + function sc_bootstrap_usernav($parm='') + { + + $placement = e107::pref('theme', 'usernav_placement', 'top'); + + if($parm['placement'] != $placement) + { + return ''; + } + + include_lan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php"); + + $tp = e107::getParser(); + require(e_PLUGIN."login_menu/login_menu_shortcodes.php"); // don't use 'require_once'. + + $direction = vartrue($parm['dir']) == 'up' ? ' dropup' : ''; + + $userReg = defset('USER_REGISTRATION'); + + if(!USERID) // Logged Out. + { + $text = ' + "; + + + + return $tp->parseTemplate($text, true, $login_menu_shortcodes); + } + + + // Logged in. + //TODO Generic LANS. (not theme LANs) + + $text = ' + + + + '; + + + return $tp->parseTemplate($text,true,$login_menu_shortcodes); + } + + + +} + + + + + +?> diff --git a/e107_themes/voux/theme.xml b/e107_themes/voux/theme.xml index d5d65f311..00a8b463e 100644 --- a/e107_themes/voux/theme.xml +++ b/e107_themes/voux/theme.xml @@ -2,7 +2,7 @@ Simple modern blog theme. - Ported from the blogger theme by ThemeExpose + A responsive bootstrap blog theme by ThemeExpose blog diff --git a/e107_themes/voux/theme_shortcodes.php b/e107_themes/voux/theme_shortcodes.php index aef79a448..74772233a 100644 --- a/e107_themes/voux/theme_shortcodes.php +++ b/e107_themes/voux/theme_shortcodes.php @@ -98,7 +98,7 @@ class theme_shortcodes extends e_shortcode return ''; } - include_lan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php"); + e107::includeLan(e_PLUGIN."login_menu/languages/".e_LANGUAGE.".php"); $tp = e107::getParser(); require(e_PLUGIN."login_menu/login_menu_shortcodes.php"); // don't use 'require_once'. diff --git a/e107_web/css/backcompat.css b/e107_web/css/backcompat.css index e9032b301..3961a360e 100644 --- a/e107_web/css/backcompat.css +++ b/e107_web/css/backcompat.css @@ -52,4 +52,6 @@ ul.breadcrumb li span.divider { padding-left:5px; } } .media-left, .media > .pull-left { padding-right: 10px; -} \ No newline at end of file +} + +.form-control { max-width:100% } \ No newline at end of file diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index 1feb8dda7..d9f8b2b21 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -1,3 +1,92 @@ +var e107 = e107 || {'settings': {}, 'behaviors': {}}; + +(function ($) +{ + + /** + * Initializes click event on '.e-modal' elements. + * + * @type {{attach: e107.behaviors.eModalAdmin.attach}} + */ + e107.behaviors.eModalAdmin = { + attach: function (context, settings) + { + $(context).find('.e-modal').once('e-modal-admin').each(function () + { + var $that = $(this); + + $that.on('click', function () + { + var $this = $(this); + + if($this.attr('data-cache') == 'false') + { + $('#uiModal').on('shown.bs.modal', function () + { + $(this).removeData('bs.modal'); + }); + } + + var url = $this.attr('href'); + var caption = $this.attr('data-modal-caption'); + var height = ($(window).height() * 0.7) - 120; + + if(caption === undefined) + { + caption = ''; + } + + $('.modal-body').html('
    '); + $('.modal-caption').html(caption + ' '); + $('.modal').modal('show'); + + $("#e-modal-iframe").on("load", function () + { + $('#e-modal-loading').hide(); + }); + + return false; + }); + }); + } + }; + +})(jQuery); + +(function (jQuery) +{ + + /** + * jQuery extension to make admin tab 'fadeIn' with 'display: inline-block'. + * + * @param displayMode + * A string determining display mode for element after the animation. + * Default: 'inline-block'. + * @param duration + * A string or number determining how long the animation will run. + * Default: 400. + */ + jQuery.fn.fadeInAdminTab = function (displayMode, duration) + { + var $this = $(this); + + if($this.css('display') !== 'none') + { + return; + } + + displayMode = displayMode || 'inline-block'; + duration = duration || 400; + + $this.fadeIn(duration, function () + { + $this.css('display', displayMode); + }); + }; + +})(jQuery); + + $(document).ready(function() { $('form').h5Validate( @@ -208,44 +297,6 @@ $(document).ready(function() }); - - - - - - - - /* Bootstrap Modal window within an iFrame */ - $('.e-modal').on('click', function(e) - { - - e.preventDefault(); - - if($(this).attr('data-cache') == 'false') - { - $('#uiModal').on('shown.bs.modal', function () { - $(this).removeData('bs.modal'); - }); - } - - var url = $(this).attr('href'); - var caption = $(this).attr('data-modal-caption'); - var height = ($(window).height() * 0.7) - 120; - - if(caption === undefined) - { - caption = ''; - } - - $('.modal-body').html('
    '); - $('.modal-caption').html(caption + ' '); - $('.modal').modal('show'); - - $("#e-modal-iframe").on("load", function () { - $('#e-modal-loading').hide(); - }); - }); - var progresspump = null; diff --git a/e107_web/js/core/all.jquery.js b/e107_web/js/core/all.jquery.js index 0498a9474..849f0c2c8 100644 --- a/e107_web/js/core/all.jquery.js +++ b/e107_web/js/core/all.jquery.js @@ -625,7 +625,7 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; case 'html': default: - $target.html(data).hide().show("slow"); + $target.html(data); // .hide().show("slow"); //XXX this adds display:block by default which breaks loading content within inactive tabs. break; } diff --git a/e107_web/js/core/front.jquery.js b/e107_web/js/core/front.jquery.js index bf810a416..d3c7c0fd7 100644 --- a/e107_web/js/core/front.jquery.js +++ b/e107_web/js/core/front.jquery.js @@ -40,6 +40,73 @@ var e107 = e107 || {'settings': {}, 'behaviors': {}}; } }; + /** + * Initializes click event on '.e-modal' elements. + * + * @type {{attach: e107.behaviors.eModalFront.attach}} + */ + e107.behaviors.eModalFront = { + attach: function (context, settings) + { + $(context).find('.e-modal').once('e-modal-front').each(function () + { + var $that = $(this); + + $that.on('click', function () + { + var $this = $(this); + + if($this.attr('data-cache') == 'false') + { + $('#uiModal').on('shown.bs.modal', function () + { + $(this).removeData('bs.modal'); + }); + } + + var url = $this.attr('href'); + var caption = $this.attr('data-modal-caption'); + var backdrop = $this.attr('data-modal-backdrop'); + var keyboard = $this.attr('data-modal-keyboard'); + var height = ($(window).height() * 0.7) - 120; + + var modalOptions = {show: true}; + + if(backdrop !== undefined) + { + modalOptions['backdrop'] = backdrop; + } + + if(keyboard !== undefined) + { + modalOptions['keyboard'] = keyboard; + } + + if(caption === undefined) + { + caption = ''; + } + + if($this.attr('data-modal-height') !== undefined) + { + height = $(this).attr('data-modal-height'); + } + + $('.modal-body').html('
    '); + $('.modal-caption').html(caption + ' '); + $('.modal').modal(modalOptions); + + $("#e-modal-iframe").on("load", function () + { + $('#e-modal-loading').hide(); + }); + + return false; + }); + }); + } + }; + })(jQuery); @@ -397,60 +464,5 @@ $(document).ready(function() return true; }); - - - - /* Bootstrap Modal window within an iFrame for frontend */ - $('.e-modal').on('click', function(e) - { - e.preventDefault(); - - if($(this).attr('data-cache') == 'false') - { - $('#uiModal').on('shown.bs.modal', function () { - $(this).removeData('bs.modal'); - }); - } - - var url = $(this).attr('href'); - var caption = $(this).attr('data-modal-caption'); - var backdrop = $(this).attr('data-modal-backdrop'); - var keyboard = $(this).attr('data-modal-keyboard'); - var height = ($(window).height() * 0.7) - 120; - - var modalOptions = {show: true}; - - if(backdrop !== undefined) - { - modalOptions['backdrop'] = backdrop; - } - - if(keyboard !== undefined) - { - modalOptions['keyboard'] = keyboard; - } - - if(caption === undefined) - { - caption = ''; - } - - if($(this).attr('data-modal-height') !== undefined) - { - height = $(this).attr('data-modal-height'); - } - - $('.modal-body').html('
    '); - $('.modal-caption').html(caption + ' '); - $('.modal').modal(modalOptions); - - $("#e-modal-iframe").on("load", function () { - $('#e-modal-loading').hide(); - }); - }); - - - - }); diff --git a/email.php b/email.php index 81f425f60..6cde64263 100644 --- a/email.php +++ b/email.php @@ -23,7 +23,7 @@ if (!check_class(varset($pref['email_item_class'],e_UC_MEMBER))) exit(); } -include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE); require_once(HEADERF); diff --git a/index.php b/index.php index 35d75406c..b9bae8c0f 100644 --- a/index.php +++ b/index.php @@ -86,8 +86,19 @@ */ $sql->db_Mark_Time("Start Simple URL-ReWrite Routine"); - - $tmp = e107::getAddonConfig('e_url'); + + // XXX Cache didn't bring much benefit. + + /*if($cached = e107::getCache()->retrieve('Addon_url',5,true,true)) + { + $tmp = e107::unserialize($cached); + } + else*/ + { + $tmp = e107::getAddonConfig('e_url'); + // e107::getCache()->set('Addon_url',e107::serialize($tmp,'json'),true,true,true); + } + $req = (e_HTTP === '/') ? ltrim(e_REQUEST_URI,'/') : str_replace(e_HTTP,'', e_REQUEST_URI) ; diff --git a/install.php b/install.php index bb10cb2eb..05633cc87 100644 --- a/install.php +++ b/install.php @@ -866,13 +866,13 @@ class e_install $permColor = ($perms_pass == true) ? "text-success" : "text-danger"; $PHPColor = ($version_fail == false) ? "text-success" : "text-danger"; $mysqlColor = ($mysql_pass == true) ? "text-success" : "text-danger"; - +/* if(version_compare($php_version, 7.1, ">=")) // XXX Remove once tested thoroughly { $php_help = " PHP 7.1 may have issues with e107. We recommend using 7.0.x versions instead until further testing has been performed."; $PHPColor = 'text-warning'; } - +*/ $extensionCheck = array( 'xml' => array('label'=> LANINS_050, 'status'=> function_exists('utf8_encode'), 'url'=> 'http://php.net/manual/en/ref.xml.php'), @@ -1129,20 +1129,21 @@ class e_install $title = vartrue($themeInfo['@attributes']['name']); $category = vartrue($themeInfo['category']); $preview = e_THEME.$val."/".$themeInfo['thumbnail']; + $description = vartrue($themeInfo['description']); if(!is_readable($preview)) { continue; } - $thumbnail = "".$val.""; + $thumbnail = "".$val.""; - $selected = ($val == 'bootstrap3') ? " checked" : ""; + $selected = ($val == 'landingzero') ? " checked" : ""; $output .= "
    -