diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 7c97fe88e..894457c52 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -17,6 +17,7 @@ if (!getperms("5|J")) { e107::redirect('admin'); exit; } e107::css('inline'," .e-wysiwyg { height: 400px } +td.menu-field { background-color: rgba(0,0,0,0.07); } "); e107::coreLan('cpage', true); @@ -34,6 +35,12 @@ class page_admin extends e_admin_dispatcher 'ui' => 'page_admin_form_ui', 'uipath' => null ), + 'overview' => array( + 'controller' => 'page_admin_ui', + 'path' => null, + 'ui' => 'page_admin_form_ui', + 'uipath' => null + ), 'cat' => array( 'controller' => 'page_chapters_ui', 'path' => null, @@ -56,8 +63,10 @@ class page_admin extends e_admin_dispatcher ); protected $adminMenu = array( + 'overview/list' => array('caption'=> CUSLAN_1, 'perm' => '5|J'), 'page/list' => array('caption'=> CUSLAN_48, 'perm' => '5'), - 'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J', 'tab' => 2), + 'menu/list' => array('caption'=> CUSLAN_49, 'perm' => 'J', 'tab' => 2), + 'page/create' => array('caption'=> CUSLAN_12, 'perm' => '5'), 'other' => array('divider'=> true), 'cat/list' => array('caption'=> CUSLAN_50, 'perm' => '5'), // Create Category. @@ -72,6 +81,7 @@ class page_admin extends e_admin_dispatcher protected $adminMenuAliases = array( + 'overview/edit' => 'overview/list', 'page/edit' => 'page/list', 'menu/edit' => 'menu/create', 'cat/edit' => 'cat/list' @@ -134,9 +144,11 @@ 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')); - + + if($this->getController()->getMode() === 'overview') + { + $text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default')); + } return $text; } } @@ -176,7 +188,7 @@ class page_chapters_ui extends e_admin_ui '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&sef=chapter_name', ), // Display name + 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'batch'=>true, '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), @@ -193,7 +205,7 @@ class page_chapters_ui extends e_admin_ui { $this->addTitle(CUSLAN_63); // e107::getMessage()->addWarning("Experimental: Custom Fields"); - $this->tabs = array(LAN_GENERAL,"Custom Fields"); + $this->tabs = array(LAN_GENERAL,CUSLAN_4); $this->fields['chapter_fields'] = array('title'=>"Fields", 'tab'=>1, 'type'=>'method', 'data'=>'json', 'writeParms'=>array('nolabel'=>2)); if($this->getAction() === 'list') @@ -208,7 +220,7 @@ class page_chapters_ui extends e_admin_ui $sql = e107::getDb(); $sql->gen("SELECT chapter_id,chapter_name FROM #page_chapters WHERE chapter_parent =0"); - $this->books[0] = "(New Book)"; + $this->books[0] = CUSLAN_5; while($row = $sql->fetch()) { @@ -556,7 +568,7 @@ class page_admin_ui extends e_admin_ui 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=blank'), - 'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width'=>'25%', 'writeParms'=>'size=block-level'), + 'page_title' => array('title'=> CUSLAN_2, 'tab' => 0, 'type' => 'text', 'data'=>'str', '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'=>array()), @@ -571,7 +583,7 @@ class page_admin_ui extends e_admin_ui 'page_rating_flag' => array('title'=> LAN_RATING, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ), 'page_comment_flag' => array('title'=> LAN_COMMENTS, 'tab' => 1, 'type' => 'boolean', 'data'=>'int', 'width' => '5%', 'thclass' => 'center', 'class' => 'center' ), 'page_password' => array('title'=> LAN_PASSWORD, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('password'=>1, 'nomask'=>1, 'size' => 40, 'class' => 'tbox e-password', 'generate' => 1, 'strength' => 1, 'required'=>0)), - 'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'), + 'page_sef' => array('title'=> LAN_SEFURL, 'tab' => 1, 'type' => 'text', 'batch'=>true, 'data'=>'str', 'inline'=>true, 'width' => 'auto', 'writeParms'=>'size=xxlarge&sef=page_title'), 'page_metakeys' => array('title'=> LAN_KEYWORDS, 'tab' => 1, 'type' => 'tags', 'data'=>'str', 'width' => 'auto'), 'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'writeParms'=>'size=xxlarge'), @@ -597,7 +609,7 @@ class page_admin_ui extends e_admin_ui // 'page_ip_restrict' => array('title'=> LXXAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar - 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center','readParms'=>'sort=1') + 'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last','readParms'=>'sort=1&deleteClass=e_UC_NOBODY') ); protected $fieldpref = array("page_id","page_title","page_chapter","page_template","page_author","page_class"); @@ -606,7 +618,8 @@ class page_admin_ui extends e_admin_ui 'listPages' => array('title'=> CUSLAN_29, 'type'=>'boolean'), 'listBooks' => array('title'=> CUSLAN_50, 'type'=>'boolean'), 'listBooksTemplate' => array('title'=> CUSLAN_72, 'type'=>'dropdown'), - 'pageCookieExpire' => array('title'=> CUSLAN_30, 'type'=>'number') //TODO Set default value to 84600 + 'pageCookieExpire' => array('title'=> CUSLAN_30, 'type'=>'number'), //TODO Set default value to 84600 + 'admin_page_perpage' => array('title'=> CUSLAN_3, 'type'=>'number'), //TODO Set default value to 84600 ); protected $books = array(); @@ -617,7 +630,39 @@ class page_admin_ui extends e_admin_ui function init() { + if($this->getMode() === 'overview') + { + $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 "; // without any Order or Limit. + $this->fieldpref = array("page_id", "page_title", 'page_chapter', 'page_template', "menu_title", 'menu_image', 'menu_template' ); + $this->sortField = false; + + $this->fields['menu_title']['width'] = 'auto'; + $this->fields['menu_image']['readParms'] = 'thumb=60x55'; + $this->fields['menu_image']['width'] = 'auto'; + + $this->fields['page_title']['width'] = 'auto'; + + $this->fields['options']['type'] = 'method'; + + + foreach($this->fieldpref as $k) + { + $this->fields[$k]['nolist'] = false; + + if($k === 'page_id') + { + continue; + } + + if(strpos($k,'menu_') === 0) + { + $this->fields[$k]['class'] = 'menu-field '.$this->fields[$k]['class']; + } + + $this->fields[$k]['width'] = '13%'; + } + } if(vartrue($_POST['menu_delete'])) // Delete a Menu (or rather, remove it's data ) @@ -631,7 +676,7 @@ 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 != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit. diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php index b74f04fe6..565927dad 100644 --- a/e107_admin/eurl.php +++ b/e107_admin/eurl.php @@ -207,7 +207,7 @@ class eurl_admin_ui extends e_admin_controller_ui protected function simplePage() { // $this->addTitle("Simple Redirects"); - $eUrl =e107::getAddonConfig('e_url'); + $eUrl =e107::getUrlConfig(); $frm = e107::getForm(); $tp = e107::getParser(); $cfg = e107::getConfig(); @@ -315,8 +315,17 @@ class eurl_admin_ui extends e_admin_controller_ui { // main module pref dropdown $this->prefs['url_main_module']['writeParms'][''] = 'None'; + + // e_url.php aliases + $tmp = e107::getUrlConfig('alias'); + foreach($tmp as $plugin=>$alias) + { + $this->prefs['url_main_module']['writeParms'][$alias] = eHelper::labelize($plugin); + } + + // legacy URL (news, pages ) $modules = e107::getPref('url_config', array()); - ksort($modules); + foreach ($modules as $module => $location) { $labels = array(); @@ -326,10 +335,11 @@ class eurl_admin_ui extends e_admin_controller_ui if(!$config || !vartrue($config['config']['allowMain'])) continue; $admin = $obj->admin(); $labels = vartrue($admin['labels'], array()); - - + $this->prefs['url_main_module']['writeParms'][$module] = vartrue($section['name'], eHelper::labelize($module)); } + + ksort($this->prefs['url_main_module']['writeParms']); // title2sef transform type pref $types = explode('|', 'none|dashl|dashc|dash|underscorel|underscorec|underscore|plusl|plusc|plus'); diff --git a/e107_admin/header.php b/e107_admin/header.php index f36ec51a3..4c1abd030 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -465,6 +465,10 @@ if(deftrue('e_MENUMANAGER_ACTIVE')) { $body_onload .= " id=\"layout-".e107::getForm()->name2id(THEME_LAYOUT)."\" "; } +else +{ + $body_onload .= " id=\"admin-".str_replace(".php","",e_PAGE)."\" "; +} // // J: Send end of and start of diff --git a/e107_admin/menus.php b/e107_admin/menus.php index d385e5bde..32aee2589 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -45,14 +45,14 @@ if(e_MENUMANAGER_ACTIVE === false ) e107::library('load', 'bootstrap.switch'); e107::js('footer', '{e_WEB}js/bootstrap.switch.init.js', 'jquery', 5); - if(!deftrue("e_DEBUG")) +// if(!deftrue("e_DEBUG")) { e107::getJs()->inlineCSS(' body { overflow:hidden } '); } - else - { +// else +/* { e107::js('footer-inline'," $('#menu_iframe').attr('scrolling','no'); $('#menu_iframe').load(function() { @@ -60,7 +60,7 @@ if(e_MENUMANAGER_ACTIVE === false ) $(this).css('height',height); }); "); - } + }*/ e107::getJs()->inlineCSS(" .menu-manager-items { padding-right:15px} @@ -90,20 +90,20 @@ if(e_MENUMANAGER_ACTIVE === false ) .menu-selector ul li:nth-child(odd){ background-color:rgba(0,0,0,0.2) } - .menu-selector { height:330px; display:block; padding-bottom:50px; overflow-y:scroll; margin-bottom:10px } + .menu-selector { /*height:330px; */ display:block; padding-bottom:50px; /*overflow-y:scroll;*/ margin-bottom:10px } .menu-selector input:checked + span { color: white; } @media all and (min-height: 1000px) { - .menu-selector { height:500px } + /*.menu-selector { height:200px }*/ } @media all and (max-height: 800px) { - .menu-selector { height:250px } + /*.menu-selector { height:250px }*/ iframe#menu_iframe { height: 87vh } - .menu-selector ul li { font-size: 0.8em } + /*.menu-selector ul li { font-size: 0.8em }*/ } ul.dropdown-menu.e-mm-selector { padding: 10px; margin-top: -2px; margin-right:-2px; } diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index a5ba5d332..a38f61b08 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -440,7 +440,7 @@ class news_admin_ui extends e_admin_ui 'news_meta_keywords' => array('title' => LAN_KEYWORDS, 'type' => 'tags', 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), 'news_meta_description' => array('title' => LAN_DESCRIPTION,'type' => 'textarea', 'data'=>'str', 'tab'=>1, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge')), - 'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')), + 'news_sef' => array('title' => LAN_SEFURL, 'type' => 'text', 'batch'=>1, 'data'=>'str', 'tab'=>1, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'writeParms'=>array('size'=>'xxlarge', 'show'=>1, 'sef'=>'news_title')), 'news_ping' => array('title' => LAN_PING, 'type' => 'checkbox', 'tab'=>1, 'data'=>false, 'writeParms'=>'value=0', 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), 'news_author' => array('title' => LAN_AUTHOR, 'type' => 'method', 'tab'=>0, 'readParms'=>'idField=user_id&nameField=user_name', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false), @@ -1118,14 +1118,14 @@ class news_admin_ui extends e_admin_ui ".NWSLAN_88." - ".$frm->select('newsposts', $this->_optrange(50, false), $pref['newsposts'], 'class=tbox')." + ".$frm->select('newsposts', $this->_optrange(50, false), $pref['newsposts'])." ".LAN_NEWS_91." - ".$frm->select('news_list_limit', $this->_optrange(50, false), $pref['news_list_limit'], 'class=tbox')." + ".$frm->select('news_list_limit', $this->_optrange(50, false), $pref['news_list_limit'])."
".LAN_NEWS_92."
@@ -1167,13 +1167,13 @@ class news_admin_ui extends e_admin_ui ".NWSLAN_87." - ".$frm->select('nbr_cols', $this->_optrange(6, false), $pref['nbr_cols'], 'class=tbox')." + ".$frm->select('nbr_cols', $this->_optrange(6, false), $pref['nbr_cols'])." ".NWSLAN_115." - ".$frm->select('newsposts_archive', $this->_optrange(intval($pref['newsposts']) - 1), intval($pref['newsposts_archive']), 'class=tbox')." + ".$frm->select('newsposts_archive', $this->_optrange(intval($pref['newsposts']) - 1), intval($pref['newsposts_archive']))."
".NWSLAN_116."
diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php index 7eec354a4..15d892e0d 100644 --- a/e107_admin/plugin.php +++ b/e107_admin/plugin.php @@ -5025,8 +5025,11 @@ class ".$table." extends e_admin_ui protected \$batchDelete = true; protected \$batchExport = true; protected \$batchCopy = true; + // protected \$sortField = 'somefield_order'; - // protected \$orderStep = 10; + // protected \$sortParent = 'somefield_parent'; + // protected \$treePrefix = 'somefield_title'; + // protected \$tabs = array('Tabl 1','Tab 2'); // Use 'tab'=>0 OR 'tab'=>1 in the \$fields below to enable. // protected \$listQry = \"SELECT * FROM `#tableName` WHERE field != '' \"; // Example Custom Query. LEFT JOINS allowed. Should be without any Order or Limit. diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index fbee9061d..83ac79286 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -96,6 +96,12 @@ if(isset($_POST['updateprefs'])) $mes->addError(PRFLAN_211); } + + if(!empty($_POST['passwordEncoding']) || !empty($_POST['ssl_enabled'])) + { + $_POST['password_CHAP'] = 0; // disable chap unless using md5 without SSL. + } + // Table of range checking values - min and max for numerics. Only do the important ones $pref_limits = array('loginname_maxlength' => array('min' => 10, 'max' => 100, 'default' => 30), 'displayname_maxlength' => array('min' => 5, 'max' => 100, 'default' => 15), @@ -1427,7 +1433,10 @@ $text .= " $text .= " - ".$frm->select('password_CHAP',$CHAP_list,$pref['password_CHAP'] ); + "; + + $CHAPopt = !empty($pref['ssl_enabled']) || !empty($pref['passwordEncoding']) ? array('disabled'=>1) : null; + $text .= $frm->select('password_CHAP',$CHAP_list,$pref['password_CHAP'], $CHAPopt ); //." ".$frm->select_open('password_CHAP'); //TODO - user tracking session name - visible only if Cookie is enabled (JS) diff --git a/e107_admin/search.php b/e107_admin/search.php index 578d985e5..d2e0697a9 100644 --- a/e107_admin/search.php +++ b/e107_admin/search.php @@ -16,7 +16,7 @@ if (!getperms('X')) e107::redirect('admin'); exit; } - +e107::coreLan('search');// need LAN_SEARCH_98 e107::coreLan('search', true); $e_sub_cat = 'search'; diff --git a/e107_admin/ver.php b/e107_admin/ver.php index 6faf523ba..657d91f38 100644 --- a/e107_admin/ver.php +++ b/e107_admin/ver.php @@ -10,6 +10,6 @@ if (!defined('e107_INIT')) { exit; } -$e107info['e107_version'] = "2.1.5 (git)"; +$e107info['e107_version'] = "2.1.6 (git)"; ?> \ No newline at end of file diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 65563ea9f..fc8041a50 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -157,12 +157,19 @@ class admin_shortcodes if(function_exists('e_help') && ($tmp = e_help())) // new in v2.x for non-admin-ui admin pages. { + $ns->setUniqueId('sc-admin-help'); $help_text = $ns->tablerender($tmp['caption'],$tmp['text'],'e_help',true); } + if(e_PAGE === "menus.php") // quite fix to disable e107_admin/menus.php help file in all languages. + { + return $help_text; + } + + $helpfile = ''; - if(strpos(e_SELF, e_ADMIN_ABS) !== FALSE) + if(strpos(e_SELF, e_ADMIN_ABS) !== false) { if (is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/admin/help/'.e_PAGE)) { @@ -2169,12 +2176,12 @@ Inverse 10 10 $c = 0; foreach($languages as $lng) { - $checked = "  "; + $checked = "  "; $code = $slng->convert($lng); if($lng == e_LANGUAGE) { - $checked = $tp->toGlyph('ok')." "; + $checked = $tp->toGlyph('fa-check', array('fw'=>1))." "; $link = '#'; } elseif(in_array(e_DOMAIN,$multiDoms)) diff --git a/e107_core/shortcodes/batch/contact_shortcodes.php b/e107_core/shortcodes/batch/contact_shortcodes.php index fb425bff8..68599f376 100644 --- a/e107_core/shortcodes/batch/contact_shortcodes.php +++ b/e107_core/shortcodes/batch/contact_shortcodes.php @@ -90,29 +90,45 @@ class contact_shortcodes extends e_shortcode } + /* example {CONTACT_NAME} */ + /* example {CONTACT_NAME: class=form-control} */ + /* example {CONTACT_NAME: class=col-md-12&placeholder=".LANCONTACT_03." *} */ + function sc_contact_name($parm='') { $userName = deftrue('USERNAME'); - - return ""; - + $class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control'; + $placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : ''; + return ""; } + /* example {CONTACT_EMAIL} */ + /* example {CONTACT_EMAIL: class=form-control} */ + /* example {CONTACT_EMAIL: class=col-md-12&placeholder=".LANCONTACT_04." *} */ + function sc_contact_email($parm='') { $userEmail = deftrue('USEREMAIL'); $disabled = (!empty($userEmail)) ? 'readonly' : ''; // don't allow change from a verified email address. - return ""; + $class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control'; + $placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : ''; + return ""; } + /* example {CONTACT_SUBJECT} */ + /* example {CONTACT_SUBJECT: class=form-control} */ + /* example {CONTACT_SUBJECT: class=col-md-12&placeholder=".LANCONTACT_05." *} */ + function sc_contact_subject($parm='') { - return ""; + $class = (!empty($parm['class'])) ? $parm['class'] : 'tbox form-control'; + $placeholder = (!empty($parm['placeholder'])) ? " placeholder= '".$parm['placeholder']."'" : ''; + return ""; } @@ -131,18 +147,22 @@ class contact_shortcodes extends e_shortcode { $size = 'input-xxlarge'; } - + $class = (!empty($parm['class'])) ? $parm['class'] : 'tbox '.$size.' form-control'; - return ""; + return ""; } + /* example {CONTACT_SUBMIT_BUTTON} */ + /* example {CONTACT_SUBMIT_BUTTON: class=contact submit btn btn-minimal} */ function sc_contact_submit_button($parm='') { - return ""; + $class = (!empty($parm['class'])) ? $parm['class'] : 'btn btn-primary button'; + + return ""; } } -?> \ No newline at end of file +?> diff --git a/e107_core/shortcodes/single/search.sc b/e107_core/shortcodes/single/search.sc index 0675eb171..17c245611 100644 --- a/e107_core/shortcodes/single/search.sc +++ b/e107_core/shortcodes/single/search.sc @@ -5,7 +5,11 @@ e107::includeLan(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php"); $text = ""; if (!isset($SEARCH_SHORTCODE)) { - if (file_exists(THEME."search_template.php")) + if (file_exists(THEME."templates/search_template.php")) + { + include(THEME."templates/search_template.php"); + } + elseif (file_exists(THEME."search_template.php")) { include(THEME."search_template.php"); } diff --git a/e107_core/templates/admin_icons_template.php b/e107_core/templates/admin_icons_template.php index 6f64570f0..760ff12eb 100644 --- a/e107_core/templates/admin_icons_template.php +++ b/e107_core/templates/admin_icons_template.php @@ -440,7 +440,7 @@ if (!defined('E_16_FAILEDLOGIN')) { define("E_32_TRUE", ""); - + define("ADMIN_CHILD_ICON", ''); // must use single quotes. define("ADMIN_TRUE_ICON", ""); define("ADMIN_FALSE_ICON", ""); define("ADMIN_WARNING_ICON", ""); diff --git a/e107_core/templates/header_default.php b/e107_core/templates/header_default.php index 823e45e65..9cf7e7ffb 100644 --- a/e107_core/templates/header_default.php +++ b/e107_core/templates/header_default.php @@ -168,10 +168,6 @@ echo e107::getUrl()->response()->renderMeta()."\n"; // render all the e107::meta echo "".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME') ? PAGE_NAME.' - ' : "")).SITENAME."\n\n"; - - - - // // D: Register CSS // @@ -227,7 +223,7 @@ if (is_array($pref['e_meta_list'])) if(isset($pref['sitebutton'])) { - $appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',true); + $appleIcon = $tp->thumbUrl($pref['sitebutton'],'w=144&h=144&crop=1',null, true); echo "\n"; unset($appleIcon); } @@ -273,30 +269,21 @@ else // Theme default $e_js->themeCSS(THEME_STYLE, $css_default); - - /* Moved to class2 and defined as THEME_STYLE - if($e_pref->get('themecss') && file_exists(THEME.$e_pref->get('themecss'))) + + // Support for style.css - override theme default CSS + if(file_exists(THEME."style_custom.css")) { - //echo "\n"; - $e_js->themeCSS($e_pref->get('themecss'), $css_default); + $e_js->themeCSS('style_custom.css',$css_default); } - else - { - // echo "\n"; - $e_js->themeCSS('style.css', $css_default); - } - */ + // Support for print and handheld media - override theme default CSS if(file_exists(THEME."style_mobile.css")) { - //echo "\n"; - //$css_default = "screen"; $e_js->themeCSS('style_mobile.css', 'handheld'); } + if(file_exists(THEME."style_print.css")) { - // echo "\n"; - // $css_default = "screen"; $e_js->themeCSS('style_print.css', 'print'); } } @@ -474,7 +461,7 @@ if(function_exists('theme_head')) echo theme_head(); } -// FIXME description and keywords meta tags shouldn't be sent on all pages +/* @deprecated */ $diz_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_description'][e_LANGUAGE]) ? $pref['meta_description'][e_LANGUAGE]." " : ""; $key_merge = (defined("META_MERGE") && META_MERGE != FALSE && $pref['meta_keywords'][e_LANGUAGE]) ? $pref['meta_keywords'][e_LANGUAGE]."," : ""; @@ -502,9 +489,15 @@ function render_meta($type) } } -echo (defined("META_DESCRIPTION")) ? "\n\n" : render_meta('description'); -echo (defined("META_KEYWORDS")) ? "\n\n" : render_meta('keywords'); - +// legay meta-tag checks. +if(empty(e107::getUrl()->response()->getMetaKeywords())) +{ + echo (defined("META_KEYWORDS")) ? "\n\n" : render_meta('keywords'); +} +if(empty(e107::getUrl()->response()->getMetaDescription())) +{ + echo (defined("META_DESCRIPTION")) ? "\n\n" : render_meta('description'); +} //echo render_meta('copyright'); //echo render_meta('author'); diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index 724a4ec79..bfc7fea18 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -1092,7 +1092,7 @@ class e_admin_dispatcher if(!$this->checkModeAccess($currentMode)) { $request->setAction('e403'); - e107::getMessage()->addError('You don\'t have permissions to view this page.') + e107::getMessage()->addError(LAN_NO_PERMISSIONS) ->addDebug('Mode access restriction triggered.'); return false; } @@ -1103,7 +1103,7 @@ class e_admin_dispatcher if(!$this->checkRouteAccess($route)) { $request->setAction('e403'); - e107::getMessage()->addError('You don\'t have permissions to view this page.') + e107::getMessage()->addError(LAN_NO_PERMISSIONS) ->addDebug('Route access restriction triggered:'.$route); return false; } @@ -1675,7 +1675,7 @@ class e_admin_controller if(!empty($this->disallow) && in_array($currentAction, $this->disallow)) { $request->setAction('e403'); - e107::getMessage()->addError('You don\'t have permissions to view this page.') + e107::getMessage()->addError(LAN_NO_PERMISSIONS) ->addDebug('Controller action disallowed restriction triggered.'); return false; } @@ -1684,7 +1684,7 @@ class e_admin_controller if(!empty($this->allow) && !in_array($currentAction, $this->allow)) { $request->setAction('e403'); - e107::getMessage()->addError('You don\'t have permissions to view this page.') + e107::getMessage()->addError(LAN_NO_PERMISSIONS) ->addDebug('Controller action not in allowed list restriction triggered.'); return false; } @@ -2167,7 +2167,7 @@ class e_admin_controller public function E404Page() { - return '
'.LAN_UI_404_BODY_ERROR.'
'; // TODO - lan + return '
'.LAN_UI_404_BODY_ERROR.'
'; } @@ -2184,7 +2184,7 @@ class e_admin_controller public function E403Page() { - return '
'.LAN_UI_403_BODY_ERROR.'
'; // TODO - lan + return '
'.LAN_UI_403_BODY_ERROR.'
'; } @@ -2345,6 +2345,10 @@ class e_admin_controller_ui extends e_admin_controller /** * @var array UI field data */ + + + protected $pid; + protected $fields = array(); /** @@ -2415,6 +2419,16 @@ class e_admin_controller_ui extends e_admin_controller * @var string field containing the order number */ protected $sortField = null; + + /** + * @var string field containing the order number + */ + protected $treePrefix = null; + + /** + * @var string field containing the parent field + */ + protected $sortParent = null; /** * @var int reorder step @@ -2611,6 +2625,26 @@ class e_admin_controller_ui extends e_admin_controller { return $this->sortField; } + + /** + * Get Sort Field data + * @return string + */ + public function getSortParent() + { + return $this->sortParent; + } + + + + /** + * Get Sort Field data + * @return string + */ + public function getTreePrefix() + { + return $this->treePrefix; + } /** * Get Tab data @@ -3140,7 +3174,22 @@ class e_admin_controller_ui extends e_admin_controller switch($trigger[0]) { + case 'sefgen': + $field = $trigger[1]; + $value = $trigger[2]; + + //handleListBatch(); for custom handling of all field names + if(empty($selected)) return $this; + $method = 'handle'.$this->getRequest()->getActionName().'SefgenBatch'; + if(method_exists($this, $method)) // callback handling + { + $this->$method($selected, $field, $value); + } + break; + + case 'export': + if(empty($selected)) return $this; $method = 'handle'.$this->getRequest()->getActionName().'ExportBatch'; if(method_exists($this, $method)) // callback handling { @@ -3246,8 +3295,7 @@ class e_admin_controller_ui extends e_admin_controller // check userclass manager class if (!isset($e_userclass->class_tree[$id]) || !$user->checkClass($e_userclass->class_tree[$id])) { - // TODO lan - $msg = $tp->lanVars("You don't have management permissions on [x]",$label); + $msg = $tp->lanVars(LAN_NO_ADMIN_PERMISSION,$label); $this->getTreeModel()->addMessageWarning($msg); unset($classes[$id],$msg); } @@ -3304,11 +3352,11 @@ class e_admin_controller_ui extends e_admin_controller case 'datestamp': $dateConvert = array( - "hour" => "1 hour ago", - "day" => "24 hours ago", - "week" => "1 week ago", - "month" => "1 month ago", - "year" => "1 year ago" + "hour" => LAN_UI_FILTER_PAST_HOUR,//"1 hour ago",//etc + "day" => LAN_UI_FILTER_PAST_24_HOURS, + "week" => LAN_UI_FILTER_PAST_WEEK, + "month" => LAN_UI_FILTER_PAST_MONTH, + "year" => LAN_UI_FILTER_PAST_YEAR ); $ky = $filter[2]; @@ -3998,10 +4046,24 @@ class e_admin_controller_ui extends e_admin_controller $qry .= "\n".implode("\n", $joins); } } - else + else // default listQry { + if(!empty($listQry)) + { + $qry = $this->parseCustomListQry($listQry); + } + elseif($this->sortField && $this->sortParent) // automated 'tree' sorting. + { + // $qry = "SELECT SQL_CALC_FOUND_ROWS a. *, CASE WHEN a.".$this->sortParent." = 0 THEN a.".$this->sortField." ELSE b.".$this->sortField." + (( a.".$this->sortField.")/1000) END AS treesort FROM `#".$this->table."` AS a LEFT JOIN `#".$this->table."` AS b ON a.".$this->sortParent." = b.".$this->pid; + $qry = $this->getParentChildQry(); + $this->listOrder = '_treesort '; // .$this->sortField; + // $this->orderStep = ($this->orderStep === 1) ? 100 : $this->orderStep; + } + else + { + $qry = "SELECT SQL_CALC_FOUND_ROWS ".$tableSFields." FROM ".$tableFrom; + } - $qry = $listQry ? $this->parseCustomListQry($listQry) : "SELECT SQL_CALC_FOUND_ROWS ".$tableSFields." FROM ".$tableFrom; } // group field - currently auto-added only if there are joins @@ -4118,6 +4180,94 @@ class e_admin_controller_ui extends e_admin_controller return $qry; } + + /** + * Return a Parent/Child SQL Query based on sortParent and sortField variables + * @param bool|false $orderby - include 'ORDER BY' in the qry. + * @return string + */ + public function getParentChildQry($orderby=false) + { + + $parent= $this->getSortParent(); + $table = $this->getTableName(); + $pid = $this->getPrimaryName(); + $order = $this->getSortField(); + + + + $sql = "DROP FUNCTION IF EXISTS `getDepth` ;"; + + e107::getDb()->gen($sql); + + + $sql = " + CREATE FUNCTION `getDepth` (project_id INT) RETURNS int + BEGIN + DECLARE depth INT; + SET depth=1; + + WHILE project_id > 0 DO + + SELECT IFNULL(".$parent.",-1) + INTO project_id + FROM ( SELECT ".$parent." FROM `#".$table."` WHERE ".$pid." = project_id) AS t; + + IF project_id > 0 THEN + SET depth = depth + 1; + END IF; + + END WHILE; + + RETURN depth; + + END + ; + "; + + + e107::getDb()->gen($sql); + + $sql = "DROP FUNCTION IF EXISTS `getTreeSort`;"; + + e107::getDb()->gen($sql); + $sql = " + CREATE FUNCTION getTreeSort(incid INT) + RETURNS CHAR(255) + BEGIN + SET @parentstr = CONVERT(incid, CHAR); + SET @parent = -1; + label1: WHILE @parent != 0 DO + SET @parent = (SELECT ".$parent." FROM `#".$table."` WHERE ".$pid." =incid); + SET @order = (SELECT ".$order." FROM `#".$table."` WHERE ".$pid." =incid); + SET @parentstr = CONCAT(if(@parent = 0,'',@parent), LPAD(@order,4,0), @parentstr); + SET incid = @parent; + END WHILE label1; + + RETURN @parentstr; + END + ; + + "; + + + e107::getDb()->gen($sql); + + $qry = "SELECT SQL_CALC_FOUND_ROWS *, getTreeSort(".$pid.") as _treesort, getDepth(".$pid.") as _depth FROM `#".$table."` "; + + if($orderby === true) + { + $qry .= " ORDER BY _treesort"; + } + + return $qry; + } + + + + + + /** * Manage submit item * Note: $callbackBefore will break submission if returns false @@ -4164,7 +4314,26 @@ class e_admin_controller_ui extends e_admin_controller // - Autoincrement sortField on 'Create'. - if(($_posted['etrigger_submit'] === 'create') && !empty($this->sortField) && empty($this->sortParent) && empty($_posted[$this->sortField]) ) + + // Prevent parent being assigned as self. + if(!empty($this->sortParent) && $this->getAction() === 'edit' && ($model->getId() == $_posted[$this->sortParent] ) ) + { + $vars = array( + 'x'=> $this->getFieldAttr($this->sortParent,'title'), + 'y'=> $this->getFieldAttr($this->pid,'title'), + ); + + $message = e107::getParser()->lanVars(LAN_UI_X_CANT_EQUAL_Y, $vars); + $model->addMessageWarning($message); + $model->setMessages(); + $this->getUI()->addWarning($this->sortParent); + return false; + } + + + + + if(($this->getAction() === 'create') && !empty($this->sortField) && empty($this->sortParent) && empty($_posted[$this->sortField]) ) { $incVal = e107::getDb()->max($this->table, $this->sortField) + 1; @@ -4296,6 +4465,7 @@ class e_admin_ui extends e_admin_controller_ui protected $sortField; protected $sortParent; protected $orderStep; + protected $treePrefix; /** @@ -4601,6 +4771,59 @@ class e_admin_ui extends e_admin_controller_ui } + /** + * Batch Export trigger + * @param array $selected + * @return void + */ + protected function handleListSefgenBatch($selected, $field, $value) + { + + $tree = $this->getTreeModel(); + $c= 0; + foreach($selected as $id) + { + if(!$tree->hasNode($id)) + { + e107::getMessage()->addError('Item #ID '.htmlspecialchars($id).' not found.'); + continue; + } + + $model = $tree->getNode($id); + + $name = $model->get($value); + + $sef = eHelper::title2sef($name,'dashl'); + + + + + + $model->set($field, $sef); + + + $model->save(); + + $data = $model->getData(); + + if($model->isModified()) + { + $this->getModel()->setData($data)->save(false,true); + $c++; + } + } + + + + $caption = e107::getParser()->lanVars(LAN_UI_BATCH_BOOL_SUCCESS, $c, true); + e107::getMessage()->addSuccess($caption); + + // e107::getMessage()->moveToSession(); + // redirect + // $this->redirect(); + } + + /** * Batch URL trigger @@ -4669,32 +4892,32 @@ class e_admin_ui extends e_admin_controller_ui $res = $sql->insert('links', $linkArray); - // FIXME lans if($res !== FALSE) { - e107::getMessage()->addSuccess('Created Sitelink: '.($name ? $name : 'n/a').""); - $scount++; + e107::getMessage()->addSuccess(LAN_CREATED.": ".LAN_SITELINK.": ".($name ? $name : 'n/a')); + $scount++; } else { if($sql->getLastErrorNumber()) { - e107::getMessage()->addError('SQL Link Creation Error'); //TODO - Lan + e107::getMessage()->addError(LAN_CREATED_FAILED.": ".LAN_SITELINK.": ".$name.": ".LAN_SQL_ERROR); e107::getMessage()->addDebug('SQL Link Creation Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText()); - } + } else { - e107::getMessage()->addError('Unknown error: '.$name." not added"); + e107::getMessage()->addError(LAN_CREATED_FAILED.": ".LAN_SITELINK.": ".$name.": ".LAN_UNKNOWN_ERROR);//Unknown Error } } - + } - if($scount > 0) - { - e107::getMessage()->addSuccess("
{$scount} new sitelinks were added but are currently unassigned. You should now modify these links to your liking.

Modify Links"); + if($scount > 0) + { + e107::getMessage()->addSuccess(LAN_CREATED." (".$scount.") ".ADLAN_138); + e107::getMessage()->addSuccess("".LAN_CONFIGURE." ".ADLAN_138.""); return $scount; - } + } return false; @@ -4749,30 +4972,29 @@ class e_admin_ui extends e_admin_controller_ui $res = $sql->insert('featurebox', $fbArray); - // FIXME lans if($res !== FALSE) { - e107::getMessage()->addSuccess('Created Featurebox Item: '.($name ? $name : 'n/a').""); - $scount++; + e107::getMessage()->addSuccess(LAN_CREATED.": ".LAN_PLUGIN_FEATUREBOX_NAME.": ".($name ? $name : 'n/a')); + $scount++; } else { if($sql->getLastErrorNumber()) { - e107::getMessage()->addError('SQL Featurebox Creation Error'); //TODO - Lan - e107::getMessage()->addDebug('SQL Featurebox Creation Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText()); + e107::getMessage()->addError(LAN_CREATED_FAILED.": ".LAN_PLUGIN_FEATUREBOX_NAME.": ".$name.": ".LAN_SQL_ERROR); + e107::getMessage()->addDebug('SQL Featurebox Creation Error #'.$sql->getLastErrorNumber().': '.$sql->getLastErrorText()); } else { - e107::getMessage()->addError('Unknown error: '.$name." not added"); + e107::getMessage()->addError(LAN_CREATED_FAILED.": ".$name.": ".LAN_UNKNOWN_ERROR); } } - } if($scount > 0) { - e107::getMessage()->addSuccess("
{$scount} new featurebox items were added but are currently unassigned. You should now modify these items to your liking.

Modify Featurebox Items"); + e107::getMessage()->addSuccess(LAN_CREATED." (".$scount.") ".LAN_PLUGIN_FEATUREBOX_NAME); + e107::getMessage()->addSuccess(""); return $scount; } @@ -4891,8 +5113,8 @@ class e_admin_ui extends e_admin_controller_ui } else { - // TODO lan - $this->getTreeModel()->addMessageWarning("Comma list is empty, aborting.")->setMessages(); + $this->getTreeModel()->addMessageWarning(LAN_UPDATED_FAILED)->setMessages();//"Comma list is empty, aborting." + $this->getTreeModel()->addDebug(LAN_UPDATED_FAILED.": Comma list is empty, aborting.")->setMessages(); } break; @@ -4984,7 +5206,10 @@ class e_admin_ui extends e_admin_controller_ui { return; } - + + + + $cnt = $this->getTreeModel()->update($field, $val, $selected, true, false); if($cnt) { @@ -5139,7 +5364,7 @@ class e_admin_ui extends e_admin_controller_ui { header($protocol.': 404 Not Found', true, 404); header("Status: 404 Not Found", true, 404); - echo 'Field not found'; // FIXME lan + echo LAN_FIELD.": ".$this->fields[$_POST['name']].": ".LAN_NOT_FOUND; // Field: x: not found! $this->logajax('Field not found'); return; } @@ -5154,7 +5379,7 @@ class e_admin_ui extends e_admin_controller_ui { header($protocol.': 403 Forbidden', true, 403); header("Status: 403 Forbidden", true, 403); - echo 'Forbidden'; // FIXME lan + echo ADLAN_86; //Forbidden $this->logajax("Forbidden"); return; } @@ -5255,10 +5480,18 @@ class e_admin_ui extends e_admin_controller_ui $updated[] = "#".$id." -- ".$this->sortField." = ".$c; } // echo($sql->getLastQuery()."\n"); - $c += $step; + $c++; // += $step; } + + if(!empty($this->sortParent) && !empty($this->sortField) ) + { + return null; + } + + //file_put_contents(e_LOG."sortAjax.log", print_r($_POST['all'],true)); + // Increment every other record after the current page of records. // $changed = (intval($_POST['neworder']) * $step) + $from ; $changed = $c - $step; @@ -5268,10 +5501,10 @@ class e_admin_ui extends e_admin_controller_ui // ------------ Fix Child Order when parent is used. ---------------- - +/* if(!empty($this->sortParent) && !empty($this->sortField) ) // Make sure there is space for at least 99 { - + $parent = array(); $data2 = $sql->retrieve($this->table,$this->pid.','.$this->sortField,$this->sortParent .' = 0',true); foreach($data2 as $val) @@ -5307,7 +5540,7 @@ class e_admin_ui extends e_admin_controller_ui } - +*/ $this->afterSort($result, $_POST); // e107::getLog()->addDebug(print_r($_POST,true))->toFile('SortAjax','Admin-UI Ajax Sort Log', true); @@ -5823,6 +6056,7 @@ class e_admin_form_ui extends e_form protected $_controller = null; + /** * Constructor * @param e_admin_ui $controller @@ -5876,8 +6110,77 @@ class e_admin_form_ui extends e_form { } + + /** + * @todo Get a 'depth/level' field working with mysql and change the 'level' accordingly + * @param mixed $curVal + * @param string $mode read|write|inline + * @param array $parm + * @return array|string + */ + public function treePrefix($curVal, $mode, $parm) + { + $controller = $this->getController(); + $parentField = $controller->getSortParent(); + $treePrefixField = $controller->getTreePrefix(); + $parent = $controller->getListModel()->get($parentField); + $level = $controller->getListModel()->get("_depth"); + + + if($mode === 'read') + { + + $inline = $this->getController()->getFieldAttr($treePrefixField,'inline'); + + if($inline === true) + { + return $curVal; + } + + $level_image = $parent ? str_replace('level-x','level-'.$level, ADMIN_CHILD_ICON) : ''; + + return ($parent) ? $level_image.$curVal : $curVal; + + } + + + if($mode === 'inline') + { + $ret = array('inlineType'=>'text'); + + if(!empty($parent)) + { + $ret['inlineParms'] = array('pre'=> str_replace('level-x','level-'.$level, ADMIN_CHILD_ICON)); + } + + + return $ret; + } + + +/* + if($mode == 'write') // not used. + { + // return $frm->text('forum_name',$curVal,255,'size=xxlarge'); + } + + if($mode == 'filter') + { + return; + } + if($mode == 'batch') + { + return; + } +*/ + + + + + } + + /** - * TODO - lans * Generic DB Record Creation Form. * @return string */ @@ -5942,7 +6245,6 @@ class e_admin_form_ui extends e_form } /** - * TODO - lans * Generic Settings Form. * @return string */ @@ -6033,6 +6335,22 @@ class e_admin_form_ui extends e_form $fields['options']['sort'] = false; } + if($treefld = $controller->getTreePrefix()) + { + $fields[$treefld]['type'] = 'method'; + $fields[$treefld]['method'] = 'treePrefix'; /* @see e_admin_form_ui::treePrefix(); */ + + $tr = $controller->getTreeModel()->toArray(); + + foreach($tr as $row) + { + e107::getDebug()->log($row[$treefld].' > '.$row['_treesort']); + } + + } + + + // ------------------------------------------ $coreBatchOptions = array( @@ -6040,7 +6358,8 @@ class e_admin_form_ui extends e_form 'copy' => $controller->getBatchCopy(), 'url' => $controller->getBatchLink(), 'featurebox' => $controller->getBatchFeaturebox(), - 'export' => $controller->getBatchExport() + 'export' => $controller->getBatchExport(), + ); @@ -6399,8 +6718,8 @@ class e_admin_form_ui extends e_form
"; $selectStart = "
- -
+ ".ADMIN_CHILD_ICON." +
".$this->select_open('etrigger_batch', array('class' => 'tbox form-control input-large select batch e-autosubmit reset', 'id' => false))." ".$this->option(LAN_BATCH_LABEL_SELECTED, '', false); @@ -6414,6 +6733,10 @@ class e_admin_form_ui extends e_form $selectOpt .= !empty($options['url']) ? $this->option(LAN_UI_BATCH_CREATELINK, 'url', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; $selectOpt .= !empty($options['featurebox']) ? $this->option(LAN_PLUGIN_FEATUREBOX_BATCH, 'featurebox', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : ''; + // if(!empty($parms['sef']) + + + if(!empty($customBatchOptions)) { foreach($customBatchOptions as $key=>$val) @@ -6499,6 +6822,17 @@ class e_admin_form_ui extends e_form switch($val['type']) { + + case 'text'; + + if(!empty($parms['sef'])) + { + $option['sefgen__'.$key.'__'.$parms['sef']] = LAN_GENERATE; + } + + break; + + case 'bool': case 'boolean': //TODO modify description based on $val['parm] if(vartrue($parms['reverse'])) // reverse true/false values; @@ -6536,12 +6870,12 @@ class e_admin_form_ui extends e_form if(isset($options['addAll'])) { - $option['attach_all__'.$key] = vartrue($options['addAll'], '(add all)'); + $option['attach_all__'.$key] = vartrue($options['addAll'], "(".LAN_ADD_ALL.")"); unset($options['addAll']); } if(isset($options['clearAll'])) { - $_option['deattach_all__'.$key] = vartrue($options['clearAll'], '(clear all)'); + $_option['deattach_all__'.$key] = vartrue($options['clearAll'], "(".LAN_CLEAR_ALL.")"); unset($options['clearAll']); } @@ -6549,16 +6883,16 @@ class e_admin_form_ui extends e_form { foreach ($options as $value) { - $option['attach__'.$key.'__'.$value] = 'Add '.$value; - $_option['deattach__'.$key.'__'.$value] = 'Remove '.$value; + $option['attach__'.$key.'__'.$value] = LAN_ADD." ".$value; + $_option['deattach__'.$key.'__'.$value] = LAN_REMOVE." ".$value; } } else { foreach ($options as $value => $label) { - $option['attach__'.$key.'__'.$value] = 'Add '.$label; - $_option['deattach__'.$key.'__'.$value] = 'Remove '.$label; + $option['attach__'.$key.'__'.$value] = LAN_ADD." ".$label; + $_option['deattach__'.$key.'__'.$value] = LAN_REMOVE." ".$label; } } $option = array_merge($option, $_option); @@ -6648,14 +6982,12 @@ class e_admin_form_ui extends e_form break; case 'datestamp': - //TODO today, yesterday, this-month, last-month . - - $dateFilters = array ( + $dateFilters = array ( 'hour' => LAN_UI_FILTER_PAST_HOUR, - "day" => LAN_UI_FILTER_PAST_24_HOURS, - "week" => LAN_UI_FILTER_PAST_WEEK, - "month" => LAN_UI_FILTER_PAST_MONTH, - "year" => LAN_UI_FILTER_PAST_YEAR + "day" => LAN_UI_FILTER_PAST_24_HOURS, + "week" => LAN_UI_FILTER_PAST_WEEK, + "month" => LAN_UI_FILTER_PAST_MONTH, + "year" => LAN_UI_FILTER_PAST_YEAR ); foreach($dateFilters as $k => $name) @@ -6679,14 +7011,13 @@ class e_admin_form_ui extends e_form if($type === 'batch') { - // FIXME Lan foreach ($classes as $k => $v) { - $option['ucadd__'.$key.'__'.$k] = LAN_ADD.' '.$v; - $_option['ucremove__'.$key.'__'.$k] = 'Remove '.$v; + $option['ucadd__'.$key.'__'.$k] = LAN_ADD.' '.$v; + $_option['ucremove__'.$key.'__'.$k] = LAN_REMOVE." ".$v; } - $option['ucaddall__'.$key] = '(add all)'; - $_option['ucdelall__'.$key] = '(clear all)'; + $option['ucaddall__'.$key] = "(".LAN_ADD_ALL.")"; + $_option['ucdelall__'.$key] = "(".LAN_CLEAR_ALL.")"; $option = array_merge($option, $_option); } else @@ -6741,7 +7072,7 @@ class e_admin_form_ui extends e_form } else { - $option[$key.'__'.$k] = vartrue($data['user_name'],'Unknown'); + $option[$key.'__'.$k] = vartrue($data['user_name'],LAN_UNKNOWN); } diff --git a/e107_handlers/db_debug_class.php b/e107_handlers/db_debug_class.php index ae6413392..a6f9b19a3 100644 --- a/e107_handlers/db_debug_class.php +++ b/e107_handlers/db_debug_class.php @@ -782,7 +782,7 @@ class e107_db_debug { $message = "
".print_r($message,true)."
"; } - if (!E107_DBG_BASIC && !E107_DBG_ALLERRORS && !E107_DBG_SQLDETAILS && !E107_DBG_NOTICES) + if (!deftrue('E107_DBG_BASIC') && !deftrue('E107_DBG_ALLERRORS') && !deftrue('E107_DBG_SQLDETAILS') && !deftrue('E107_DBG_NOTICES')) { return false; } diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 30a85f4dd..6013776bc 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2416,6 +2416,73 @@ class e107 return FALSE; } + /** + * Retrieves the e_url config - new v2.1.6 + * @return array + */ + public static function getUrlConfig($mode='config') + { + $new_addon = array(); + + $filename = 'e_url'; + $elist = self::getPref($filename.'_list'); + $className = substr($filename, 2); // remove 'e_' + $methodName = 'config'; + + $profile = null; // for future use. + + if(!empty($elist)) + { + foreach(array_keys($elist) as $key) + { + if(is_readable(e_PLUGIN.$key.'/'.$filename.'.php')) + { + include_once(e_PLUGIN.$key.'/'.$filename.'.php'); + + $class_name = $key.'_'.$className; + + if(is_object($class_name)) + { + $obj = $class_name; + $class_name = get_class($obj); + } + else + { + $obj = new $class_name; + } + + if($mode === 'alias') + { + if(!empty($obj->alias)) + { + $new_addon[$key] = $obj->alias; + } + + continue; + } + + $array = self::callMethod($obj, $methodName,$profile); + + if($array) + { + foreach($array as $k=>$v) + { + if(empty($v['alias']) && !empty($obj->alias)) + { + $v['alias'] = $obj->alias; + } + $new_addon[$key][$k] = $v; + + } + + } + + } + } + } + + return $new_addon; + } /** * Get theme name or path. @@ -3157,7 +3224,7 @@ class e107 if(!$tmp = self::getRegistry('core/e107/addons/e_url')) { - $tmp = self::getAddonConfig('e_url'); + $tmp = self::getUrlConfig(); self::setRegistry('core/e107/addons/e_url',$tmp); } @@ -3165,6 +3232,8 @@ class e107 $pref = self::getPref('e_url_alias'); $sefActive = self::getPref('e_url_list'); + $rootNamespace = self::getPref('url_main_module'); + if(is_string($options)) // backwards compat. { @@ -3185,12 +3254,22 @@ class e107 $options['fragment'] = '#' . $options['fragment']; } - if(varset($tmp[$plugin][$key]['sef'])) + if(!empty($tmp[$plugin][$key]['sef'])) { if(!empty($tmp[$plugin][$key]['alias'])) { $alias = (!empty($pref[e_LAN][$plugin][$key])) ? $pref[e_LAN][$plugin][$key] : $tmp[$plugin][$key]['alias']; - $tmp[$plugin][$key]['sef'] = str_replace('{alias}', $alias, $tmp[$plugin][$key]['sef']); + + if(!empty($rootNamespace) && $rootNamespace === $plugin) + { + $replaceAlias = array('{alias}\/','{alias}/'); + $tmp[$plugin][$key]['sef'] = str_replace($replaceAlias, '', $tmp[$plugin][$key]['sef']); + } + else + { + $tmp[$plugin][$key]['sef'] = str_replace('{alias}', $alias, $tmp[$plugin][$key]['sef']); + } + } diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 488f64a17..0380f9284 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -1350,23 +1350,25 @@ class e_parse extends e_parser $text = html_entity_decode($text,ENT_QUOTES,'utf-8'); - return mb_strimwidth($text, 0, $len, $more); + if(function_exists('mb_strimwidth')) + { + return mb_strimwidth($text, 0, $len, $more); + } - // $ret = $this->usubstr($text, 0, $len); + $ret = $this->usubstr($text, 0, $len); // search for possible broken html entities // - if an & is in the last 8 chars, removing it and whatever follows shouldn't hurt // it should work for any characters encoding -/* - $leftAmp = $this->ustrrpos($this->usubstr($ret, -8), '&'); if($leftAmp) { $ret = $this->usubstr($ret, 0, $this->ustrlen($ret) - 8 + $leftAmp); } - return $ret.$more;*/ + return $ret.$more; + } @@ -1539,17 +1541,25 @@ class e_parse extends e_parser } // Turn off a few things if not enabled in options - if(!vartrue($pref['smiley_activate'])) + if(empty($pref['smiley_activate'])) { - $opts['emotes'] = FALSE; + $opts['emotes'] = false; } - if(!vartrue($pref['make_clickable'])) + + if(empty($pref['make_clickable'])) { - $opts['link_click'] = FALSE; + $opts['link_click'] = false; } - if(!vartrue($pref['link_replace'])) + + if(empty($pref['link_replace'])) { - $opts['link_replace'] = FALSE; + $opts['link_replace'] = false; + } + + if($this->isHtml($text)) //BC FIx for when HTML is saved without [html][/html] + { + $opts['nobreak'] = true; + $text = trim($text); } $fromadmin = $opts['fromadmin']; @@ -1568,7 +1578,7 @@ class e_parse extends e_parser $text = strip_tags($text); } - if (MAGIC_QUOTES_GPC == TRUE) // precaution for badly saved data. + if (MAGIC_QUOTES_GPC === true) // precaution for badly saved data. { $text = stripslashes($text); } @@ -1590,7 +1600,7 @@ class e_parse extends e_parser - if ($parseBB == FALSE) + if ($parseBB == false) { $content = array($text); } @@ -4077,17 +4087,25 @@ class e_parser */ function isBBcode($text) { - $bbsearch = array('[/h]','[/b]','[/link]', '[/right]'); - - if(str_replace($bbsearch,'',$text)) - { - return true; - } - else + if(preg_match('#(?<=<)\w+(?=[^<]*?>)#', $text)) { return false; } + $bbsearch = array('[/h]', '[/b]', '[/link]', '[/right]', '[/center]', '[/flash]', '[/code]', '[/table]'); + + foreach($bbsearch as $v) + { + if(strpos($text,$v)!==false) + { + return true; + } + + } + + return false; + + } diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 9e0259750..9a8a70ba2 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -66,6 +66,7 @@ class e_form protected $_tabindex_counter = 0; protected $_tabindex_enabled = true; protected $_cached_attributes = array(); + protected $_field_warnings = array(); @@ -84,6 +85,13 @@ class e_form $this->setRequiredString(''); } + + public function addWarning($field) + { + $this->_field_warnings[] = $field; + + } + /** * Open a new form * @param string name @@ -802,10 +810,22 @@ class e_form function number($name, $value=0, $maxlength = 200, $options = array()) { if(is_string($options)) parse_str($options, $options); - if (empty($options['maxlength'])) $maxlength = $options['maxlength']; + + if(!empty($options['maxlength'])) + { + $maxlength = $options['maxlength']; + } + unset($options['maxlength']); - if(empty($options['size'])) $options['size'] = 15; - if(empty($options['class'])) $options['class'] = 'tbox number e-spinner input-small '; + + if(empty($options['size'])) + { + $options['size'] = 15; + } + if(empty($options['class'])) + { + $options['class'] = 'tbox number e-spinner input-small '; + } if(!empty($options['size'])) { @@ -2995,9 +3015,14 @@ class e_form $text = '