diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..a803826aa
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+[*.php]
+indent_style = tab
+indent_size = 4
+
diff --git a/class2.php b/class2.php
index b2c7248f3..1b5d28217 100644
--- a/class2.php
+++ b/class2.php
@@ -446,22 +446,28 @@ e107_require_once(e_HANDLER.'php_compatibility_handler.php');
//
// L: Extract core prefs from the database
//
-$sql->db_Mark_Time('Extract Core Prefs');
+
// TODO - remove it from here, auto-loaded when required
+$sql->db_Mark_Time('Load Cache Handler');
e107_require_once(e_HANDLER.'cache_handler.php');
//DEPRECATED, BC, call the method only when needed, $e107->arrayStorage caught by __get()
+$sql->db_Mark_Time('Load Array Storage Handler');
e107_require_once(e_HANDLER.'arraystorage_class.php'); // ArrayData(); BC Fix only.
$eArrayStorage = e107::getArrayStorage(); //TODO - find & replace $eArrayStorage with e107::getArrayStorage();
//DEPRECATED, BC, call the method only when needed, $e107->e_event caught by __get()
+$sql->db_Mark_Time('Load Event Handler');
$e_event = e107::getEvent(); //TODO - find & replace $e_event, $e107->e_event
// TODO - DEPRECATED - remove
+
+$sql->db_Mark_Time('Load Core Prefs');
e107_require_once(e_HANDLER."pref_class.php");
$sysprefs = new prefs;
+
// Check core preferences
//FIXME - message_handler is dying after message_handler(CRITICAL_ERROR) call
e107::getConfig()->load(); // extra load, required if mysql handler already called e107::getConfig()
@@ -515,6 +521,7 @@ $pref = e107::getPref();
// $e107->set_base_path(); moved to init().
//DEPRECATED, BC, call e107::getConfig('menu')->get('pref_name') only when needed
+$sql->db_Mark_Time('Load Menu Prefs');
$menu_pref = e107::getConfig('menu')->getPref(); //extract menu prefs
// NEW - force ssl
@@ -627,6 +634,7 @@ if(!empty($pref['redirectsiteurl']) && !empty($pref['siteurl'])) {
// - Language detection (because of session.cookie_domain)
// to avoid multi-language 'access-denied' issues.
//session_start(); see e107::getSession() above
+$sql->db_Mark_Time('Load Session Handler');
e107::getSession(); //init core _SESSION - actually here for reference only, it's done by language handler set() method
$sql->db_Mark_Time('Set User Language Session');
e107::getLanguage()->set(); // set e_LANGUAGE, USERLAN, Language Session / Cookies etc. requires $pref;
@@ -1717,10 +1725,31 @@ function save_prefs($table = 'core', $uid = USERID, $row_val = '')
e107::getMessage()->addDebug('Deprecated save_prefs() backtrace:
';
$text .= '
@@ -165,16 +163,10 @@ e107::coreLan('footer', true);
}
-
-
-
// Get Icon constants, theme override (theme/templates/admin_icons_template.php) is allowed
include_once(e107::coreTemplatePath('admin_icons'));
-
-
-
if(!defset('e_ADMIN_UI') && !defset('e_PAGETITLE'))
{
$array_functions = e107::getNav()->adminLinks('legacy'); // replacement see e107_handlers/sitelinks.php
@@ -478,4 +470,4 @@ if (!function_exists("parse_admin"))
}
}
}
-}
+}
\ No newline at end of file
diff --git a/e107_admin/cache.php b/e107_admin/cache.php
index d8d983aff..c5589928e 100644
--- a/e107_admin/cache.php
+++ b/e107_admin/cache.php
@@ -8,28 +8,17 @@
*
* Cache Administration Area
*
- * $URL$
- * $Id$
- *
*/
-/**
- * Admin page - cache management
- *
- * @package e107
- * @subpackage admin
- * @version $Id$;
- * @author e107 Inc
- */
-
require_once("../class2.php");
+
if (!getperms("C"))
{
e107::redirect('admin');
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('cache', true);
$e_sub_cat = 'cache';
diff --git a/e107_admin/comment.php b/e107_admin/comment.php
index 101a6cb08..e69c7a5b7 100644
--- a/e107_admin/comment.php
+++ b/e107_admin/comment.php
@@ -73,7 +73,7 @@ class comments_admin_ui extends e_admin_ui
'comment_type' => array('title'=> LAN_TYPE, 'type' => 'method', 'width' => '10%', 'filter'=>TRUE),
- 'comment_item_id' => array('title'=> LAN_ITEM." ".LAN_ID, 'type' => 'text', 'readonly'=>2, 'data'=>'int', 'width' => '5%'),
+ 'comment_item_id' => array('title'=> LAN_ITEM, 'type' => 'text', 'readonly'=>2, 'data'=>'int', 'width' => '5%'),
'comment_subject' => array('title'=> LAN_SUBJECT, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'writeParms'=>array('size'=>'xxlarge')), // Display name
'comment_comment' => array('title'=> LAN_COMMENTS, 'type' => 'textarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'size=xxlarge'), // Display name
'comment_author_id' => array('title'=> LAN_AUTHOR, 'type' => 'user', 'data' => 'int', 'width' => 'auto', 'writeParms' => 'nameField=comment_author_name'), // User id
diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php
index 4d8066a06..89746a993 100644
--- a/e107_admin/cpage.php
+++ b/e107_admin/cpage.php
@@ -9,7 +9,7 @@
* Custom Menus/Pages Administration
* Admin-related functions for custom page and menu creation
*/
-define('e_MINIMAL',true);
+//define('e_MINIMAL',true);
require_once('../class2.php');
if (!getperms("5|J")) { e107::redirect('admin'); exit; }
@@ -19,12 +19,11 @@ e107::css('inline',"
.e-wysiwyg { height: 400px }
");
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_page.php');
+e107::coreLan('cpage', true);
+e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_page.php');
$e_sub_cat = 'custom';
-
class page_admin extends e_admin_dispatcher
{
@@ -78,6 +77,19 @@ class page_admin extends e_admin_dispatcher
);
protected $menuTitle = ADLAN_42;
+
+
+ function init()
+ {
+
+
+
+
+
+ }
+
+
+
}
class page_admin_form_ui extends e_admin_form_ui
@@ -122,7 +134,7 @@ class page_admin_form_ui extends e_admin_form_ui
$text = "
".ADMIN_EDIT_ICON." ";
- $text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'.$delcls));
+ $text .= $this->submit_image('menu_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'action delete btn btn-default'));
return $text;
}
@@ -160,13 +172,13 @@ class page_chapters_ui extends e_admin_ui
'chapter_name' => array('title'=> CUSLAN_53, 'type' => 'method', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'writeParms'=>'size=xxlarge'),
'chapter_template' => array('title'=> LAN_TEMPLATE, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),
- 'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE),
+ 'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'writeParms'=>'size=xxlarge', 'readonly'=>FALSE),
'chapter_meta_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
- 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1'), // Display name
+ 'chapter_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE, 'inline'=>true, 'writeParms'=>'size=xxlarge&inline-empty=1&sef=chapter_name', ), // Display name
'chapter_manager' => array('title'=> CUSLAN_55, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
'chapter_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
'chapter_visibility' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'inline'=>true, 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
-
+ 'chapter_fields' => array('title', 'hidden', 'type'=>'hidden'),
'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'center last', 'class' => 'left', 'readParms'=>'sort=1')
);
@@ -178,10 +190,19 @@ class page_chapters_ui extends e_admin_ui
function init()
{
- if($this->getAction() == 'list')
+ // e107::getMessage()->addWarning("Experimental: Custom Fields");
+ $this->tabs = array(LAN_GENERAL,"Custom Fields");
+ $this->fields['chapter_fields'] = array('title'=>"Fields", 'tab'=>1, 'type'=>'method', 'data'=>'json', 'writeParms'=>array('nolabel'=>2));
+
+ if($this->getAction() === 'list')
{
$this->fields['chapter_parent']['title'] = CUSLAN_56;
}
+ elseif(deftrue('e_DEBUG'))
+ {
+ $this->fields['chapter_sef']['title'] = LAN_SEFURL.' / '.LAN_NAME;
+ $this->fields['chapter_sef']['help'] = 'May also be used in shortcode {CHAPTER_MENUS: name=x}';
+ }
$sql = e107::getDb();
$sql->gen("SELECT chapter_id,chapter_name FROM #page_chapters WHERE chapter_parent =0");
@@ -231,6 +252,8 @@ class page_chapters_ui extends e_admin_ui
e107::getMessage()->addError(CUSLAN_57);
return false;
}
+
+ $new_data = e107::getCustomFields()->processConfigPost('chapter_fields', $new_data);
return $new_data;
}
@@ -238,9 +261,40 @@ class page_chapters_ui extends e_admin_ui
public function beforeUpdate($new_data, $old_data, $id)
{
- // return $this->beforeCreate($new_data);
+ // return $this->beforeCreate($new_data);
+
+ $new_data = e107::getCustomFields()->processConfigPost('chapter_fields', $new_data);
+
+ return $new_data;
}
+/*
+ private function processCustomFields($newdata)
+ {
+ if(empty($newdata))
+ {
+ return null;
+ }
+
+ $new = array();
+ foreach($newdata as $fields)
+ {
+ if(empty($fields['key']) || empty($fields['type']))
+ {
+ continue;
+ }
+
+
+ $key = $fields['key'];
+ unset($fields['key']);
+ $new[$key] = $fields;
+
+
+ }
+
+ return $new;
+ }*/
+
}
@@ -272,18 +326,42 @@ class page_chapters_form_ui extends e_admin_form_ui
if($mode == 'filter')
{
- return;
+ return null;
}
if($mode == 'batch')
{
- return;
+ return null;
}
}
-
-
-
+ function chapter_fields($curVal,$mode,$parm)
+ {
+ $fieldAmount = (deftrue('e_DEBUG')) ? 20 :10;
+
+
+ if($mode == 'read')
+ {
+
+ }
+
+ if($mode == 'write')
+ {
+ return e107::getCustomFields()->loadConfig($curVal)->renderConfigForm('chapter_fields');
+ }
+
+ if($mode == 'filter')
+ {
+ return;
+ }
+ if($mode == 'batch')
+ {
+ return;
+ }
+ }
+
+
+
// Override the default Options field.
function options($parms, $value, $id, $attributes)
@@ -474,14 +552,14 @@ class page_admin_ui extends e_admin_ui
// PAGE LIST/EDIT and MENU EDIT modes.
protected $fields = array(
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'3%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
- 'page_id' => array('title'=> LAN_ID, 'type' => 'text', 'tab' => 0, 'width'=>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=dialog'),
+ 'page_id' => array('title'=> LAN_ID, 'type' => 'text', 'tab' => 0, 'width'=>'5%', 'forced'=> TRUE, 'readParms'=>'link=sef&target=blank'),
'page_title' => array('title'=> LAN_TITLE, 'tab' => 0, 'type' => 'text', 'inline'=>true, 'width'=>'25%', 'writeParms'=>'size=block-level'),
'page_chapter' => array('title'=> CUSLAN_63, 'tab' => 0, 'type' => 'dropdown', 'width' => '20%', 'filter' => true, 'batch'=>true, 'inline'=>true),
- 'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),
+ 'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>array()),
'page_author' => array('title'=> LAN_AUTHOR, 'tab' => 0, 'type' => 'user', 'inline'=>true, 'data'=>'int','width' => 'auto', 'thclass' => 'left'),
- 'page_text' => array('title'=> CUSLAN_9, 'tab' => 0, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page&template=page'),
+ 'page_text' => array('title'=> CUSLAN_9, 'tab' => 0, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>array('media'=>'page', 'template'=>'page')),
// Options Tab.
@@ -495,7 +573,9 @@ class page_admin_ui extends e_admin_ui
'page_metadscr' => array('title'=> CUSLAN_11, 'tab' => 1, 'type' => 'text', 'width' => 'auto', 'writeParms'=>'size=xxlarge'),
'page_order' => array('title'=> LAN_ORDER, 'tab' => 1, 'type' => 'number', 'width' => 'auto', 'inline'=>true),
-
+ 'page_fields' => array('title'=>'Custom Fields', 'tab'=>4, 'type'=>'hidden', 'data'=>'json', 'width'=>'auto'),
+
+
// Menu Tab XXX 'menu_name' is 'menu_name' - not caption.
'menu_name' => array('title'=> CUSLAN_64, 'tab' => 2, 'type' => 'text', 'width' => 'auto','nolist'=>true, "help"=>"Will be listed in the Menu-Manager under this name or may be called using {CMENU=name} in your theme. Must use ASCII characters only and be all lowercase."),
'menu_title' => array('title'=> CUSLAN_65, 'nolist'=>true, 'tab' => 2, 'type' => 'text', 'inline'=>true, 'width'=>'25%', "help"=>"Caption displayed on the menu item.", 'writeParms'=>'size=xxlarge'),
@@ -529,9 +609,13 @@ class page_admin_ui extends e_admin_ui
protected $books = array();
protected $cats = array(0 => LAN_NONE);
protected $templates = array();
+ protected $chapterFields = array();
function init()
{
+
+
+
if(vartrue($_POST['menu_delete'])) // Delete a Menu (or rather, remove it's data )
{
@@ -544,12 +628,12 @@ class page_admin_ui extends e_admin_ui
}
// USED IN Menu LIST/INLINE-EDIT MODE ONLY.
- if($this->getMode() == 'menu' && ($this->getACtion() == 'list' || $this->getACtion() == 'inline'))
+ if($this->getMode() == 'menu' && ($this->getAction() == 'list' || $this->getAction() == 'inline'))
{
- $this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE p.menu_name != '' "; // without any Order or Limit.
+ $this->listQry = "SELECT SQL_CALC_FOUND_ROWS p.*,u.user_id,u.user_name FROM #page AS p LEFT JOIN #user AS u ON p.page_author = u.user_id WHERE (p.menu_name != '' OR p.menu_image != '' OR p.menu_icon !='') "; // without any Order or Limit.
- $this->listOrder = 'p.page_id desc';
+ $this->listOrder = 'p.page_order asc'; // 'p.page_id desc';
$this->batchDelete = false;
$this->fields = array(
@@ -579,7 +663,7 @@ class page_admin_ui extends e_admin_ui
$this->fieldpref = array("page_id","menu_name", "menu_title", 'menu_image', 'menu_template', 'menu_icon', 'page_chapter', 'menu_class');
- if(e_DEBUG)
+ if(deftrue('e_DEBUG'))
{
$this->fields['menu_name']['inline'] = true;
}
@@ -594,7 +678,18 @@ class page_admin_ui extends e_admin_ui
$this->parseAliases();
}
-
+
+ if($this->getAction() == 'create' && e_DEBUG === true)
+ {
+
+ $tmp = e107::getCoreTemplate('page', 'default');
+ if(!empty($tmp['editor']))
+ {
+ $this->fields['page_text']['writeParms']['default'] = $tmp['editor'];
+ }
+
+ }
+
$this->templates = e107::getLayouts('', 'page', 'front', '', true, false);
unset($this->templates['panel'], $this->templates['nav']);
@@ -618,9 +713,8 @@ class page_admin_ui extends e_admin_ui
$this->prefs['listBooksTemplate']['writeParms'] = $tmpl;
$sql = e107::getDb();
-
-
- $sql->gen("SELECT chapter_id,chapter_name,chapter_parent FROM #page_chapters ORDER BY chapter_parent asc, chapter_order");
+
+ $sql->gen("SELECT chapter_id,chapter_name,chapter_parent, chapter_fields FROM #page_chapters ORDER BY chapter_parent asc, chapter_order");
while($row = $sql->fetch())
{
$cat = $row['chapter_id'];
@@ -633,15 +727,163 @@ class page_admin_ui extends e_admin_ui
{
$book = $row['chapter_parent'];
$this->cats[$cat] = $this->books[$book] . " : ".$row['chapter_name'];
- }
+ }
+
+ if(!empty($row['chapter_fields']))
+ {
+ $this->chapterFields[$cat] = ($row['chapter_fields']);
+ }
+
+
}
// asort($this->cats);
$this->fields['page_chapter']['writeParms']['optArray'] = $this->cats;
$this->fields['page_chapter']['writeParms']['size'] = 'xxlarge';
+ if($this->getAction() === 'create')
+ {
+ $this->fields['page_chapter']['writeParms']['ajax'] = array('src'=>e_SELF."?mode=page&action=chapter-change",'target'=>'tabadditional');
+ }
+
+
+ if(e_AJAX_REQUEST)
+ {
+ // @todo insert placeholder examples in params input when 'type' dropdown value is changed
+ }
+
+
+
+
+ if(e_AJAX_REQUEST && isset($_POST['page_chapter']) ) //&& $this->getAction() === 'chapter-change'
+ {
+
+ $this->initCustomFields($_POST['page_chapter']);
+
+ $elid = 'core-page-create';
+ $model = $this->getModel();
+ $tabId = 'additional';
+
+ $data = array(
+ 'tabs' => $this->getTabs(),
+ 'legend' => '',
+ 'fields' => $this->getFields(),
+ );
+
+ $text = $this->getUI()->renderCreateFieldset($elid, $data, $model, $tabId);
+
+ $ajax = e107::getAjax();
+ $commands = array();
+
+ if(empty($text))
+ {
+ $text = ""; // There are no additional fields for the selected chapter.
+ $commands[] = $ajax->commandInvoke('a[href="#tab' . $tabId . '"]', 'fadeOut');
+ }
+ else
+ {
+ $commands[] = $ajax->commandInvoke('a[href="#tab' . $tabId . '"]', 'fadeInAdminTab');
+ }
+
+ $commands[] = $ajax->commandInvoke('#tab' . $tabId, 'html', array($text));
+
+ $ajax->response($commands);
+ exit;
+ }
}
+ /*
+ * @todo Move to admin-ui ?
+ */
+ private function initCustomFields($chap=null)
+ {
+ $tabId = 'additional';
+
+ if(!empty($this->chapterFields[$chap]))
+ {
+ e107::getCustomFields()->setTab($tabId, "Additional")->loadConfig($this->chapterFields[$chap])->setAdminUIConfig('page_fields',$this);
+ }
+ else
+ {
+ e107::css('inline', '.nav-tabs li a[href="#tab' . $tabId . '"] { display: none; }');
+ }
+ }
+
+ private function loadCustomFieldsData()
+ {
+ $row = e107::getDb()->retrieve('page', 'page_chapter, page_fields', 'page_id='.$this->getId());
+
+ $cf = e107::getCustomFields();
+
+ $cf->loadData($row['page_fields'])->setAdminUIData('page_fields',$this);
+
+ // e107::getDebug()->log($cf);
+
+
+ }
+
+
+ function CreateObserver()
+ {
+ parent::CreateObserver();
+ $this->initCustomFields(0);
+
+ }
+
+
+
+ // Override default so we can alter the field db table data after it is loaded. .
+ function EditObserver()
+ {
+
+ parent::EditObserver();
+
+ $row = e107::getDb()->retrieve('page', 'page_chapter, page_fields', 'page_id='.$this->getId());
+ $chap = intval($row['page_chapter']);
+
+ $this->initCustomFields($chap);
+ $this->loadCustomFieldsData();
+
+ }
+
+ /**
+ * Filter/Process Posted page_field data;
+ * @param $new_data
+ * @return null
+ *//*
+ private function processCustomFieldData($new_data)
+ {
+ if(empty($new_data))
+ {
+ return null;
+ }
+
+ unset($new_data['page_fields']); // Reset.
+
+ foreach($new_data as $k=>$v)
+ {
+ if(substr($k,0,11) === "page_fields")
+ {
+ list($tmp,$newkey) = explode("__",$k);
+ $new_data['page_fields'][$newkey] = $v;
+ unset($new_data[$k]);
+
+
+ }
+
+ }
+
+
+
+ return $new_data;
+
+
+ }
+*/
+
+
+
+
/**
* Overrid
@@ -711,7 +953,10 @@ class page_admin_ui extends e_admin_ui
$newdata['page_sef'] = eHelper::secureSef($newdata['page_sef']);
}
-
+
+ // $newdata = $this->processCustomFieldData($newdata);
+
+
$sef = e107::getParser()->toDB($newdata['page_sef']);
if(isset($newdata['page_title']) && isset($newdata['menu_name']) && empty($newdata['page_title']) && empty($newdata['menu_name']))
@@ -732,11 +977,17 @@ class page_admin_ui extends e_admin_ui
function beforeUpdate($newdata,$olddata, $id)
{
+
+ $newdata = e107::getCustomFields()->processDataPost('page_fields',$newdata);
+
if(isset($newdata['menu_name']))
{
$newdata['menu_name'] = preg_replace('/[^\w-*]/','',$newdata['menu_name']);
}
+
+
+
return $newdata;
}
@@ -771,6 +1022,8 @@ class page_admin_ui extends e_admin_ui
}
+
+
public function afterDelete($deleted_data, $id, $deleted_check)
{
$sql = e107::getDb();
diff --git a/e107_admin/credits.php b/e107_admin/credits.php
index 0c6549a79..5462eef29 100644
--- a/e107_admin/credits.php
+++ b/e107_admin/credits.php
@@ -50,7 +50,7 @@ require_once(e_ADMIN."auth.php");
Nuvolo Icons, PHPMailer, TCPDF, PHP UTF8
-
+
diff --git a/e107_admin/cron.php b/e107_admin/cron.php
index b21be360b..d7c1f1f87 100644
--- a/e107_admin/cron.php
+++ b/e107_admin/cron.php
@@ -17,9 +17,7 @@ if (!getperms('U'))
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
-
-
+e107::coreLan('cron', true);
class cron_admin extends e_admin_dispatcher
{
@@ -269,7 +267,7 @@ class cron_admin_ui extends e_admin_ui
if(!$sql->insert('cron',$insert))
{
- e107::getMessage()->add(LAN_CRON_6, E_MESSAGE_ERROR);
+ e107::getMessage()->addDebug(LAN_CRON_6);
}
else
{
diff --git a/e107_admin/db.php b/e107_admin/db.php
index 6513fd5bc..7bba0a173 100644
--- a/e107_admin/db.php
+++ b/e107_admin/db.php
@@ -26,9 +26,7 @@ if(isset($_POST['back']))
exit();
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
-
-
+e107::coreLan('db', true);
$e_sub_cat = 'database';
diff --git a/e107_admin/docs.php b/e107_admin/docs.php
index 821588ccd..81cef9468 100644
--- a/e107_admin/docs.php
+++ b/e107_admin/docs.php
@@ -8,10 +8,6 @@
*
* Docs
*
- * $Source: /cvs_backup/e107_0.8/e107_admin/docs.php,v $
- * $Revision$
- * $Date$
- * $Author$
*
*/
require_once("../class2.php");
@@ -20,7 +16,7 @@ if (!ADMIN) {
exit;
}
-e107::lan('core','docs',true);
+e107::coreLan('docs', true);
define('DOC_PATH', e_DOCS.e_LANGUAGE.'/');
define('DOC_PATH_ALT', e_DOCS.'English/');
diff --git a/e107_admin/emoticon.php b/e107_admin/emoticon.php
index 9e21b980b..31d8cebbd 100644
--- a/e107_admin/emoticon.php
+++ b/e107_admin/emoticon.php
@@ -18,7 +18,7 @@ if (!getperms("F"))
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('emoticon', true);
$e_sub_cat = 'emoticon';
diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php
index b890cb6ef..b95c3253a 100644
--- a/e107_admin/eurl.php
+++ b/e107_admin/eurl.php
@@ -8,8 +8,6 @@
*
* URL and front controller Management
*
- * $URL$
- * $Id$
*/
require_once('../class2.php');
diff --git a/e107_admin/fileinspector.php b/e107_admin/fileinspector.php
index b543f3485..15a40f1af 100644
--- a/e107_admin/fileinspector.php
+++ b/e107_admin/fileinspector.php
@@ -14,11 +14,9 @@ header('Content-Encoding: none'); // turn off gzip.
ob_implicit_flush(true);
ob_end_flush();
-
-
require_once('../class2.php');
-e107::lan('core','fileinspector', true);
+e107::coreLan('fileinspector', true);
if (!getperms('Y'))
{
diff --git a/e107_admin/frontpage.php b/e107_admin/frontpage.php
index d927f47e7..628593c3a 100644
--- a/e107_admin/frontpage.php
+++ b/e107_admin/frontpage.php
@@ -25,7 +25,7 @@ if(! getperms('G'))
exit();
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('frontpage', true);
$e_sub_cat = 'frontpage';
require_once ('auth.php');
diff --git a/e107_admin/header.php b/e107_admin/header.php
index 14c6c5d77..a6ee16982 100644
--- a/e107_admin/header.php
+++ b/e107_admin/header.php
@@ -98,7 +98,17 @@ function loadJSAddons()
e107::css('core', 'core/all.jquery.css', 'jquery');
e107::js("core", "core/all.jquery.js","jquery",4); // Load all default functions.
-
+
+ $plUpload = "plupload/i18n/".e_LAN.".js";
+
+ if(e_LAN != 'en' && file_exists(e_WEB_JS.$plUpload))
+ {
+ e107::js('core', $plUpload);
+ }
+
+
+
+
}
loadJSAddons();
diff --git a/e107_admin/image.php b/e107_admin/image.php
index d78e73227..1d9dcfdbf 100644
--- a/e107_admin/image.php
+++ b/e107_admin/image.php
@@ -8,8 +8,6 @@
*
* Image Administration Area
*
- * $URL$
- * $Id$
*
*/
@@ -53,7 +51,7 @@ if(isset($_POST['submit_cancel_show']))
exit();
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('image', true);
if($_GET['action'] == 'dialog')
{
@@ -1040,7 +1038,13 @@ class media_admin_ui extends e_admin_ui
$mes->addDebug("For:".$cat);
$mes->addDebug("Bbcode: ".$this->getQuery('bbcode'));
-
+ $video = $this->getQuery('video');
+
+ if($video == 2)
+ {
+ echo $this->mediaSelectUpload('video');
+ return;
+ }
$this->processUploadUrl(true, $cat);
@@ -1142,6 +1146,19 @@ class media_admin_ui extends e_admin_ui
function mediaSelectUpload($type='image')
{
$frm = e107::getForm();
+
+ if($type === 'video')
+ {
+ $tabs = array(
+ 'youtube' => array('caption'=>'Youtube', 'text' => $this->videoTab())
+ );
+
+ return $frm->tabs($tabs, array('class'=>'media-manager'));
+ }
+
+
+
+
$videoActive = 'inactive';
$options = array();
@@ -1484,7 +1501,7 @@ class media_admin_ui extends e_admin_ui
- if(vartrue($parm['search']))
+ if(!empty($parm['search']))
{
$filtered = array();
if(!empty($items))
@@ -2137,7 +2154,7 @@ class media_admin_ui extends e_admin_ui
$img_src = "
- ".e107::getParser()->toHTML(LANG_LAN_140, true)."
-
-
- ".LANG_LAN_141." ";
+ $text .= "
+ ".e107::getParser()->toHTML(LANG_LAN_140, true)."
+
+
+
+
+ ".LANG_LAN_141." ";
$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 .= "".LANG_LAN_142." \n";//Auto-Detect
-
+ asort($_SESSION['languageTools_lanFileList']);
foreach($_SESSION['languageTools_lanFileList'] as $val)
{
if(strstr($val,e_SYSTEM))
diff --git a/e107_admin/links.php b/e107_admin/links.php
index 07f062d0f..c846458bd 100644
--- a/e107_admin/links.php
+++ b/e107_admin/links.php
@@ -10,15 +10,8 @@
*
*/
-/**
- * @package e107
- * @subpackage admin
- * @version $Id$
- *
- * Manage site navigation links
- */
-
require_once("../class2.php");
+
if (!getperms("I"))
{
e107::redirect('admin');
diff --git a/e107_admin/mailout.php b/e107_admin/mailout.php
index 1fb6cee1f..ee6e51cf2 100644
--- a/e107_admin/mailout.php
+++ b/e107_admin/mailout.php
@@ -10,14 +10,6 @@
*
*/
-
-/**
- * e107 Mail handling - Admin
- *
- * @package e107
- * @subpackage admin
- */
-
/*
Features:
1. Additional sources of email addresses for mailouts can be provided via plugins, and can be enabled via the mailout preferences page
@@ -74,9 +66,9 @@ if (!getperms('W'))
e107::redirect('admin');
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_users.php');
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php');
-// e107::lan('core','signup');
+
+e107::coreLan('users', true);
+e107::coreLan('mailout', true);
require_once(e_HANDLER.'ren_help.php');
@@ -242,7 +234,7 @@ class mailout_admin extends e_admin_dispatcher
'main/list' => array('caption'=> LAN_MANAGE, 'perm'=> 'W'),
'main/create' => array('caption'=> LAN_CREATE, 'perm' => 'W'),
- 'recipients/list' => array('caption'=> "Recipients", 'perm' => 'W'),
+ 'recipients/list' => array('caption'=> LAN_MAILOUT_173, 'perm' => 'W'),
// 'main/send' => array('caption'=> "Send", 'perm' => 'W'),
'other' => array('divider'=> true),
// 'saved/list' => array('caption'=> LAN_MAILOUT_191, 'perm' => 'W'),
@@ -252,7 +244,7 @@ class mailout_admin extends e_admin_dispatcher
'other2' => array('divider'=> true),
'prefs/prefs' => array('caption'=> LAN_PREFS, 'perm' => '0'),
'maint/maint' => array('caption'=> ADLAN_40, 'perm' => '0'),
- 'main/templates' => array('caption'=> 'Template Preview', 'perm' => '0'),
+ 'main/templates' => array('caption'=> LAN_MAILOUT_262, 'perm' => '0'),
);
@@ -298,7 +290,7 @@ class mailout_main_ui extends e_admin_ui
'mail_bcopy_to' => array('title' => LAN_MAILOUT_152,'tab'=>1, 'type'=>'method','data'=>false),
'mail_subject' => array('title' => LAN_MAILOUT_06, 'type'=>'text', 'forced' => TRUE,'data'=>'str', 'inline'=>true, 'writeParms'=>'size=xxlarge&required=1'),
'mail_content_status' => array('title' => LAN_MAILOUT_136, 'tab'=>1, 'type'=> 'dropdown', 'data'=>'int', 'filter'=>false, 'inline'=>false, 'thclass' => 'left', 'class'=>'left'),
- 'mail_total_count' => array('title' => "Total Recipients", 'noedit'=>true, 'type'=>'number'),
+ 'mail_total_count' => array('title' => LAN_MAILOUT_263, 'noedit'=>true, 'type'=>'number'),
'mail_sent_count' => array('title' => LAN_MAILOUT_82, 'noedit'=>true, 'type'=>'number'),
'mail_togo_count' => array('title' => LAN_MAILOUT_83, 'noedit'=>true, 'type'=>'number'),
@@ -315,7 +307,7 @@ class mailout_main_ui extends e_admin_ui
'mail_attach' => array('title' => LAN_MAILOUT_153, 'tab'=>1, 'type'=>'method','data'=>false),
'mail_include_images' => array('title' => LAN_MAILOUT_224, 'tab'=>1, 'type'=>'boolean','data'=>false, 'proc' => 'yesno'),
'mail_send_style' => array('title' => LAN_MAILOUT_154,'type'=>'method','data'=>false),
- 'mail_media' => array('title' => 'Embed Media', 'type' => 'images', 'data' => 'array', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'video=1', 'class' => 'center', 'thclass' => 'center', ),
+ 'mail_media' => array('title' => LAN_MAILOUT_264, 'type' => 'images', 'data' => 'array', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'video=1', 'class' => 'center', 'thclass' => 'center', ),
'mail_body' => array('title' => LAN_MAILOUT_100, 'type'=>'bbarea', 'proc' => 'trunc200'),
'mail_body_templated' => array('title' => LAN_MAILOUT_257, 'noedit'=>true, 'proc' => 'chars'),
@@ -412,7 +404,7 @@ class mailout_main_ui extends e_admin_ui
define('MAIL_STATUS_TEMP', 22); // Tags entries which aren't yet in any list
*/
- $types = array(10=>'Pending',20=>"Saved", 21=>"Held", 0=>'Sent', 1=>'Bounced', 2=>'Cancelled', 3=> 'Partial', 5=>'Failed', 19 => "Max Active", 22=>"Temp");
+ $types = array(10=>LAN_MAILOUT_265,20=>LAN_SAVED, 21=>LAN_MAILOUT_217, 0=>LAN_MAILOUT_211, 1=>LAN_MAILOUT_213, 2=>LAN_MAILOUT_218, 3=>LAN_MAILOUT_219, 5=>LAN_MAILOUT_212, 19 => LAN_MAILOUT_266, 22=>"Temp");
$qr = array('saved'=>20,'pending'=>10,'held'=>21,'sent'=>0);
@@ -1182,8 +1174,8 @@ class mailout_main_ui extends e_admin_ui
if(function_exists('openssl_pkey_new') && deftrue('e_DEVELOPER'))
{
- $text .= "DomainKeys Identified Mail (DKIM) ".$frm->button('DKIM_generate',1,'primary','Generate Public/Private keys')."
- Developer Mode Only ";
+ $text .= "DomainKeys Identified Mail (DKIM) ".$frm->button('DKIM_generate',1,'primary',LAN_MAILOUT_267)."
+ ".LAN_MAILOUT_268." ";
}
@@ -1593,8 +1585,8 @@ class mailout_admin_form_ui extends e_admin_form_ui
$link = e_SELF."?mode=main&action=send&id=".$id;
$preview = e_SELF."?mode=main&action=preview&id=".$id;
$text .= "";
- $text .= "".E_32_MAIL." ";
- $text .= "".E_32_SEARCH." ";
+ $text .= "".E_32_MAIL." ";
+ $text .= "".E_32_SEARCH." ";
$text .= $this->renderValue('options',$value,$attributes,$id);
@@ -1608,8 +1600,8 @@ class mailout_admin_form_ui extends e_admin_form_ui
$preview = e_SELF."?mode=main&action=preview&id=".$id.'&user='.$user;
$text = "";
- $text .= "".E_32_USER." ";
- $text .= "".E_32_SEARCH." ";
+ $text .= "".E_32_USER." ";
+ $text .= "".E_32_SEARCH." ";
$attributes['readParms']['editClass'] = e_UC_NOBODY;
$text .= $this->renderValue('options',$value,$attributes,$id);
@@ -2644,4 +2636,4 @@ function headerjs()
return $text;
}
-?>
\ No newline at end of file
+?>
diff --git a/e107_admin/menus.php b/e107_admin/menus.php
index 639ae5cd7..583bfc922 100644
--- a/e107_admin/menus.php
+++ b/e107_admin/menus.php
@@ -49,10 +49,6 @@ if(e_MENUMANAGER_ACTIVE === false )
body { overflow:hidden }
-
-
-
-
');
}
else
@@ -124,12 +120,9 @@ if(e_MENUMANAGER_ACTIVE === false )
ul.dropdown-menu.e-mm-selector { padding: 10px; margin-top: -2px; margin-right:-2px; }
");
-
}
-
-
if (!getperms("2"))
{
e107::redirect('admin');
@@ -137,17 +130,10 @@ if (!getperms("2"))
}
-
-
e107::coreLan('menus', true);
e107::coreLan('admin', true);
-
-
-
-
-
if(e_MENUMANAGER_ACTIVE === true || vartrue($_GET['enc']))
{
@@ -794,6 +780,9 @@ class e_menu_layout
$theme = e107::pref('core','sitetheme');
}
+ $sql = e107::getDb();
+ $tp = e107::getParser();
+
$HEADER = null;
$FOOTER = null;
$LAYOUT = null;
@@ -1034,7 +1023,7 @@ class e_menu_layout
;
- $diz = "The Menu-Manager allows you to place and arrange your menus within your theme template. Hover over the sub-areas to modify existing menu items. ";
+ $diz = MENLAN_58;
$caption .= "toAttribute($diz)."\">".ADMIN_INFO_ICON." ";
@@ -1926,4 +1915,4 @@ function menus_adminmenu()
}
-?>
\ No newline at end of file
+?>
diff --git a/e107_admin/message.php b/e107_admin/message.php
index 009cd3455..bdc99aa9c 100644
--- a/e107_admin/message.php
+++ b/e107_admin/message.php
@@ -6,17 +6,11 @@
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
- *
- *
- * $Source: /cvs_backup/e107_0.8/e107_admin/message.php,v $
- * $Revision$
- * $Date$
- * $Author$
*/
require_once("../class2.php");
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('message', true);
$e_sub_cat = 'message';
require_once("auth.php");
diff --git a/e107_admin/meta.php b/e107_admin/meta.php
index 1b5a5ea61..ba9687f13 100644
--- a/e107_admin/meta.php
+++ b/e107_admin/meta.php
@@ -11,12 +11,14 @@
*
*/
require_once("../class2.php");
-if (!getperms("T")) {
+
+if (!getperms("T"))
+{
e107::redirect('admin');
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('meta', true);
$e_sub_cat = 'meta';
require_once("auth.php");
diff --git a/e107_admin/modcomment.php b/e107_admin/modcomment.php
index 23ab9295d..eeacdfbb9 100644
--- a/e107_admin/modcomment.php
+++ b/e107_admin/modcomment.php
@@ -9,13 +9,14 @@
*/
require_once("../class2.php");
-if (!getperms("B")) {
+
+if (!getperms("B"))
+{
e107::redirect('admin');
exit;
}
-
$tmp = explode(".", e_QUERY);
$table = $tmp[0];
$id = intval($tmp[1]);
diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php
index 614d8bab2..0911ab03e 100644
--- a/e107_admin/newspost.php
+++ b/e107_admin/newspost.php
@@ -27,9 +27,6 @@ e107::css('inline', "
");
-
-
-
class news_admin extends e_admin_dispatcher
{
@@ -509,6 +506,9 @@ class news_admin_ui extends e_admin_ui
$new_data['news_sef'] = empty($new_data['news_sef']) ? eHelper::title2sef($new_data['news_title']) : eHelper::secureSef($new_data['news_sef']);
+ $this->checkSEFSimilarity($new_data);
+
+
$tmp = explode(chr(35), $new_data['news_author']);
$new_data['news_author'] = intval($tmp[0]);
@@ -566,6 +566,9 @@ class news_admin_ui extends e_admin_ui
$new_data['news_sef'] = eHelper::title2sef($new_data['news_title']);
}
+
+ $this->checkSEFSimilarity($new_data);
+
if(!empty($new_data['news_author']))
{
$tmp = explode(chr(35), $new_data['news_author']);
@@ -581,6 +584,30 @@ class news_admin_ui extends e_admin_ui
}
+ /**
+ * Display a warning if there is a mismatch with the SEF Url.
+ * @param $new_data
+ */
+ private function checkSEFSimilarity($new_data)
+ {
+ if(e_LANGUAGE === "Japanese" || e_LANGUAGE === "Korean")
+ {
+ return null;
+ }
+
+
+ $expectedSEF = eHelper::title2sef($new_data['news_title']);
+ similar_text($expectedSEF,$new_data['news_sef'],$percSimilar);
+
+ if($percSimilar < 60)
+ {
+ e107::getMessage()->addWarning(LAN_NEWS_108); // The SEF URL is unlike the title of your news item.
+ }
+
+
+ }
+
+
public function afterCreate($new_data, $old_data, $id)
{
diff --git a/e107_admin/notify.php b/e107_admin/notify.php
index d23fd8033..019964b93 100644
--- a/e107_admin/notify.php
+++ b/e107_admin/notify.php
@@ -8,23 +8,15 @@
*
*/
-/**
- * @package e107
- * @subpackage admin
- *
- * 'Notify' admin page - selects action on various events
- */
-
require_once('../class2.php');
+
if (!getperms('O'))
{
e107::redirect('admin');
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
-
-
+e107::coreLan('notify', true);
class plugin_notify_admin extends e_admin_dispatcher
{
diff --git a/e107_admin/phpinfo.php b/e107_admin/phpinfo.php
index b8326c945..cc6e5eade 100644
--- a/e107_admin/phpinfo.php
+++ b/e107_admin/phpinfo.php
@@ -6,16 +6,11 @@
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
- *
- *
- * $Source: /cvs_backup/e107_0.8/e107_admin/phpinfo.php,v $
- * $Revision$
- * $Date$
- * $Author$
*/
require_once("../class2.php");
-if (!getperms("0"))
+
+if(!getperms("0"))
{
e107::redirect('admin');
exit;
diff --git a/e107_admin/plugin.php b/e107_admin/plugin.php
index 54c73e7df..4bb54a84f 100644
--- a/e107_admin/plugin.php
+++ b/e107_admin/plugin.php
@@ -11,7 +11,8 @@
*/
require_once("../class2.php");
-if (!getperms("Z"))
+
+if(!getperms("Z"))
{
e107::redirect('admin');
exit;
diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php
index d9fe161de..01f5a2aa0 100644
--- a/e107_admin/prefs.php
+++ b/e107_admin/prefs.php
@@ -9,6 +9,7 @@
* Administration - Site Preferences
*
*/
+
require_once ("../class2.php");
if(isset($_POST['newver']))
@@ -17,17 +18,17 @@ if(isset($_POST['newver']))
exit();
}
-if(! getperms("1"))
+if(!getperms("1"))
{
e107::redirect('admin');
exit();
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('prefs', true);
+
$e_sub_cat = 'prefs';
-e107::lan('core','mailout','admin');
-
-
+//e107::lan('core','mailout','admin');
+e107::coreLan('mailout', true);
require_once (e_ADMIN."auth.php");
@@ -1574,7 +1575,7 @@ $text .= "
// File Uploads
- include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_upload.php");
+ e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_upload.php");
require_once(e_HANDLER."upload_handler.php");
diff --git a/e107_admin/search.php b/e107_admin/search.php
index a75e647d9..a78f55659 100644
--- a/e107_admin/search.php
+++ b/e107_admin/search.php
@@ -17,15 +17,13 @@ if (!getperms('X'))
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('search', true);
$e_sub_cat = 'search';
require_once('auth.php');
require_once(e_HANDLER.'userclass_class.php');
require_once(e_HANDLER.'search_class.php');
-
-
$frm = e107::getForm();
$mes = e107::getMessage();
$e_userclass = new user_class();
diff --git a/e107_admin/theme.php b/e107_admin/theme.php
index 9ec2f1ee5..ab238b1c4 100644
--- a/e107_admin/theme.php
+++ b/e107_admin/theme.php
@@ -6,22 +6,17 @@
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
- *
- *
- * $Source: /cvs_backup/e107_0.8/e107_admin/theme.php,v $
- * $Revision$
- * $Date$
- * $Author$
*/
require_once("../class2.php");
+
if (!getperms("1"))
{
e107::redirect('admin');
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('theme', true);
$e_sub_cat = 'theme_manage';
diff --git a/e107_admin/ugflag.php b/e107_admin/ugflag.php
index 4cd1458dd..04370c59e 100644
--- a/e107_admin/ugflag.php
+++ b/e107_admin/ugflag.php
@@ -10,6 +10,7 @@
*
*/
require_once ('../class2.php');
+
if(!getperms('9'))
{
e107::redirect('admin');
@@ -18,7 +19,7 @@ if(!getperms('9'))
$e_sub_cat = 'maintain';
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
+e107::coreLan('ugflag', true);
$mes = e107::getMessage();
$frm = e107::getForm();
diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php
index bb54550b9..68b8755b5 100644
--- a/e107_admin/update_routines.php
+++ b/e107_admin/update_routines.php
@@ -1,26 +1,14 @@
core as $func => $data)
@@ -270,6 +261,7 @@ class e107Update
{
$frm = e107::getForm();
$mes = e107::getMessage();
+ $sql = e107::getDb();
$text = "";
@@ -385,8 +377,11 @@ function update_check()
foreach($dbupdate as $func => $rmks) // See which core functions need update
{
+
if (function_exists('update_'.$func))
{
+
+ $sql->db_Mark_Time('Check Core Update_'.$func.' ');
if (!call_user_func('update_'.$func, FALSE))
{
$update_needed = TRUE;
@@ -400,6 +395,7 @@ function update_check()
{
if (function_exists('update_'.$func))
{
+ // $sql->db_Mark_Time('Check Core Update_'.$func.' ');
if (!call_user_func('update_'.$func, FALSE))
{
$update_needed = TRUE;
@@ -600,6 +596,7 @@ function update_core_database($type = '')
//--------------------------------------------
function update_706_to_800($type='')
{
+
global $pref, $e107info;
global $sysprefs, $eArrayStorage;
@@ -1756,6 +1753,7 @@ function core_media_import($cat,$epath)
function update_70x_to_706($type='')
{
+
global $sql,$ns, $pref, $e107info, $admin_log, $emessage;
$just_check = $type == 'do' ? FALSE : TRUE;
diff --git a/e107_admin/userclass2.php b/e107_admin/userclass2.php
index 02daedf4c..b69a7ac92 100644
--- a/e107_admin/userclass2.php
+++ b/e107_admin/userclass2.php
@@ -10,25 +10,15 @@
*
*/
-
-/**
- * e107 Userclass handling - Admin
- *
- * @package e107
- * @subpackage admin
- * @version $Id$;
- */
-
require_once('../class2.php');
+
if (!getperms('4'))
{
e107::redirect('admin');
exit;
}
-include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
-
-
+e107::coreLan('userclass2', true);
class uclass_admin extends e_admin_dispatcher
@@ -141,6 +131,9 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
}
+ /**
+ * @return Object
+ */
public function getUserClassAdmin()
{
return e107::getSingleton('user_class_admin');
@@ -201,7 +194,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$e_userclass->calc_tree();
$text = "".$e_userclass->show_graphical_tree()."
";
- return array('caption'=>'Class Structure', 'text' => $text); //TODO LAN
+ return array('caption'=>UCSLAN_91, 'text' => $text);
// $text .= $e_userclass->show_graphical_tree();
}
@@ -285,7 +278,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
return false;
}
- $ns = e107::getRender();
+ $message = '';
$sql = e107::getDb();
$mes = e107::getMessage();
$e_userclass = $this->getUserClassAdmin();
@@ -333,6 +326,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
// $ns->tablerender('', "".$message."
");
}
+ return null;
}
@@ -342,11 +336,11 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$pref = e107::pref('core');
$mes = e107::getMessage();
- $ns = e107::getRender();
+
$frm = e107::getForm();
// $e_userclass = $this->getUserClassAdmin();
- $text = "";
+ // $text = "";
$initial_classes = varset($pref['initial_user_classes'],'');
@@ -388,7 +382,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$initClassStages = array(1 =>UCSLAN_47, 2=>UCSLAN_48);
$text .= UCSLAN_45."
- ".$frm->select('init_class_stage', $initClassStages, $sel_stage)."".UCSLAN_46."
+ ".$frm->select('init_class_stage', $initClassStages, $sel_stage, 'size=xlarge')."".UCSLAN_46."
". $frm->admin_button('set_initial_classes','no-value','create',LAN_UPDATE)."
";
@@ -429,6 +423,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$pref['initial_user_classes'] = $newval;
e107::getConfig()->setPref($pref)->save(true,true,true);
+
+ return true;
}
@@ -462,6 +458,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
$classID = $this->getController()->getListModel()->get('userclass_id');
+
if(!$this->getController()->getUserClassAdmin()->queryCanDeleteClass($classID))
{
$options['readParms']['deleteClass'] = e_UC_NOBODY;
@@ -484,6 +481,7 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
return $text;
}
+ return '';
}
@@ -500,6 +498,8 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
return $prm->renderPermTable('tabs',$curVal);
}
+
+ return '';
}
}
@@ -519,1259 +519,4 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
-
-$e_sub_cat = 'userclass';
-//define('UC_DEBUG_OPTS',FALSE);
-
-require_once(e_HANDLER.'userclass_class.php'); // Modified class handler
-$e_userclass = new user_class_admin; // Admin functions - should just obliterate any previous object created in class2.php
- // @TODO: Does core object manager need to know somehow?
-
-require_once(e_HANDLER.'form_handler.php');
-
-
-$frm = new e_form();
-// $uc = new uclass_manager;
-$mes = e107::getMessage();
-
-
-$message = '';
-
-/**
- * See whether a user class is editable.
- *
- * (Note: On fixed classes, only some fields are editable)
- *
- * @param integer $class_id
- * @param boolean $redirect - if TRUE, will redirect to site home page if class not editable.
- * @param boolean $fullEdit - set TRUE if full editing required, FALSE if some editing permitted
- *
- * @return boolean - TRUE if class editable (fully or partially), FALSE if not.
- */
-function checkAllowed($classID, $redirect = true, $fullEdit = FALSE)
-{
- global $e_userclass; // TODO: Get rid of this (we need the system admin object; not the user-level object)
- $editLevel = $fullEdit ? 2 : 1;
- if ($e_userclass->queryCanEditClass($classID) >= $editLevel)
- {
- return TRUE;
- }
-
- if ($redirect)
- {
- e107::redirect();
- exit;
- }
-
- return FALSE;
-
- // Next bit probably redundant - editing of some parts of system class data is allowed.
- if(!$uc->isEditableClass($class_id))
- {
- if(!$redirect) return false;
- e107::getMessage()->addSession(UCSLAN_90, E_MESSAGE_ERROR);
- header('location:'.e_SELF);
- exit;
- }
-
- return true;
-}
-
-if (e_QUERY)
-{
- // BC - SO MUCH BAD, never do this at home!!!
- if(isset($_GET['action']))
- {
- $uc_qs = array($_GET['action'], $_GET['id']);
- }
- else $uc_qs = explode('.', e_QUERY);
-}
-$action = varset($uc_qs[0]);
-$params = varset($uc_qs[1],'');
-e107::setRegistry('pageParams', $uc_qs);
-
-//AJAX request check is already made by the API
-/*
-if(e_AJAX_REQUEST)
-{
- $class_num = intval($params);
- if ($action == 'edit')
- {
- require_once(e_HANDLER.'js_helper.php');
- $jshelper = new e_jshelper();
- if(!checkAllowed($class_num, false))
- {
- //This will raise an error
- //'Access denied' is the message which will be thrown
- //by the JS AJAX handler
- e_jshelper::sendAjaxError('403', 'Access denied. '.UCSLAN_90);
- }
- elseif($sql->db_Select('userclass_classes', '*', "userclass_id='".$class_num."' "))
- {
- $row = $sql->db_Fetch();
-
- //Response action - reset all group checkboxes
- $jshelper->addResponseAction('reset-checked', array('group_classes_select' => '0'));
-
- //it's grouped userclass
- if ($row['userclass_type'] == UC_TYPE_GROUP)
- {
- //Response action - show group, hide standard
- $jshelper->addResponseAction('element-invoke-by-id', array('show' => 'userclass_type_groups', 'hide' => 'userclass_type_standard'));
-
- //fill in the classes array
- $tmp = explode(',',$row['userclass_accum']);
- foreach ($tmp as $uid)
- {
- $row['group_classes_select_'.$uid] = $uid;
- }
- }
- else
- {
- //hide group, show standard rows
- $jshelper->addResponseAction('element-invoke-by-id', array('hide' => 'userclass_type_groups', 'show' => 'userclass_type_standard'));
- }
- unset($row['userclass_accum']);
-
- $jshelper->addResponseAction('fill-form', $row);
- $jshelper->sendResponse('XML');
- // $jshelper->sendResponse('JSON'); - another option (tested) - faster transfer!
- }
- else
- {
- e_jshelper::sendAjaxError('500', 'Database read error!');
- }
-
- }
- exit;
-}
-
-e107::getJs()->headerCore('core/admin.js');
-*/
-
-/*
- * Authorization should be done a bit later!
- */
-require_once("auth.php");
-$emessage = e107::getMessage();
-
-//---------------------------------------------------
-// Set Initial Classes
-//---------------------------------------------------
-/*
-if (isset($_POST['set_initial_classes']))
-{
- $changed = $pref['init_class_stage'] != intval($_POST['init_class_stage']);
- $pref['init_class_stage'] = intval($_POST['init_class_stage']);
- $temp = array();
- foreach ($_POST['init_classes'] as $ic)
- {
- $temp[] = intval($ic);
- }
- $newval = implode(',', $temp);
- $temp = varset($pref['initial_user_classes'],'');
- if ($temp != $newval) $changed = TRUE;
- if ($changed)
- {
- $pref['initial_user_classes'] = $newval;
- save_prefs();
- userclass2_adminlog("05","New: {$newval}, Old: {$temp}, Stage: ".$pref['init_class_stage']);
- $message = UCSLAN_41;
- }
- else
- {
- $message = LAN_NOCHANGE_NOTSAVED;
- }
-}
-*/
-
-//---------------------------------------------------
-// Delete existing class
-//---------------------------------------------------
-
-/*
-if (isset($_POST['etrigger_delete']) && !empty($_POST['etrigger_delete']))
-{
- $classID = intval(array_shift(array_keys($_POST['etrigger_delete'])));
- //checkAllowed($classID);
-
- if ($e_userclass->queryCanDeleteClass($classID))
- {
- if ($e_userclass->delete_class($class_id) !== FALSE)
- {
- userclass2_adminlog("02","ID:{$class_id} (".$e_userclass->uc_get_classname($classID).")");
- if ($sql->db_Select('user', 'user_id, user_class', "user_class = '{$classID}' OR user_class REGEXP('^{$classID},') OR user_class REGEXP(',{$classID},') OR user_class REGEXP(',{$classID}$')"))
- { // Delete existing users from class
- while ($row = $sql->db_Fetch())
- {
- $uidList[$row['user_id']] = $row['user_class'];
- }
- $e_userclass->class_remove($classID, $uidList);
- }
- $e_pref = e107::getConfig();
- if($e_pref->isData('frontpage/'.$classID))
- {
- $e_pref->removePref('frontpage/'.$classID)->save(false);
- }
- // if (isset($pref['frontpage'][$class_id]))
- {
- // unset($pref['frontpage'][$class_id]); // (Should work with both 0.7 and 0.8 front page methods)
- // save_prefs();
- }
- $emessage->add(LAN_DELETED, E_MESSAGE_SUCCESS);
- }
- else
- {
- $emessage->add(UCSLAN_10, E_MESSAGE_ERROR);
- }
- }
- else
- {
- $emessage->add(UCSLAN_10, E_MESSAGE_ERROR);
- }
-}*/
-
-
-
-//---------------------------------------------------
-// Add/Edit class information
-//---------------------------------------------------
-/*
-
-if (isset($_POST['createclass'])) // Add or edit
-{
- $fullEdit = TRUE; // Most of the time, we are allowed to edit everything
- $do_tree = FALSE; // Set flag to rebuild tree if no errors
- $forwardVals = FALSE; // Set to ripple through existing values to a subsequent pass
-
- $tempID = intval(varset($_POST['userclass_id'], -1));
- if (($tempID < 0) && $e_userclass->ucGetClassIDFromName($class_record['userclass_name']))
- {
- $emessage->add(UCSLAN_63, E_MESSAGE_WARNING); // Duplicate name
- $forwardVals = TRUE;
- }
- if ($tempID > 0)
- {
- $fullEdit = $e_userclass->queryCanEditClass($tempID) == 2;
- }
-
- $class_record = array(
- 'userclass_description' => varset($tp->toDB($_POST['userclass_description']),''),
- 'userclass_editclass' => intval(varset($_POST['userclass_editclass'],0)),
- 'userclass_parent' => intval(varset($_POST['userclass_parent'],0)),
- 'userclass_visibility' => intval(varset($_POST['userclass_visibility'],0)),
- 'userclass_icon' => $tp->toDB(varset($_POST['userclass_icon'],''))
- );
-
- if ($fullEdit)
- {
- $class_record['userclass_name'] = varset($tp->toDB($_POST['userclass_name']),'');
- $class_record['userclass_type'] = intval(varset($_POST['userclass_type'],UC_TYPE_STD));
- if ($class_record['userclass_type'] == UC_TYPE_GROUP)
- {
- $temp = array();
- foreach ($_POST['group_classes_select'] as $gc)
- {
- $temp[] = intval($gc);
- }
- $class_record['userclass_accum'] = implode(',',$temp);
- }
- }
-
-
- if ($e_userclass->checkAdminInfo($class_record, $tempID) === FALSE)
- {
- $emessage->add(UCSLAN_86); // Some fixed values changed
- $forwardVals = TRUE;
- }
-
- if (!$forwardVals)
- {
- if ($tempID > 0)
- { // Editing existing class here
- checkAllowed($tempID);
- $class_record['userclass_id'] = $tempID;
- $e_userclass->save_edited_class($class_record);
- userclass2_adminlog('03',"ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")");
- $do_tree = TRUE;
- //$message .= LAN_UPDATED.': '.LAN_USERCLASS;
- $emessage->add(LAN_UPDATED.': '.LAN_USERCLASS, E_MESSAGE_SUCCESS);
- }
- else
- { // Creating new class
- if($class_record['userclass_name'])
- {
- if (getperms("0") || ($class_record['userclass_editclass'] && check_class($class_record['userclass_editclass'])))
- {
- $i = $e_userclass->findNewClassID();
- if ($i === FALSE)
- {
- //$message = UCSLAN_85;
- $emessage->add(UCSLAN_85, E_MESSAGE_WARNING);
- }
- else
- {
- $class_record['userclass_id'] = $i;
- $e_userclass->add_new_class($class_record);
- userclass2_adminlog("01","ID:{$class_record['userclass_id']} (".$class_record['userclass_name'].")");
- $do_tree = TRUE;
- //$message .= LAN_UPDATED.': '.LAN_USERCLASS;
- $emessage->add(LAN_UPDATED.': '.LAN_USERCLASS, E_MESSAGE_SUCCESS);
- }
- }
- else
- {
- header("location:".SITEURL);
- exit;
- }
- }
- else
- {
- // Class name required
- //$message = UCSLAN_37;
- $emessage->add(UCSLAN_37, E_MESSAGE_ERROR);
- $forwardVals = TRUE;
- }
- }
- }
-
- if ($do_tree)
- {
- $e_userclass->calc_tree();
- $e_userclass->save_tree();
- }
-}
-*/
-
-/*
-if ($message)
-{
- $emessage->add($message);
-}
-
-class uclassFrm extends e_form
-{
- function userclass_type($curVal,$mode)
- {
- $types = array(
- UC_TYPE_STD => UCSLAN_80,
- UC_TYPE_GROUP => UCSLAN_81
- );
-
- return varset($types[$curVal]);
- }
-}
-*/
-
-
-/*
-if(!e_QUERY || $action == 'list')
-{
- $uc->show_existing();
-
-}
-*/
-if(isset($_GET['id']) && $_GET['action'] == 'edit')
-{
- $action = 'config';
- $_POST['existing'] = $_GET['id'];
-}
-
-switch ($action)
-{
-//-----------------------------------
-// Class management
-//-----------------------------------
- case 'config' :
- $fullEdit = TRUE;
- if(isset($_POST['existing']))
- {
- $params = 'edit';
- $class_num = intval(varset($_POST['existing'],0));
- $fullEdit = $e_userclass->queryCanEditClass($class_num) == 2;
- }
- else
- {
- $class_num = intval(varset($uc_qs[2],0));
- }
-
- $userclass_id = 0; // Set defaults for new class to start with
- $userclass_name = '';
- $userclass_description = '';
- $userclass_editclass = e_UC_ADMIN;
- $userclass_visibility = e_UC_ADMIN;
- $userclass_parent = e_UC_NOBODY;
- $userclass_icon = '';
- $userclass_type = UC_TYPE_STD;
- $userclass_groupclass = '';
- if ($params == 'edit' || $forwardVals)
- {
- if (!isset($forwardVals))
- { // Get the values from DB (else just recycle data uer was trying to store)
- checkAllowed($class_num);
- $sql->db_Select('userclass_classes', '*', "userclass_id='".intval($class_num)."' ");
- $class_record = $sql->db_Fetch();
- $userclass_id = $class_record['userclass_id']; // Update fields from DB if editing
- }
- $userclass_name = $class_record['userclass_name'];
- $userclass_description = $class_record['userclass_description'];
- $userclass_editclass = $class_record['userclass_editclass'];
- $userclass_visibility = $class_record['userclass_visibility'];
- $userclass_parent = $class_record['userclass_parent'];
- $userclass_icon = $class_record['userclass_icon'];
- $userclass_type = $class_record['userclass_type'];
- if ($userclass_type == UC_TYPE_GROUP)
- {
- $userclass_groupclass = $class_record['userclass_accum'];
- }
- }
-
- $class_total = $sql->db_Count('userclass_classes', '(*)');
-
- $text = " ";
-
-
-// $text .= $e_userclass->show_graphical_tree();
-
-$title = $params == 'edit' ? LAN_EDIT : LAN_CREATE;
-$ns->tablerender(ADLAN_38.SEP.$title, $text);
-unset($title);
- break; // End of 'config' option
-
-
-
-
-//-----------------------------------
-// Initial User class(es)
-//-----------------------------------
-/*
- case 'initial' :
-
- $initial_classes = varset($pref['initial_user_classes'],'');
- $irc = explode(',',$initial_classes);
- $icn = array();
- foreach ($irc as $i)
- {
- if (trim($i)) $icn[] = $e_userclass->uc_get_classname($i);
- }
-
-// $class_text = $e_userclass->uc_checkboxes('init_classes', $initial_classes, 'classes, force', TRUE);
- $class_text = $e_userclass->vetted_tree('init_classes',array($e_userclass,'checkbox_desc'), $initial_classes, 'classes, force, no-excludes');
-
- $mes->addInfo(UCSLAN_49);
-
- $text = " ";
- $ns->tablerender(ADLAN_38.SEP.UCSLAN_40, $mes->render() . $text);
-
- break; // End of 'initial'
-*/
-
-//-----------------------------------
-// Debug aids
-//-----------------------------------
- case 'debug' :
-// if (!check_class(e_UC_MAINADMIN)) break; // Let ordinary admins see this if they know enough to specify the URL
- $text .= $e_userclass->show_graphical_tree(TRUE); // Print with debug options
- $ns->tablerender(LAN_SETTINGS, $text);
-
- $text = "