diff --git a/class2.php b/class2.php index 13a94df84..eff84b133 100644 --- a/class2.php +++ b/class2.php @@ -823,6 +823,7 @@ if (!function_exists('checkvalidtheme')) { // arg1 = theme to check //global $ADMIN_DIRECTORY, $tp, $e107; + global $sql; $e107 = e107::getInstance(); $tp = e107::getParser(); $ADMIN_DIRECTORY = $e107->getFolder('admin'); @@ -846,15 +847,27 @@ if (!function_exists('checkvalidtheme')) define('PREVIEWTHEMENAME', $themeArray[$id]); define('THEME', e_THEME.$themeArray[$id].'/'); define('THEME_ABS', e_THEME_ABS.$themeArray[$id].'/'); - + + $legacy = (file_exists( e_THEME_ABS.$themeArray[$id].'/theme.xml') === false); + + define('THEME_LEGACY',$legacy); return; } + + $sql->db_Mark_time("Theme Check"); + if (@fopen(e_THEME.$theme_check.'/theme.php', 'r')) + // if (is_readable(e_THEME.$theme_check.'/theme.php')) { define('THEME', e_THEME.$theme_check.'/'); define('THEME_ABS', e_THEME_ABS.$theme_check.'/'); + + $legacy = (file_exists(e_THEME.$theme_check.'/theme.xml') === false); + + define('THEME_LEGACY',$legacy); + $e107->site_theme = $theme_check; } else @@ -889,6 +902,8 @@ if (!function_exists('checkvalidtheme')) } } + $sql->db_Mark_time("Theme Check End"); + $themes_dir = $e107->getFolder('themes'); $e107->http_theme_dir = "{$e107->server_path}{$themes_dir}{$e107->site_theme}/"; } @@ -916,6 +931,8 @@ if (!class_exists('e107table', false)) private $adminThemeClass = ''; public $frontend = null; private $uniqueId = null; + private $content = array(); + private $contentTypes = array('header','footer','text','title','image', 'list'); function __construct() @@ -944,6 +961,23 @@ if (!class_exists('e107table', false)) } + /** + * Set Advanced Menu content (beyond just $caption and $text) + * @param string $type header|footer|text|title|image + * @param string $val + */ + public function setContent($type, $val) + { + if(!in_array($type,$this->contentTypes)) + { + return false; + } + + $this->content[$type] = (string) $val; + } + + + /** * @param $caption string caption text * @param $text string @@ -1017,17 +1051,27 @@ if (!class_exists('e107table', false)) { $thm = new $this->themeClass(); } + + $options = $this->content; + + $options['uniqueId'] = $this->uniqueId; + $options['menuArea'] = $this->eMenuArea; + $options['menuCount'] = $this->eMenuCount; + $options['menuTotal'] = varset($this->eMenuTotal[$this->eMenuArea]); + $options['setStyle'] = $this->eSetStyle; + if(is_object(vartrue($thm))) { - $thm->tablestyle($caption, $text, $mode, array('uniqueId'=>$this->uniqueId, 'menuArea'=>$this->eMenuArea, 'menuCount'=>$this->eMenuCount, 'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]), 'setStyle'=>$this->eSetStyle)); + $thm->tablestyle($caption, $text, $mode, $options); } else { - tablestyle($caption, $text, $mode, array('uniqueId'=>$this->uniqueId, 'menuArea'=>$this->eMenuArea,'menuCount'=>$this->eMenuCount,'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]),'setStyle'=>$this->eSetStyle)); + tablestyle($caption, $text, $mode, $options); } $this->uniqueId = null; + $this->content = array(); } @@ -1673,10 +1717,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; @@ -1869,6 +1934,7 @@ function init_session() define('USERIMAGE', $user->get('user_image')); define('USERPHOTO', $user->get('user_sess')); define('USERJOINED', $user->get('user_join')); + define('USERCURRENTVISIT', $user->get('user_currentvisit')); define('USERVISITS', $user->get('user_visits')); define('USERSIGNATURE', $user->get('user_signature')); diff --git a/e107_admin/admin.php b/e107_admin/admin.php index 4c93a6cb2..087d4c109 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -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; } @@ -303,7 +303,7 @@ class admin_start $lans = array('x'=>$link, 'y'=>LAN_PLUGIN); $message = $tp->lanVars(LAN_NEWER_VERSION_OF_X, $lans); - $message .= " ".$tp->toGlyph('fa-cloud-download').""; + $message .= " ".$tp->toGlyph('fa-arrow-circle-o-down').""; e107::getMessage()->addInfo($message); @@ -350,7 +350,7 @@ class admin_start $caption = LAN_DOWNLOAD.": ".$versions[$folder]['name']." ".$versions[$folder]['version']; $message = $tp->lanVars(LAN_NEWER_VERSION_OF_X, $lans); - $message .= " ".$tp->toGlyph('fa-cloud-download').""; + $message .= " ".$tp->toGlyph('fa-arrow-circle-o-down').""; e107::getMessage()->addInfo($message); @@ -568,7 +568,7 @@ class admin_start if (count($this->allowed_types) == 0) { $this->allowed_types = array('zip' => 1, 'gz' => 1, 'jpg' => 1, 'png' => 1, 'gif' => 1, 'pdf'=>1); - $mes->addInfo("Setting default filetypes: ".implode(', ',array_keys($this->allowed_types))); + $mes->addDebug("Setting default filetypes: ".implode(', ',array_keys($this->allowed_types))); } } diff --git a/e107_admin/admin_log.php b/e107_admin/admin_log.php index 82a2321fa..7d376f7b7 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 { 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/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..24cd7c280 100644 --- a/e107_admin/boot.php +++ b/e107_admin/boot.php @@ -8,8 +8,6 @@ * * Admin BootLoader * - * $URL$ - * $Id$ */ if (!defined('e107_INIT')) @@ -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..b1b32b84b 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); +e107::coreLan('cpage', true); include_lan(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 @@ -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,6 +190,15 @@ class page_chapters_ui extends e_admin_ui function init() { + if(e_DEBUG === true) + { + 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; @@ -238,7 +259,38 @@ 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['chapter_fields'] = $this->processCustomFields($new_data['chapter_fields']); + + 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; } } @@ -281,7 +333,72 @@ class page_chapters_form_ui extends e_admin_form_ui } - + function chapter_fields($curVal,$mode,$parm) + { + + $frm = e107::getForm(); + + if($mode == 'read') + { + + } + + if($mode == 'write') + { + + $value= array(); + + if(!empty($curVal)) + { + $curVal = e107::unserialize($curVal); + $i = 0; + foreach($curVal as $k=>$v) + { + $v['key'] = $k; + $value[$i] = $v; + $i++; + } + } + + + $text = " + + + + + + + + + "; + + for ($i = 0; $i <= 10; $i++) + { + $fieldName = $this->text('chapter_fields['.$i.'][key]',$value[$i]['key'],30, array('pattern'=>'^[a-z0-9-]*')); + $fieldTitle = $this->text('chapter_fields['.$i.'][title]',$value[$i]['title'], 80); + $fieldType = $this->select('chapter_fields['.$i.'][type]',$this->getFieldTypes(),$value[$i]['type'], 'useValues=1&default=blank'); + $fieldParms = $this->text('chapter_fields['.$i.'][writeParms]',$value[$i]['writeParams'], 80, array('size'=>'xxlarge')); + + $text .= ""; + } + + $text .= "
".LAN_NAME."".LAN_TITLE."".LAN_TYPE."Params
".$fieldName."".$fieldTitle."".$fieldType."".$fieldParms."
"; + + // $text .= print_a($value,true); + + + return $text; + } + + if($mode == 'filter') + { + return; + } + if($mode == 'batch') + { + return; + } + } @@ -474,14 +591,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 +612,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 +648,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,7 +667,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 != '' "; // without any Order or Limit. @@ -594,7 +717,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']); @@ -619,8 +753,8 @@ class page_admin_ui extends e_admin_ui $sql = e107::getDb(); - - $sql->gen("SELECT chapter_id,chapter_name,chapter_parent FROM #page_chapters ORDER BY chapter_parent asc, chapter_order"); + $chapterFields = array(); + $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,16 +767,173 @@ 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] = e107::unserialize($row['chapter_fields']); + } + + } // asort($this->cats); $this->fields['page_chapter']['writeParms']['optArray'] = $this->cats; $this->fields['page_chapter']['writeParms']['size'] = 'xxlarge'; + if(e_DEBUG !== false && $this->getAction() === 'create') + { + $this->fields['page_chapter']['writeParms']['ajax'] = array('src'=>e_SELF."?mode=page&action=chapter-change",'target'=>'tabadditional'); + + } + + 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); + + if(empty($text)) + { + $text = "
There are no additional fields for the selected chapter
"; + } + + $ajax = e107::getAjax(); + + $commands = array(); + $commands[] = $ajax->commandInvoke('#tabadditional', 'html', array($text)); + + $ajax->response($commands); + exit; + } + + + } + private function initCustomFields($chap=null) + { + + $this->tabs['additional'] = "Additional Fields"; + + + + if(!empty($this->chapterFields[$chap])) + { + + + if(!empty($this->chapterFields[$chap])) + { + foreach($this->chapterFields[$chap] as $key=>$fld) + { + $fld['tab'] = 'additional'; + $fld['data'] = false; + + $this->fields['page_fields__'.$key] = $fld; + } + + } + } + + + } + + private function loadCustomFieldsData() + { + $row = e107::getDb()->retrieve('page', 'page_chapter, page_fields', 'page_id='.$this->getId()); + $chap = intval($row['page_chapter']); + $this->getModel()->set('page_fields', null); + + $curVal = e107::unserialize($row['page_fields']); + + if(!empty($this->chapterFields[$chap])) + { + foreach($this->chapterFields[$chap] as $key=>$fld) + { + $this->getModel()->set('page_fields__'.$key, $curVal[$key]); + } + + } + + } + + + 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(); + + if(!deftrue('e_DEBUG')) + { + return; + } + + + + $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 +1002,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 +1026,17 @@ class page_admin_ui extends e_admin_ui function beforeUpdate($newdata,$olddata, $id) { + + $newdata = $this->processCustomFieldData($newdata); + if(isset($newdata['menu_name'])) { $newdata['menu_name'] = preg_replace('/[^\w-*]/','',$newdata['menu_name']); } + + + return $newdata; } @@ -771,6 +1071,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..740974413 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') { @@ -1484,7 +1482,7 @@ class media_admin_ui extends e_admin_ui - if(vartrue($parm['search'])) + if(!empty($parm['search'])) { $filtered = array(); if(!empty($items)) @@ -2137,7 +2135,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..2859733f1 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 { @@ -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 39f73220c..c846458bd 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -2,25 +2,16 @@ /* * e107 website system * - * Copyright (C) 2008-2012 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) * * Site navigation administration * - * $URL$ - * $Id$ - */ - -/** - * @package e107 - * @subpackage admin - * @version $Id$ - * - * Manage site navigation links */ require_once("../class2.php"); + if (!getperms("I")) { e107::redirect('admin'); @@ -77,13 +68,13 @@ class links_admin_ui extends e_admin_ui public $sublink_data = null; protected $fields = array( - 'checkboxes' => array('title'=> '', 'width' => '3%','forced' => true, 'thclass' => 'center first','class' => 'center first'), - 'link_button' => array('title'=> LAN_ICON, 'type'=>'icon', 'width'=>'5%', 'thclass' => 'center', 'class'=>'center', 'writeParms'=>'glyphs=1'), - 'link_id' => array('title'=> LAN_ID, 'type'=>'method','readParms'=>'','noedit'=>TRUE), - 'link_name' => array('title'=> LCLAN_15, 'width'=>'auto','type'=>'text', 'inline'=>true, 'required' =>false, 'validate' => false), // not required as only an icon may be used. - 'link_category' => array('title'=> LAN_TEMPLATE, 'type' => 'dropdown', 'inline'=>true, 'batch'=>true, 'filter'=>true, 'width' => 'auto'), - - 'link_parent' => array('title'=> LCLAN_104, 'type' => 'method', 'data'=>'int', 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'), + 'checkboxes' => array('title'=> '', 'width' => '3%', 'forced' => true, 'thclass'=>'center first', 'class'=>'center first'), + 'link_button' => array('title'=> LAN_ICON, 'type'=>'icon', 'width'=>'5%', 'thclass'=>'center', 'class'=>'center', 'writeParms'=>'glyphs=1'), + 'link_id' => array('title'=> LAN_ID, 'type'=>'method', 'readParms'=>'', 'noedit'=>TRUE), + 'link_name' => array('title'=> LAN_NAME, 'type'=>'text', 'inline'=>true, 'required'=>false, 'validate'=>false, 'width'=>'auto'), // not required as only an icon may be used. + 'link_category' => array('title'=> LAN_TEMPLATE, 'type'=>'dropdown', 'inline'=>true, 'batch'=>true, 'filter'=>true, 'width'=>'auto'), + + 'link_parent' => array('title'=> LAN_PARENT, 'type' => 'method', 'data'=>'int', 'width'=>'auto', 'batch'=>true, 'filter'=>true, 'thclass'=>'left first'), 'link_url' => array('title'=> LAN_URL, 'width'=>'auto', 'type'=>'method', 'inline'=>true, 'required'=>true,'validate' => true, 'writeParms'=>'size=xxlarge'), 'link_sefurl' => array('title'=> LAN_SEFURL, 'type' => 'method', 'inline'=>false, 'width' => 'auto', 'help'=>LCLAN_107), 'link_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass','inline'=>true, 'writeParms' => 'classlist=public,guest,nobody,member,classes,admin,main', 'batch'=>true, 'filter'=>true, 'width' => 'auto'), diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php index 1fb6cee1f..64200ee84 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'=> Recipients, '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 1fb39bdaf..dfb34c0e2 100644 --- a/e107_admin/menus.php +++ b/e107_admin/menus.php @@ -16,15 +16,18 @@ if(isset($_GET['configure'])) define("USER_AREA", true); //Switch to desired layout define('THEME_LAYOUT', $_GET['configure']); - define('e_DEBUG', false); - define('E107_DEBUG_LEVEL', 0); - if(function_exists('xdebug_disable')) - { - xdebug_disable(); - } - @ini_set('display_errors', 0); - error_reporting(0); + if(empty($_GET['debug'])) + { + define('e_DEBUG', false); + define('E107_DEBUG_LEVEL', 0); + if(function_exists('xdebug_disable')) + { + xdebug_disable(); + } + @ini_set('display_errors', 0); + error_reporting(0); + } define('e_MENUMANAGER_ACTIVE', true); } @@ -41,15 +44,11 @@ if(e_MENUMANAGER_ACTIVE === false ) { if(!deftrue("e_DEBUG_MENUMANAGER")) { - e107::css('inline', ' + e107::getJs()->inlineCSS(' body { overflow:hidden } - - - - '); } else @@ -73,7 +72,7 @@ if(e_MENUMANAGER_ACTIVE === false ) } - e107::css('inline'," + e107::getJs()->inlineCSS(" .menu-manager-items { padding-right:15px} .menu-manager-items div.item { padding:5px; margin:5px 0; border:1px solid rgba(255,255,255,0.3); border-radius:3px; cursor: move } @@ -108,7 +107,7 @@ if(e_MENUMANAGER_ACTIVE === false ) @media all and (min-height: 1000px) { - .menu-selector { height:550px } + .menu-selector { height:500px } } @media all and (max-height: 800px) { @@ -121,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'); @@ -134,17 +130,10 @@ if (!getperms("2")) } - - e107::coreLan('menus', true); e107::coreLan('admin', true); - - - - - if(e_MENUMANAGER_ACTIVE === true || vartrue($_GET['enc'])) { @@ -210,9 +199,9 @@ $JSMODAL = <<footerInline( $JSMODAL ); - e107::js('inline', " + e107::getJs()->footerInline(" $(function() { // Visibility/Instance Options etc. @@ -303,7 +292,7 @@ TEMPL; "); - e107::css('inline'," .column { width:100%; padding-bottom: 100px; } + e107::getJs()->inlineCSS(" .column { width:100%; padding-bottom: 100px; } #core-menumanager-main th {color: silver; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size:14px; font-weight: bold; line-height:24px; background-color:#2F2F2F } @@ -523,7 +512,7 @@ TEMPL; // e107::js('footer',"http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js"); // e107::css('url', "http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/themes/base/jquery-ui.css"); - e107::js('footer-inline',' + e107::getJs()->footerInline(' $(function() { // post the form back to this script. @@ -626,7 +615,7 @@ TEMPL; else { - +/* e107::js('footer-inline', " @@ -667,7 +656,7 @@ else "); - +*/ @@ -709,19 +698,7 @@ if($_SERVER['E_DEV_MENU'] == 'true') return e_menu_layout::menuSelector(); - - - - - - - - - - - - - +/* $text = ' '; + +$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_web/css/backcompat.css b/e107_web/css/backcompat.css index fe5624497..e9032b301 100644 --- a/e107_web/css/backcompat.css +++ b/e107_web/css/backcompat.css @@ -39,4 +39,17 @@ ul.breadcrumb li span.divider { padding-left:5px; } .thumbnail img { border-radius:8px; } .img-responsive { max-width:100%; } +.logo.img-responsive { height: auto; } +.media-list { + padding-left: 0; + list-style: none; +} + +.media-body, .media-left, .media-right { + display: table-cell; + vertical-align: top; +} +.media-left, .media > .pull-left { + padding-right: 10px; +} \ No newline at end of file diff --git a/e107_web/js/core/admin.jquery.css b/e107_web/js/core/admin.jquery.css index eb5d3fd8f..7c21b886e 100644 --- a/e107_web/js/core/admin.jquery.css +++ b/e107_web/js/core/admin.jquery.css @@ -8,7 +8,7 @@ a.media-select-image:hover { border:1px solid red; } a.media-select-image, -a.media-select-none { margin:5px; text-decoration:none; width:80px; height:80px; box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(0, 0, 0, 0.8) inset; background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.3);} +a.media-select-none { margin:5px; margin-left:0; text-decoration:none; width:80px; height:80px; box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1), 0px 1px 7px 0px rgba(0, 0, 0, 0.8) inset; background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.3);} @media (min-height: 500px){ a.media-select-image, diff --git a/e107_web/js/core/admin.jquery.js b/e107_web/js/core/admin.jquery.js index 1feb8dda7..d3a617a83 100644 --- a/e107_web/js/core/admin.jquery.js +++ b/e107_web/js/core/admin.jquery.js @@ -1,3 +1,59 @@ +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); + + $(document).ready(function() { $('form').h5Validate( @@ -208,44 +264,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/e107_web/js/core/mediaManager.js b/e107_web/js/core/mediaManager.js index ace7e67cd..43541701d 100644 --- a/e107_web/js/core/mediaManager.js +++ b/e107_web/js/core/mediaManager.js @@ -485,24 +485,22 @@ $(document).ready(function() $('#e-modal-loading', window.parent.document).show(); $('iframe', window.parent.document).attr('scrolling', 'no'); // hide the scrollbar. - + $(id).hide('slide', { direction: outDir }, 1500, function(){ }); $.get(src, function( data ) { - $(id).hide('slide', { direction: outDir }, 1200, function(){ - - // alert('done'); + // alert('done'); $(id ).html( data ); newVal = $('#admin-ui-media-select-count-hidden').text(); $('#admin-ui-media-select-count').text(newVal).fadeIn(); - $(id).show('slide', { direction: inDir },1200,function(){ + $(id).show('slide', { direction: inDir },500,function(){ $('#e-modal-loading', window.parent.document).hide(); }); - }); + 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 84062f15c..05633cc87 100644 --- a/install.php +++ b/install.php @@ -11,7 +11,7 @@ */ // minimal software version -define('MIN_PHP_VERSION', '5.3'); +define('MIN_PHP_VERSION', '5.4'); define('MIN_MYSQL_VERSION', '4.1.2'); define('MAKE_INSTALL_LOG', true); @@ -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 .= "
    -