mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
Merge branch 'master' into lib
This commit is contained in:
10
.editorconfig
Normal file
10
.editorconfig
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
[*.php]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
31
class2.php
31
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:<pre>'."\n".print_r($backtrace, true).'</pre>');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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:<pre>'."\n".print_r($backtrace, true).'</pre>');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return e107::getConfig()->loadData($pref, false)->save(false, true);
|
||||
break;
|
||||
|
||||
|
@@ -22,7 +22,7 @@
|
||||
*/
|
||||
|
||||
require_once('class2.php');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||
|
||||
if (vartrue(e107::getPref('comments_disabled')))
|
||||
{
|
||||
|
@@ -24,7 +24,7 @@ if(!check_class($active) && empty($contactInfo))
|
||||
require_once(e_HANDLER."secure_img_handler.php");
|
||||
$sec_img = new secure_image;
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_'.e_PAGE);
|
||||
|
||||
define('PAGE_NAME', LANCONTACT_00);
|
||||
|
||||
|
@@ -69,10 +69,10 @@ require_once(e_ADMIN.'boot.php');
|
||||
require_once(e_ADMIN.'auth.php');
|
||||
require_once(e_HANDLER.'upload_handler.php');
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(Start Admin Checks)');
|
||||
new admin_start;
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(After Admin Checks)');
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'infopanel'; // Shouldn't be needed - but just in case
|
||||
@@ -110,7 +110,7 @@ class admin_start
|
||||
function __construct()
|
||||
{
|
||||
|
||||
if(!getperms('0')) // don't display this tuff to regular admins only main admin.
|
||||
if(!getperms('0') || varset($_GET['mode']) === 'customize') // don't display this tuff to regular admins only main admin.
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -153,8 +153,10 @@ class admin_start
|
||||
|
||||
e107::getDb()->db_Mark_Time('Check Paths');
|
||||
$this->checkPaths();
|
||||
|
||||
e107::getDb()->db_Mark_Time('Check Timezone');
|
||||
$this->checkTimezone();
|
||||
|
||||
e107::getDb()->db_Mark_Time('Check Writable');
|
||||
$this->checkWritable();
|
||||
|
||||
@@ -252,14 +254,26 @@ class admin_start
|
||||
return null;
|
||||
}
|
||||
|
||||
$checked = e107::getSession()->get('core-update-checked');
|
||||
|
||||
if(!deftrue('e_DEBUG') && $checked === true)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//$sc = e107::getScBatch('admin');
|
||||
//echo $tp->parseTemplate('{ADMIN_COREUPDATE=alert}',true, $sc);
|
||||
|
||||
|
||||
|
||||
global $dont_check_update, $e107info;
|
||||
global $dbupdate, $dbupdatep, $e107cache;
|
||||
|
||||
require_once(e_ADMIN.'update_routines.php');
|
||||
|
||||
e107::getSession()->set('core-update-checked',true);
|
||||
|
||||
|
||||
if(update_check() === true)
|
||||
{
|
||||
if(e_DEBUG !== true)
|
||||
|
@@ -10,14 +10,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage admin
|
||||
*
|
||||
* Handle display of the various system logs
|
||||
*/
|
||||
|
||||
/*
|
||||
* Preferences:
|
||||
* 'sys_log_perpage' - number of events per page
|
||||
@@ -37,11 +29,8 @@ if(! getperms('S'))
|
||||
exit();
|
||||
}
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||
// Main language file should automatically be loaded
|
||||
// Load language files for log messages
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_log_messages.php'); //... for core functions
|
||||
|
||||
e107::coreLan('admin_log', true);
|
||||
e107::coreLan('log_messages', true);
|
||||
|
||||
if(is_array($pref['lan_log_list'])) //... and for any plugins which support it
|
||||
{
|
||||
@@ -51,7 +40,7 @@ if(is_array($pref['lan_log_list'])) //... and for any plugins which support it
|
||||
|
||||
// echo "orig = ".$file." ";
|
||||
//e107::lan($path,'log',true);
|
||||
include_lan(e_PLUGIN.$path.'/languages/'.$file);
|
||||
e107::includeLan(e_PLUGIN.$path.'/languages/'.$file);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,7 +861,7 @@ if(is_array($pref['lan_log_list'])) //... and for any plugins which support it
|
||||
|
||||
// echo "orig = ".$file." ";
|
||||
//e107::lan($path,'log',true);
|
||||
include_lan(e_PLUGIN.$path.'/languages/'.$file);
|
||||
e107::includeLan(e_PLUGIN.$path.'/languages/'.$file);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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');
|
||||
|
@@ -19,6 +19,9 @@ if (!defined('e107_INIT'))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(Start auth.php)');
|
||||
|
||||
define('e_CAPTCHA_FONTCOLOR','#F9A533');
|
||||
|
||||
|
||||
|
@@ -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
|
||||
{
|
||||
|
||||
|
@@ -8,16 +8,6 @@
|
||||
*
|
||||
* Banlist export
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* e107 Banlist administration
|
||||
*
|
||||
* @package e107
|
||||
* @subpackage admin
|
||||
* @version $Id$;
|
||||
*/
|
||||
|
||||
require_once('../class2.php');
|
||||
|
@@ -8,8 +8,6 @@
|
||||
*
|
||||
* Admin BootLoader
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT'))
|
||||
@@ -17,7 +15,7 @@ if (!defined('e107_INIT'))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(Start boot.php)');
|
||||
header('Content-type: text/html; charset=utf-8', TRUE);
|
||||
|
||||
define('ADMINFEED', 'https://e107.org/adminfeed');
|
||||
@@ -115,7 +113,7 @@ if(ADMIN && e_AJAX_REQUEST && varset($_GET['mode']) == 'addons' )
|
||||
$text .= '<div class="media">';
|
||||
$text .= '<div class="media-left">
|
||||
<a href="'.$link.'">
|
||||
<img class="media-object img-rounded" src="'.$img.'" style="width:100px">
|
||||
<img class="media-object img-rounded rounded" src="'.$img.'" style="width:100px">
|
||||
</a>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
@@ -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
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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 = "<a href='".e_SELF."?{$query}' class='btn btn-default' title='".LAN_EDIT."' data-toggle='tooltip' data-placement='left'>
|
||||
".ADMIN_EDIT_ICON."</a>";
|
||||
|
||||
$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");
|
||||
@@ -232,6 +253,8 @@ class page_chapters_ui extends e_admin_ui
|
||||
return false;
|
||||
}
|
||||
|
||||
$new_data = e107::getCustomFields()->processConfigPost('chapter_fields', $new_data);
|
||||
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
@@ -239,8 +262,39 @@ class page_chapters_ui extends e_admin_ui
|
||||
public function beforeUpdate($new_data, $old_data, $id)
|
||||
{
|
||||
// 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;
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -270,6 +324,32 @@ class page_chapters_form_ui extends e_admin_form_ui
|
||||
return $frm->text('chapter_name',$curVal,255,'size=xxlarge');
|
||||
}
|
||||
|
||||
if($mode == 'filter')
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if($mode == 'batch')
|
||||
{
|
||||
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;
|
||||
@@ -283,8 +363,6 @@ class page_chapters_form_ui extends e_admin_form_ui
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 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,6 +573,8 @@ 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."),
|
||||
@@ -529,10 +609,14 @@ 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 )
|
||||
{
|
||||
$key = key($_POST['menu_delete']);
|
||||
@@ -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;
|
||||
}
|
||||
@@ -595,6 +679,17 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
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 +714,7 @@ 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");
|
||||
$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'];
|
||||
@@ -634,15 +728,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
|
||||
*/
|
||||
@@ -712,6 +954,9 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
// $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();
|
||||
|
@@ -50,7 +50,7 @@ require_once(e_ADMIN."auth.php");
|
||||
Nuvolo Icons, PHPMailer, TCPDF, PHP UTF8
|
||||
</p>
|
||||
|
||||
<div class="copyright">Copyright <a href="http://e107.org/content/About-Us:The-Team" title="e107 Team">e107 Inc.</a> 2008-2013</div>
|
||||
<div class="copyright">Copyright <a href="http://e107.org/content/About-Us:The-Team" title="e107 Team">e107 Inc.</a> 2008-2017</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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/');
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -8,8 +8,6 @@
|
||||
*
|
||||
* URL and front controller Management
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
require_once('../class2.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'))
|
||||
{
|
||||
|
@@ -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');
|
||||
|
@@ -99,6 +99,16 @@ function loadJSAddons()
|
||||
|
||||
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();
|
||||
|
@@ -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 = "
|
||||
<div class='thumbnail'>
|
||||
<label for='".$for."' ><img class='img-responsive' src='".$img_path."' alt='{$image_name}' title='".IMALAN_66.": {$image_name}' /></label>
|
||||
<label for='".$for."' ><img class='img-responsive img-fluid' src='".$img_path."' alt='{$image_name}' title='".IMALAN_66.": {$image_name}' /></label>
|
||||
</div>
|
||||
";
|
||||
|
||||
|
@@ -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');
|
||||
|
@@ -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");
|
||||
|
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||
* Copyright (C) 2008-2017 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
@@ -15,7 +15,7 @@ if (!getperms('L'))
|
||||
e107::redirect('admin');
|
||||
exit;
|
||||
}
|
||||
//include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||
|
||||
e107::coreLan('language', true);
|
||||
|
||||
$e_sub_cat = 'language';
|
||||
@@ -25,11 +25,6 @@ if(!empty($_GET['iframe']))
|
||||
define('e_IFRAME', true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class language_admin extends e_admin_dispatcher
|
||||
{
|
||||
|
||||
@@ -639,7 +634,7 @@ require_once ("auth.php");
|
||||
$frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_lancheck.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_lancheck.php");
|
||||
require_once(e_ADMIN."lancheck.php");
|
||||
require_once(e_HANDLER."language_class.php");
|
||||
|
||||
@@ -1091,7 +1086,7 @@ class lanDeveloper
|
||||
|
||||
function disableUnused($data)
|
||||
{
|
||||
$data = str_replace("2008-2010","2008-2013", $data);
|
||||
$data = str_replace("2008-2010","2008-2017", $data);
|
||||
$data = str_replace(' * $URL$
|
||||
* $Revision$
|
||||
* $Id$
|
||||
@@ -1166,9 +1161,10 @@ class lanDeveloper
|
||||
// print_a($_SESSION['languageTools_lanFileList']);
|
||||
|
||||
|
||||
$text .= "
|
||||
<tr>
|
||||
$text .= " <tr>
|
||||
<td><div class='alert-info alert alert-block'>".e107::getParser()->toHTML(LANG_LAN_140, true)."</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='form-inline'>
|
||||
<select name='deprecatedLans[]' multiple style='height:200px'>
|
||||
<option value=''>".LANG_LAN_141."</option>";
|
||||
@@ -1176,11 +1172,18 @@ class lanDeveloper
|
||||
|
||||
$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 .= "<option value='auto' {$selected}>".LANG_LAN_142."</option><optgroup label='".LANG_LAN_143."'>\n";//Auto-Detect
|
||||
|
||||
asort($_SESSION['languageTools_lanFileList']);
|
||||
foreach($_SESSION['languageTools_lanFileList'] as $val)
|
||||
{
|
||||
if(strstr($val,e_SYSTEM))
|
||||
|
@@ -10,15 +10,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package e107
|
||||
* @subpackage admin
|
||||
* @version $Id$
|
||||
*
|
||||
* Manage site navigation links
|
||||
*/
|
||||
|
||||
require_once("../class2.php");
|
||||
|
||||
if (!getperms("I"))
|
||||
{
|
||||
e107::redirect('admin');
|
||||
|
@@ -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 .= "<tr><td>DomainKeys Identified Mail (DKIM)</td><td class='form-inline'>".$frm->button('DKIM_generate',1,'primary','Generate Public/Private keys')."
|
||||
<span class='label label-warning'>Developer Mode Only</span></td></tr>";
|
||||
$text .= "<tr><td>DomainKeys Identified Mail (DKIM)</td><td class='form-inline'>".$frm->button('DKIM_generate',1,'primary',LAN_MAILOUT_267)."
|
||||
<span class='label label-warning'>".LAN_MAILOUT_268."</span></td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@@ -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 .= "<span class='btn-group'>";
|
||||
$text .= "<a href='".$link."' class='btn btn-default' title='Send Mail'>".E_32_MAIL."</a>";
|
||||
$text .= "<a rel='external' class='btn btn-default e-modal' data-modal-caption='Email preview' href='".$preview."' title='Preview'>".E_32_SEARCH."</a>";
|
||||
$text .= "<a href='".$link."' class='btn btn-default' title='".LAN_MAILOUT_08."'>".E_32_MAIL."</a>";
|
||||
$text .= "<a rel='external' class='btn btn-default e-modal' data-modal-caption='Email preview' href='".$preview."' title='".LAN_PREVIEW."'>".E_32_SEARCH."</a>";
|
||||
|
||||
$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 = "<span class='btn-group'>";
|
||||
$text .= "<a href='".$link."' class='btn btn-default e-modal' data-modal-caption='Recipients for Mail #".$id."' title='Recipients'>".E_32_USER."</a>";
|
||||
$text .= "<a rel='external' class='btn btn-default e-modal' data-modal-caption='Email preview' href='".$preview."' title='Preview'>".E_32_SEARCH."</a>";
|
||||
$text .= "<a href='".$link."' class='btn btn-default e-modal' data-modal-caption='Recipients for Mail #".$id."' title='".LAN_MAILOUT_173."'>".E_32_USER."</a>";
|
||||
$text .= "<a rel='external' class='btn btn-default e-modal' data-modal-caption='Email preview' href='".$preview."' title='".LAN_PREVIEW."'>".E_32_SEARCH."</a>";
|
||||
|
||||
$attributes['readParms']['editClass'] = e_UC_NOBODY;
|
||||
$text .= $this->renderValue('options',$value,$attributes,$id);
|
||||
|
@@ -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 .= "<span class='pull-right'><a class='e-tip' title=\"".$tp->toAttribute($diz)."\">".ADMIN_INFO_ICON."</a></span>";
|
||||
|
||||
|
@@ -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");
|
||||
|
@@ -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");
|
||||
|
@@ -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]);
|
||||
|
@@ -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)
|
||||
{
|
||||
|
||||
|
@@ -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
|
||||
{
|
||||
|
@@ -6,15 +6,10 @@
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/phpinfo.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
require_once("../class2.php");
|
||||
|
||||
if(!getperms("0"))
|
||||
{
|
||||
e107::redirect('admin');
|
||||
|
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
require_once("../class2.php");
|
||||
|
||||
if(!getperms("Z"))
|
||||
{
|
||||
e107::redirect('admin');
|
||||
|
@@ -9,6 +9,7 @@
|
||||
* Administration - Site Preferences
|
||||
*
|
||||
*/
|
||||
|
||||
require_once ("../class2.php");
|
||||
|
||||
if(isset($_POST['newver']))
|
||||
@@ -23,11 +24,11 @@ if(! getperms("1"))
|
||||
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");
|
||||
|
||||
|
||||
|
@@ -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();
|
||||
|
@@ -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';
|
||||
|
||||
|
@@ -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();
|
||||
|
@@ -1,26 +1,14 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
| e107 website system
|
||||
|
|
||||
| Copyright (C) 2008-2010 e107 Inc (e107.org)
|
||||
| http://e107.org
|
||||
|
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $URL$
|
||||
| $Revision$
|
||||
| $Id$
|
||||
| $Author$
|
||||
+----------------------------------------------------------------------------+
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package e107
|
||||
* @subpackage admin
|
||||
* @version $Id$;
|
||||
*
|
||||
* Update routines from older e107 versions to current.
|
||||
*
|
||||
@@ -33,7 +21,7 @@
|
||||
|
||||
require_once('../class2.php');
|
||||
require_once(e_HANDLER.'db_table_admin_class.php');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_e107_update.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_e107_update.php');
|
||||
// Modified update routine - combines checking and update code into one block per function
|
||||
// - reduces code size typically 30%.
|
||||
// - keeping check and update code together should improve clarity/reduce mis-types etc
|
||||
@@ -65,6 +53,7 @@ if(is_readable(e_ADMIN.'ver.php'))
|
||||
}
|
||||
|
||||
$mes = e107::getMessage();
|
||||
/*
|
||||
// If $dont_check_update is both defined and TRUE on entry, a check for update is done only once per 24 hours.
|
||||
$dont_check_update = varset($dont_check_update, FALSE);
|
||||
|
||||
@@ -81,8 +70,9 @@ if ($dont_check_update === TRUE)
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
$dont_check_update = false;
|
||||
|
||||
if (!$dont_check_update)
|
||||
{
|
||||
@@ -188,6 +178,7 @@ class e107Update
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
// foreach($this->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;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -16,8 +16,7 @@ if (!getperms('4'))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
include_lan(e_LANGUAGEDIR . e_LANGUAGE . '/admin/lan_' . e_PAGE);
|
||||
e107::coreLan('users_extended', true);
|
||||
|
||||
if(varset($_GET['mode']) == "ajax")
|
||||
{
|
||||
@@ -292,7 +291,7 @@ e107::js('footer-inline', js());
|
||||
|
||||
'main/list' => array('caption'=> LAN_MANAGE, 'perm' => '0'),
|
||||
'main/add' => array('caption'=> EXTLAN_45, 'perm' => '0'),
|
||||
'main/create' => array('caption'=> 'Add Custom Field', 'perm' => '0'),
|
||||
'main/create' => array('caption'=> EXTLAN_81, 'perm' => '0'),
|
||||
'cat/list' => array('caption'=> LAN_CATEGORIES, 'perm' => '0'),
|
||||
'cat/create' => array('caption'=> LAN_CREATE_CATEGORY, 'perm' => '0'),
|
||||
|
||||
@@ -356,13 +355,13 @@ e107::js('footer-inline', js());
|
||||
'user_extended_struct_name' => array ( 'title' => LAN_NAME, 'type' => 'text', 'data' => 'str', 'readonly'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => 'tdClassRight=form-inline&pre=user_ ', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_text' => array ( 'title' => EXTLAN_79, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => 'constant=1', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_type' => array ( 'title' => EXTLAN_2, 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_values' => array ( 'title' => "Values", 'type' => 'method', 'nolist'=>true, 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_values' => array ( 'title' => EXTLAN_82, 'type' => 'method', 'nolist'=>true, 'data' => 'str', 'width' => 'auto', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_default' => array ( 'title' => EXTLAN_16, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_parent' => array ( 'title' => LAN_CATEGORY, 'type' => 'dropdown', 'tab'=>1, 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => array('size'=>'xxlarge'), 'class' => 'left', 'thclass' => 'left', ),
|
||||
|
||||
// These are combined into user_extended_struct_parms on submit.
|
||||
'field_placeholder' => array('title'=>'Placeholder', 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
'field_helptip' => array('title'=>'Help Tip', 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
'field_placeholder' => array('title'=>EXTLAN_83, 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
'field_helptip' => array('title'=>EXTLAN_84, 'tab'=>1, 'type'=>'text', 'data'=>false, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
|
||||
'field_include' => array('title'=> EXTLAN_15, 'tab'=>1, 'type'=>'textarea', 'data'=>false, 'help'=>EXTLAN_51, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
'field_regex' => array('title'=> EXTLAN_52, 'tab'=>1, 'type'=>'text', 'data'=>false, 'help'=> EXTLAN_53, 'writeParms'=>array('size'=>'xxlarge')),
|
||||
@@ -374,7 +373,7 @@ e107::js('footer-inline', js());
|
||||
'user_extended_struct_applicable' => array ( 'title' => EXTLAN_5, 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true, 'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_parms' => array ( 'title' => "Params", 'type' => 'hidden', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_read' => array ( 'title' =>EXTLAN_6, 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true,'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_write' => array ( 'title' => 'Write Access', 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true, 'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_write' => array ( 'title' => EXTLAN_7, 'type' => 'userclass', 'data' => 'int', 'filter'=>true, 'batch'=>true, 'width' => '10%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_signup' => array ( 'title' => 'Signup', 'type' => 'hidden', 'nolist'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_order' => array ( 'title' => LAN_ORDER, 'type' => 'hidden', 'nolist'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'options' => array ( 'title' => LAN_OPTIONS, 'type' => 'method', 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'readParms'=>'sort=1' ),
|
||||
@@ -540,7 +539,7 @@ e107::js('footer-inline', js());
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->addSuccess("User Extended Column deleted from table"); //TODO LAN
|
||||
$mes->addSuccess(EXTLAN_86);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -846,7 +845,7 @@ e107::js('footer-inline', js());
|
||||
$curVal = '1';
|
||||
}
|
||||
|
||||
$types = e107::getUserExt()->user_extended_types;
|
||||
$types = e107::getUserExt()->getFieldTypes();
|
||||
|
||||
return $this->select('user_extended_struct_type', $types, $curVal, array('class'=>'tbox e-select'));
|
||||
|
||||
@@ -943,7 +942,7 @@ e107::js('footer-inline', js());
|
||||
<input type='button' class='btn btn-primary' value='".EXTLAN_48."' onclick=\"duplicateHTML('value_line','value_container');\" />
|
||||
<br /><span class='field-help'>".EXTLAN_17."</span>";
|
||||
|
||||
$text .= "<div style='margin-top:10px'>".$frm->checkbox('sort_user_values',1, false, "Sort values")."</div>";
|
||||
$text .= "<div style='margin-top:10px'>".$frm->checkbox('sort_user_values',1, false, EXTLAN_87)."</div>";
|
||||
$text .= "</div>";
|
||||
|
||||
|
||||
@@ -1077,7 +1076,7 @@ e107::js('footer-inline', js());
|
||||
|
||||
// 'user_extended_struct_parms' => array ( 'title' => "Params", 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_read' => array ( 'title' =>EXTLAN_6, 'type' => 'userclass', 'data' => 'int', 'width' => '15%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_write' => array ( 'title' => 'Write Access', 'type' => 'userclass', 'data' => 'int', 'width' => '15%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_write' => array ( 'title' => EXTLAN_7, 'type' => 'userclass', 'data' => 'int', 'width' => '15%', 'inline' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
// 'user_extended_struct_signup' => array ( 'title' => 'Signup', 'type' => 'boolean', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'user_extended_struct_order' => array ( 'title' => LAN_ORDER, 'type' => 'number', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'right', 'thclass' => 'right', ),
|
||||
'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'readParms'=>'sort=0' ),
|
||||
@@ -2211,7 +2210,7 @@ class users_ext
|
||||
$var['pre']['text'] = EXTLAN_45;
|
||||
$var['pre']['link'] = e_SELF."?pre";
|
||||
|
||||
$var['editext']['text'] = "Add Custom Field";
|
||||
$var['editext']['text'] = EXTLAN_81;
|
||||
$var['editext']['link'] = e_SELF."?editext";
|
||||
|
||||
$var['cat']['text'] = EXTLAN_35;
|
||||
|
@@ -6,16 +6,10 @@
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/ver.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$e107info['e107_version'] = "2.1.4 (git)";
|
||||
$e107info['e107_version'] = "2.1.5 (git)";
|
||||
|
||||
?>
|
@@ -15,7 +15,7 @@ if (!getperms("M"))
|
||||
exit;
|
||||
}
|
||||
|
||||
e107::lan('core','wmessage',true);
|
||||
e107::coreLan('wmessage', true);
|
||||
|
||||
|
||||
class wmessage_admin extends e_admin_dispatcher
|
||||
|
@@ -133,7 +133,7 @@ class bb_img extends e_bb_base
|
||||
|
||||
$imgParms['title'] = $imgParms['alt'] ;
|
||||
|
||||
$imgParms['class'] = "img-rounded bbcode ".e107::getBB()->getClass('img');; // This will be overridden if a new class is specified
|
||||
$imgParms['class'] = "img-rounded rounded bbcode ".e107::getBB()->getClass('img');; // This will be overridden if a new class is specified
|
||||
|
||||
if($mode == 'string')
|
||||
{
|
||||
|
@@ -1,6 +1,6 @@
|
||||
//<?
|
||||
$class = e107::getBB()->getClass('quote');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_parser_functions.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_parser_functions.php");
|
||||
|
||||
if(deftrue('BOOTSTRAP'))
|
||||
{
|
||||
|
@@ -16,6 +16,10 @@ if (!defined('e107_INIT')) { exit; }
|
||||
class admin_shortcodes
|
||||
{
|
||||
|
||||
const ADMIN_NAV_HOME = 'enav_home'; // Must match with admin_template. ie. {ADMIN_NAVIGATION=enav_home} and $E_ADMIN_NAVIGATION['button_enav_home']
|
||||
const ADMIN_NAV_LANGUAGE = 'enav_language';
|
||||
const ADMIN_NAV_LOGOUT = 'enav_logout';
|
||||
|
||||
function cronUpdateRender($parm,$cacheData)
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
@@ -707,7 +711,7 @@ class admin_shortcodes
|
||||
{
|
||||
if(e_DEBUG !== false)
|
||||
{
|
||||
return "<div class='navbar-right navbar-text'><span class='label label-warning'>DEBUG MODE</span> </div>";
|
||||
return "<div class='navbar-right navbar-text admin-icon-debug' title='DEBUG MODE ACTIVE'>".e107::getParser()->toGlyph('fa-bug')." </div>";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1418,7 +1422,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION'));
|
||||
global $$tmpl;
|
||||
|
||||
if($parm == 'home' || $parm == 'logout' || $parm == 'language' || $parm == 'pm')
|
||||
if($parm == self::ADMIN_NAV_HOME || $parm == self::ADMIN_NAV_LOGOUT || $parm == self::ADMIN_NAV_LANGUAGE || $parm == 'pm')
|
||||
{
|
||||
$template = $$tmpl;
|
||||
|
||||
@@ -1480,6 +1484,7 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$tmp['sub_class'] = '';
|
||||
$tmp['sort'] = false;
|
||||
|
||||
|
||||
if(vartrue($pref['admin_slidedown_subs']) && vartrue($array_sub_functions[$key]))
|
||||
{
|
||||
$tmp['sub_class'] = 'sub';
|
||||
@@ -1649,15 +1654,16 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$tp = e107::getParser();
|
||||
$frm = e107::getForm();
|
||||
|
||||
if($type == 'home')
|
||||
if($type === self::ADMIN_NAV_HOME)
|
||||
{
|
||||
|
||||
$menu_vars['home']['text'] = ""; // ADLAN_53;
|
||||
$menu_vars['home']['link'] = e_HTTP.'index.php';
|
||||
$menu_vars['home']['image'] = $tp->toGlyph('fa-home'); // "<i class='fa fa-home'></i>" ; // "<img src='".E_16_NAV_LEAV."' alt='".ADLAN_151."' class='icon S16' />";
|
||||
$menu_vars['home']['image_src'] = ADLAN_151;
|
||||
$menu_vars['home']['sort'] = 1;
|
||||
$menu_vars['home']['sub_class'] = 'sub';
|
||||
$menu_vars[$type]['text'] = ""; // ADLAN_53;
|
||||
$menu_vars[$type]['link'] = e_HTTP.'index.php';
|
||||
$menu_vars[$type]['image'] = $tp->toGlyph('fa-home'); // "<i class='fa fa-home'></i>" ; // "<img src='".E_16_NAV_LEAV."' alt='".ADLAN_151."' class='icon S16' />";
|
||||
$menu_vars[$type]['image_src'] = ADLAN_151;
|
||||
$menu_vars[$type]['sort'] = 1;
|
||||
$menu_vars[$type]['sub_class'] = 'sub';
|
||||
$menu_vars[$type]['template'] = $type;
|
||||
|
||||
// Sub Links for 'home'.
|
||||
require_once(e_HANDLER."sitelinks_class.php");
|
||||
@@ -1682,10 +1688,10 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$c++;
|
||||
}
|
||||
|
||||
$menu_vars['home']['sub'] = $tmp;
|
||||
$menu_vars[$type]['sub'] = $tmp;
|
||||
// --------------------
|
||||
}
|
||||
elseif($type == 'logout')
|
||||
elseif($type == self::ADMIN_NAV_LOGOUT)
|
||||
{
|
||||
$tmp = array();
|
||||
|
||||
@@ -1774,14 +1780,15 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$tmp[8]['image_large_src'] = '';
|
||||
$tmp[8]['link_class'] = '';
|
||||
|
||||
$menu_vars['logout']['text'] = ADMINNAME; // ""; // ADMINNAME;
|
||||
$menu_vars['logout']['link'] = '#';
|
||||
$menu_vars['logout']['image'] = $tp->toGlyph('fa-user'); // "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
|
||||
$menu_vars['logout']['image_src'] = LAN_LOGOUT;
|
||||
$menu_vars['logout']['sub'] = $tmp;
|
||||
$menu_vars[$type]['text'] = ''; // ADMINNAME; // ""; // ADMINNAME;
|
||||
$menu_vars[$type]['link'] = '#';
|
||||
$menu_vars[$type]['image'] = $tp->toAvatar(null, array('w'=>30,'h'=>30,'crop'=>1, 'shape'=>'circle')); // $tp->toGlyph('fa-user'); // "<i class='icon-user'></i>"; // "<img src='".E_16_NAV_LGOT."' alt='".ADLAN_151."' class='icon S16' />";
|
||||
$menu_vars[$type]['image_src'] = LAN_LOGOUT;
|
||||
$menu_vars[$type]['sub'] = $tmp;
|
||||
$menu_vars[$type]['template'] = $type;
|
||||
}
|
||||
|
||||
if($type == 'language')
|
||||
if($type == self::ADMIN_NAV_LANGUAGE)
|
||||
{
|
||||
$slng = e107::getLanguage();
|
||||
$languages = $slng->installed();//array('English','French');
|
||||
@@ -1839,11 +1846,12 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
$c++;
|
||||
}
|
||||
|
||||
$menu_vars['language']['text'] = strtoupper(e_LAN); // e_LANGUAGE;
|
||||
$menu_vars['language']['link'] = '#';
|
||||
$menu_vars['language']['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ;
|
||||
$menu_vars['language']['image_src'] = null;
|
||||
$menu_vars['language']['sub'] = $tmp;
|
||||
$menu_vars[$type]['text'] = strtoupper(e_LAN); // e_LANGUAGE;
|
||||
$menu_vars[$type]['link'] = '#';
|
||||
$menu_vars[$type]['image'] = $tp->toGlyph('fa-globe'); // "<i class='icon-globe'></i>" ;
|
||||
$menu_vars[$type]['image_src'] = null;
|
||||
$menu_vars[$type]['sub'] = $tmp;
|
||||
$menu_vars[$type]['template'] = $type;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1877,6 +1885,8 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
|
||||
$var = array();
|
||||
|
||||
|
||||
|
||||
foreach($pref['sitetheme_layouts'] as $key=>$val)
|
||||
{
|
||||
$layoutName = str_replace($search,$replace,$key);
|
||||
@@ -1902,6 +1912,8 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
||||
|
||||
e107::setRegistry('core/e107/menu-manager/curLayout',$action);
|
||||
|
||||
|
||||
|
||||
return e107::getNav()->admin(ADLAN_6,$action, $var);
|
||||
|
||||
|
||||
|
@@ -364,7 +364,7 @@ class comment_shortcodes extends e_shortcode
|
||||
|
||||
if ($pref['allowCommentEdit'] && USER && $this->var['user_id'] == USERID && ($this->var['comment_lock'] < 1))
|
||||
{
|
||||
$adop_icon = (file_exists(THEME."images/commentedit.png") ? "<img src='".THEME_ABS."images/commentedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' class='icon' />" : "Edit");
|
||||
$adop_icon = (file_exists(THEME."images/commentedit.png") ? "<img src='".THEME_ABS."images/commentedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' class='icon' />" : LAN_EDIT);
|
||||
//Searching for '.' is BAD!!! It breaks mod rewritten requests. Why is this needed at all?
|
||||
if (strstr(e_QUERY, "&"))
|
||||
{
|
||||
|
@@ -439,7 +439,7 @@ class news_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
// When news_allow_comments = 1 then it is disabled. Backward, but that's how it is in v1.x
|
||||
$text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "<a title='".$this->sc_newscommentcount()." comments' class='e-tip".$class."' href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$this->param['commentlink'].'</a>');
|
||||
$text = ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : "<a title='".$this->sc_newscommentcount()." ".LAN_COMMENTS."' class='e-tip".$class."' href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$this->param['commentlink'].'</a>');
|
||||
return $text;
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ class news_shortcodes extends e_shortcode
|
||||
|
||||
$class = varset($parm['class']);
|
||||
|
||||
return "<a class='e-tip e-instant-edit ".$class." hidden-print' rel='external' href='".e_ADMIN_ABS."newspost.php?action=edit&id=".$this->news_item['news_id']."' title=\"".LAN_EDIT."\">".$adop_icon."</a>\n";
|
||||
return "<a class='e-tip ".$class." hidden-print' rel='external' href='".e_ADMIN_ABS."newspost.php?action=edit&id=".$this->news_item['news_id']."' title=\"".LAN_EDIT."\">".$adop_icon."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -693,7 +693,7 @@ class news_shortcodes extends e_shortcode
|
||||
break;
|
||||
|
||||
default:
|
||||
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='news_image img-responsive img-rounded ".$class."' src='".$src."' alt='' style='".$style."' {$dimensions} {$srcset} /></a>";
|
||||
return "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'><img class='news_image img-responsive img-fluid img-rounded rounded ".$class."' src='".$src."' alt='' style='".$style."' {$dimensions} {$srcset} /></a>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -734,7 +734,7 @@ class news_shortcodes extends e_shortcode
|
||||
$parm['item'] = ($parm['item'] +1);
|
||||
if(empty($parm['class']))
|
||||
{
|
||||
$parm['class'] = 'img-responsive news-media news-media-'.$parm['item'];
|
||||
$parm['class'] = 'img-responsive img-fluid news-media news-media-'.$parm['item'];
|
||||
}
|
||||
return $this->sc_newsimage($parm);
|
||||
}
|
||||
@@ -811,7 +811,7 @@ class news_shortcodes extends e_shortcode
|
||||
* Display News Images (but not video thumbnails )
|
||||
* @param $parm array
|
||||
* @example {NEWSIMAGE: type=src&placeholder=true}
|
||||
* @example {NEWSIMAGE: class=img-responsive}
|
||||
* @example {NEWSIMAGE: class=img-responsive img-fluid}
|
||||
*/
|
||||
function sc_newsimage($parm = null)
|
||||
{
|
||||
@@ -826,7 +826,7 @@ class news_shortcodes extends e_shortcode
|
||||
$tmp = $this->handleMultiple($parm);
|
||||
$srcPath = $tmp['file'];
|
||||
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : "news_image news-image img-responsive img-rounded";
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : "news_image news-image img-responsive img-fluid img-rounded rounded";
|
||||
$class .= ' news-image-'.$tmp['count'];
|
||||
$dimensions = null;
|
||||
$srcset = null;
|
||||
|
@@ -33,9 +33,13 @@ class cpage_shortcodes extends e_shortcode
|
||||
foreach($books as $row)
|
||||
{
|
||||
$id = $row['chapter_id'];
|
||||
|
||||
|
||||
$this->chapterData[$id] = $row;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -457,6 +461,15 @@ class cpage_shortcodes extends e_shortcode
|
||||
return $tp->toHtml($row['chapter_name'], false, 'TITLE');
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias for {CHAPTER_NAME}
|
||||
* @example {CHAPTER_TITLE}
|
||||
*/
|
||||
function sc_chapter_title()
|
||||
{
|
||||
return $this->sc_chapter_name();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @example {CHAPTER_ANCHOR}
|
||||
@@ -597,4 +610,74 @@ class cpage_shortcodes extends e_shortcode
|
||||
return "<a rel='external' title=\"".LAN_EDIT."\" data-modal-caption=\"".LAN_EDIT."\" class='btn btn-default ".$modal."' href='".e_ADMIN_ABS."cpage.php?action=edit&id=".$this->var['page_id'].$iframe."' >".$icon."</a>";
|
||||
}
|
||||
|
||||
|
||||
function sc_cpagefieldtitle($parm=null)
|
||||
{
|
||||
if(empty($parm['name']) || empty($this->var['page_fields']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$chap = $this->var['page_chapter'];
|
||||
$key = $parm['name'];
|
||||
|
||||
|
||||
if(!empty($this->chapterData[$chap]['chapter_fields'][$key]['title']))
|
||||
{
|
||||
return $this->chapterData[$chap]['chapter_fields'][$key]['title'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return raw HTML-usable values from page fields.
|
||||
* @experimental subject to change without notice.
|
||||
* @param null $parm
|
||||
* @return mixed
|
||||
*/
|
||||
function sc_cpagefield($parm=null)
|
||||
{
|
||||
if(empty($parm['name']) || empty($this->var['page_fields']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$chap = $this->var['page_chapter'];
|
||||
$fields = $this->chapterData[$chap]['chapter_fields'];
|
||||
|
||||
return e107::getCustomFields()->loadConfig($fields)->loadData($this->var['page_fields'])->getFieldValue($parm['name'],$parm);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @experimental - subject to change without notice. Use at own risk.
|
||||
* @param null $parm
|
||||
* @return string
|
||||
*/
|
||||
function sc_cpagefields($parm=null)
|
||||
{
|
||||
$fieldData = e107::unserialize($this->var['page_fields']);
|
||||
|
||||
|
||||
$text = '<table class="table table-bordered table-striped">
|
||||
<tr><th>Name</th><th>Title<br /><small>{CPAGEFIELDTITLE: name=x}</small></th><th>Normal<br /><small>{CPAGEFIELD: name=x}</small></th><th>Raw<br /><small>{CPAGEFIELD: name=x&mode=raw}</small></th></tr>';
|
||||
|
||||
foreach($fieldData as $ok=>$v)
|
||||
{
|
||||
|
||||
$text .= "<tr><td>".$ok."</td><td>".$this->sc_cpagefieldtitle(array('name'=>$ok))."</td><td>".$this->sc_cpagefield(array('name'=>$ok))."</td><td>".$this->sc_cpagefield(array('name'=>$ok, 'mode'=>'raw'))."</td></tr>";
|
||||
}
|
||||
|
||||
$text .= "</table>";
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -374,7 +374,6 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_icon_link($parm='')
|
||||
{
|
||||
|
||||
@@ -396,28 +395,31 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_id($parm='')
|
||||
{
|
||||
return $this->var['user_id'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_name($parm='')
|
||||
{
|
||||
return $this->var['user_name'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_name_link($parm='')
|
||||
{
|
||||
$uparams = array('id' => $this->var['user_id'], 'name' => $this->var['user_name']);
|
||||
return "<a href='".e107::getUrl()->create('user/profile/view', $uparams)."'>".$this->var['user_name']."</a>";
|
||||
$url = $this->sc_user_profile_url();
|
||||
return "<a href='".$url."'>".$this->var['user_name']."</a>";
|
||||
}
|
||||
|
||||
|
||||
function sc_user_profile_url($parm='')
|
||||
{
|
||||
$uparams = array('id' => $this->var['user_id'], 'name' => $this->var['user_name']);
|
||||
return e107::getUrl()->create('user/profile/view', $uparams);
|
||||
}
|
||||
|
||||
|
||||
function sc_user_loginname($parm='')
|
||||
{
|
||||
@@ -428,7 +430,6 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_birthday_icon($parm='')
|
||||
{
|
||||
if(defined("USER_BIRTHDAY_ICON"))
|
||||
@@ -444,7 +445,6 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_birthday($parm='')
|
||||
{
|
||||
if ($this->var['user_birthday'] != "" && $this->var['user_birthday'] != "0000-00-00" && preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $this->var['user_birthday'], $regs))
|
||||
@@ -458,7 +458,6 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_signature($parm)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
@@ -466,7 +465,6 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_comments_link($parm)
|
||||
{
|
||||
if($this->commentsDisabled)
|
||||
@@ -679,14 +677,14 @@ class user_shortcodes extends e_shortcode
|
||||
|
||||
if(!$ext->hasPermission($fld,'read'))
|
||||
{
|
||||
// e107::getDebug()->log("Wrong permissions for user_euf: ".$fld);
|
||||
return false;
|
||||
}
|
||||
|
||||
$val = $this->var[$fld];
|
||||
$type = $ext->getFieldType($fld);
|
||||
|
||||
// e107::getDebug()->log(print_a($ext,true));
|
||||
|
||||
return $ext->renderValue($val); //TODO auto-detect type, from within the user-extended class.
|
||||
return $ext->renderValue($val,$type);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -18,6 +18,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
class usersettings_shortcodes extends e_shortcode
|
||||
{
|
||||
private $extendedTabs = false;
|
||||
public $legacyTemplate = array();
|
||||
|
||||
function sc_username($parm) // This is the 'display name'
|
||||
{
|
||||
@@ -377,12 +378,15 @@ class usersettings_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_userextended_cat($parm = '')
|
||||
{
|
||||
global $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed;
|
||||
global $extended_showed;
|
||||
|
||||
if(deftrue('BOOTSTRAP')===3)
|
||||
if(THEME_LEGACY === true)
|
||||
{
|
||||
$USER_EXTENDED_CAT = $this->legacyTemplate['USER_EXTENDED_CAT'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$USER_EXTENDED_CAT = e107::getCoreTemplate('usersettings', 'extended-category');
|
||||
}
|
||||
@@ -421,6 +425,7 @@ class usersettings_shortcodes extends e_shortcode
|
||||
AND user_extended_struct_type != 0
|
||||
ORDER BY user_extended_struct_order ASC
|
||||
";
|
||||
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$fieldList = $sql->db_getList();
|
||||
@@ -437,23 +442,35 @@ class usersettings_shortcodes extends e_shortcode
|
||||
if($ret && $this->extendedTabs == false)
|
||||
{
|
||||
$catName = $catInfo['user_extended_struct_text'] ? $catInfo['user_extended_struct_text'] : $catInfo['user_extended_struct_name'];
|
||||
if(defined($catName)) $catName = constant($catName);
|
||||
$ret = str_replace("{CATNAME}", $tp->toHTML($catName, FALSE, 'emotes_off,defs'), $USER_EXTENDED_CAT).$ret;
|
||||
if(defined($catName))
|
||||
{
|
||||
$catName = constant($catName);
|
||||
}
|
||||
$ret = str_replace("{CATNAME}", $tp->toHTML($catName, false, 'emotes_off,defs'), $USER_EXTENDED_CAT) . $ret;
|
||||
}
|
||||
|
||||
$extended_showed['cat'][$parm] = 1;
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_userextended_field($parm = '')
|
||||
{
|
||||
global $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD;
|
||||
global $extended_showed;
|
||||
|
||||
if(deftrue('BOOTSTRAP')===3)
|
||||
$ue = e107::getUserExt();
|
||||
|
||||
|
||||
if(THEME_LEGACY === true)
|
||||
{
|
||||
$USEREXTENDED_FIELD = $this->legacyTemplate['USEREXTENDED_FIELD'];
|
||||
$REQUIRED_FIELD = $this->legacyTemplate['REQUIRED_FIELD'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$USEREXTENDED_FIELD = e107::getCoreTemplate('usersettings', 'extended-field');
|
||||
$REQUIRED_FIELD = '';
|
||||
}
|
||||
|
||||
|
||||
@@ -465,10 +482,10 @@ class usersettings_shortcodes extends e_shortcode
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
$ret = "";
|
||||
|
||||
$fInfo = getcachedvars("extendeddata_{$parm}");
|
||||
|
||||
if(!$fInfo)
|
||||
{
|
||||
$qry = "
|
||||
@@ -486,7 +503,12 @@ class usersettings_shortcodes extends e_shortcode
|
||||
if($fInfo)
|
||||
{
|
||||
$fname = $fInfo['user_extended_struct_text'];
|
||||
if(defined($fname)) $fname = constant($fname);
|
||||
|
||||
if(defined($fname))
|
||||
{
|
||||
$fname = constant($fname);
|
||||
}
|
||||
|
||||
$fname = $tp->toHTML($fname, "", "emotes_off, defs");
|
||||
|
||||
if($fInfo['user_extended_struct_required'] == 1 && !deftrue('BOOTSTRAP'))
|
||||
@@ -497,13 +519,16 @@ class usersettings_shortcodes extends e_shortcode
|
||||
$parms = explode("^,^", $fInfo['user_extended_struct_parms']);
|
||||
|
||||
$fhide = "";
|
||||
|
||||
if(varset($parms[3]))
|
||||
{
|
||||
$chk = (strpos($this->var['user_hidden_fields'], "^user_".$parm."^") === FALSE) ? FALSE : TRUE;
|
||||
$chk = (strpos($this->var['user_hidden_fields'], "^user_" . $parm . "^") === false) ? false : true;
|
||||
|
||||
if(isset($_POST['updatesettings']))
|
||||
{
|
||||
$chk = isset($_POST['hide']['user_' . $parm]);
|
||||
}
|
||||
|
||||
$fhide = $ue->user_extended_hide($fInfo, $chk);
|
||||
}
|
||||
|
||||
@@ -517,6 +542,7 @@ class usersettings_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
$extended_showed['field'][$parm] = 1;
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@ function custom_shortcode($parm)
|
||||
{
|
||||
case 'login':
|
||||
case 'login noprofile':
|
||||
include_lan(e_PLUGIN.'login_menu/languages/'.e_LANGUAGE.'.php');
|
||||
e107::includeLan(e_PLUGIN.'login_menu/languages/'.e_LANGUAGE.'.php');
|
||||
$ret = '';
|
||||
$sep = (defined('LOGINC_SEP')) ? LOGINC_SEP : "<span class='loginc sep'>.:.</span>";
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user.php");
|
||||
|
||||
global $tp;
|
||||
if (substr($parm, -5) == '-link')
|
||||
|
@@ -1,7 +1,7 @@
|
||||
//<?
|
||||
global $sql,$sysprefs,$SEARCH_SHORTCODE;
|
||||
|
||||
include_lan(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
|
||||
e107::includeLan(e_PLUGIN."search_menu/languages/".e_LANGUAGE.".php");
|
||||
$text = "";
|
||||
if (!isset($SEARCH_SHORTCODE))
|
||||
{
|
||||
|
@@ -10,9 +10,9 @@
|
||||
$parm['h'] = 0;
|
||||
$parm['crop'] = 0;
|
||||
}
|
||||
e107::getParser()->thumbWidth = vartrue($parm['w'],100);
|
||||
e107::getParser()->thumbHeight = vartrue($parm['h'],0);
|
||||
e107::getParser()->thumbCrop = vartrue($parm['crop'],0);
|
||||
e107::getParser()->thumbWidth = varset($parm['w'],0);
|
||||
e107::getParser()->thumbHeight = varset($parm['h'],0);
|
||||
e107::getParser()->thumbCrop = varset($parm['crop'],0);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@
|
||||
/**
|
||||
* @todo - must be a better way of picking up the 'Miscellaneous' category
|
||||
*/
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php');
|
||||
|
||||
|
||||
if (($parms[1] != 'icon') && ($parms[0] != LAN_USER_44))
|
||||
|
@@ -10,7 +10,7 @@
|
||||
* USAGE: {USER_EXTENDED=<field_name>.[text|value|icon|text_value].<user_id>}
|
||||
* EXAMPLE: {USER_EXTENDED=user_gender.value.5} will show the value of the extended field user_gender for user #5
|
||||
*/
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user_extended.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user_extended.php');
|
||||
$parms = explode('.', $parm);
|
||||
global $currentUser, $tp, $loop_uid, $e107, $sc_style;
|
||||
if(isset($loop_uid) && intval($loop_uid) == 0) { return ''; }
|
||||
@@ -49,7 +49,7 @@ if($udata['user_admin'] == 1)
|
||||
/**
|
||||
* @todo - must be a better way of picking up the 'Miscellaneous' category
|
||||
*/
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php');
|
||||
if (($parms[1] != 'icon') && ($parms[0] != LAN_USER_44))
|
||||
{
|
||||
$ret_cause = 0;
|
||||
|
@@ -387,6 +387,7 @@ CREATE TABLE page (
|
||||
page_ip_restrict text,
|
||||
page_template varchar(50) NOT NULL default '',
|
||||
page_order int(4) unsigned NOT NULL default '9999',
|
||||
page_fields mediumtext,
|
||||
menu_name varchar(50) NOT NULL default '',
|
||||
menu_title varchar(250) NOT NULL default '',
|
||||
menu_text mediumtext,
|
||||
@@ -418,6 +419,7 @@ CREATE TABLE page_chapters (
|
||||
chapter_order int(6) unsigned NOT NULL default '0',
|
||||
chapter_template varchar(50) NOT NULL default '',
|
||||
chapter_visibility tinyint(3) unsigned NOT NULL default '0',
|
||||
chapter_fields mediumtext,
|
||||
PRIMARY KEY (chapter_id),
|
||||
KEY chapter_order (chapter_order)
|
||||
) ENGINE=MyISAM;
|
||||
|
@@ -440,14 +440,25 @@ if (!defined('E_16_FAILEDLOGIN')) {
|
||||
define("E_32_TRUE", "<i class='S32 e-true-32'></i>");
|
||||
|
||||
|
||||
/*
|
||||
define("ADMIN_TRUE_ICON", "<i class='fa fa-check text-success'></i>");
|
||||
define("ADMIN_FALSE_ICON", "<i class='fa fa-times text-danger'></i>");
|
||||
define("ADMIN_WARNING_ICON", "<i class='fa fa-warning text-warning'></i>");
|
||||
|
||||
define("ADMIN_EDIT_ICON", "<i class='fa fa-edit fa-2x fa-fw'></i>");
|
||||
define("ADMIN_DELETE_ICON", "<i class='fa fa-trash fa-2x fa-fw'></i>");
|
||||
define("ADMIN_EXECUTE_ICON", "<i class='fa fa-power-off fa-2x fa-fw'></i>");
|
||||
define("ADMIN_SORT_ICON", "<i class='fa fa-sort fa-2x fa-fw'></i>");
|
||||
*/
|
||||
|
||||
define("ADMIN_TRUE_ICON", "<i class='S16 e-true-16'></i>");
|
||||
define("ADMIN_FALSE_ICON", "<i class='S16 e-false-16'></i>");
|
||||
define("ADMIN_WARNING_ICON", "<i class='S16 e-warning-16'></i>");
|
||||
|
||||
define("ADMIN_EDIT_ICON", "<i class='S32 e-edit-32'></i>");
|
||||
define("ADMIN_DELETE_ICON", "<i class='S32 e-delete-32'></i>");
|
||||
|
||||
|
||||
|
||||
define("ADMIN_ADD_ICON", "<i class='S32 e-add-32'></i>");
|
||||
define("ADMIN_INFO_ICON", "<i class='S16 e-info-16'></i>");
|
||||
define("ADMIN_CONFIGURE_ICON", "<i class='S32 e-settings-32'></i>");
|
||||
@@ -463,6 +474,7 @@ define("E_32_TRUE", "<i class='S32 e-true-32'></i>");
|
||||
define("ADMIN_EXECUTE_ICON", "<i class='S32 e-execute-32'></i>");
|
||||
|
||||
|
||||
|
||||
// FOR BC
|
||||
|
||||
define("ADMIN_EDIT_ICON_PATH", e_IMAGE_ABS."admin_images/edit_32.png");
|
||||
|
@@ -187,7 +187,7 @@ if (/*!defined("PREVIEWTHEME") && */! (isset($no_core_css) && $no_core_css !==tr
|
||||
$e_js->otherCSS('{e_WEB_CSS}e107.css');
|
||||
}
|
||||
|
||||
if(!deftrue('BOOTSTRAP'))
|
||||
if(THEME_LEGACY === true)
|
||||
{
|
||||
$e_js->otherCSS('{e_WEB_CSS}backcompat.css');
|
||||
}
|
||||
@@ -665,12 +665,13 @@ echo "</head>\n";
|
||||
|
||||
$HEADER = str_replace("{e_PAGETITLE}",deftrue('e_PAGETITLE',''),$HEADER);
|
||||
|
||||
$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' ";
|
||||
//$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' ";
|
||||
|
||||
|
||||
|
||||
if(!deftrue('BODYTAG')) //TODO Discuss a better way?
|
||||
{
|
||||
$body_onload .= " id='layout-".e107::getForm()->name2id(THEME_LAYOUT)."' ";
|
||||
echo "<body".$body_onload.">\n";
|
||||
}
|
||||
else
|
||||
|
@@ -51,8 +51,12 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
|
||||
<div class="clear"><!-- --></div>
|
||||
{CPAGERATING|default}
|
||||
{CPAGEEDIT}
|
||||
|
||||
|
||||
';
|
||||
|
||||
// {CPAGEFIELD: name=image}
|
||||
|
||||
$PAGE_WRAPPER['default']['CPAGEEDIT'] = "<div class='text-right'>{---}</div>";
|
||||
|
||||
// used only when password authorization is required
|
||||
@@ -100,7 +104,7 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
|
||||
$PAGE_TEMPLATE['default']['related']['item'] = '<div class="col-md-4"><a href="{RELATED_URL}">{RELATED_IMAGE}</a><h3><a href="{RELATED_URL}">{RELATED_TITLE}</a></h3></div>';
|
||||
$PAGE_TEMPLATE['default']['related']['end'] = '</div>';
|
||||
|
||||
|
||||
// $PAGE_TEMPLATE['default']['editor'] = '<ul class="fa-ul"><li><i class="fa fa-li fa-edit"></i> Level 1</li><li><i class="fa fa-li fa-cog"></i> Level 2</li></ul>';
|
||||
|
||||
|
||||
#### No table render example template ####
|
||||
|
@@ -167,7 +167,7 @@ $sc_style['SIGNUP_EMAIL_CONFIRM']['post'] = "
|
||||
</tr>";
|
||||
|
||||
$sc_style['SIGNUP_XUP']['pre'] = "<div class='center' style='display:block;padding:10px'>";
|
||||
$sc_style['SIGNUP_XUP']['post'] = "<h2 class='signup-divider'><span>OR</span></h2></div>";
|
||||
$sc_style['SIGNUP_XUP']['post'] = "<h2 class='signup-divider'><span>".LAN_SIGNUP_120."</span></h2></div>";
|
||||
|
||||
$sc_style['SIGNUP_PASSWORD1']['pre'] = "<tr>
|
||||
<td class='forumheader3' style='width:30%;white-space:nowrap'><label for='password1'>".LAN_SIGNUP_83."<span class='required'> *</span></label></td>
|
||||
@@ -191,7 +191,7 @@ $sc_style['SIGNUP_USERCLASS_SUBSCRIBE']['post'] = "</td>
|
||||
if(!defined($COPPA_TEMPLATE))
|
||||
{
|
||||
$COPPA_TEMPLATE =
|
||||
LAN_SIGNUP_77." <a href='http://www.ftc.gov/privacy/coppafaqs.shtm'>".LAN_SIGNUP_14."</a>. "
|
||||
LAN_SIGNUP_77." <a target='_blank' href='http://www.ftc.gov/privacy/coppafaqs.shtm'>".LAN_SIGNUP_14."</a>. "
|
||||
.LAN_SIGNUP_15." ".$tp->emailObfuscate(SITEADMINEMAIL,LAN_SIGNUP_14)." ".LAN_SIGNUP_16."<br />
|
||||
<br />
|
||||
<div style='text-align:center'><b>".LAN_SIGNUP_17."</b>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<core name="admincss">admin_dark.css</core>
|
||||
<core name="adminlanguage"></core>
|
||||
<core name="adminpwordchange">0</core>
|
||||
<core name="adminstyle">infopanel</core>
|
||||
<core name="adminstyle">flexpanel</core>
|
||||
<core name="admintheme">bootstrap3</core>
|
||||
<core name="allowCommentEdit">0</core>
|
||||
<core name="allowEmailLogin">2</core>
|
||||
|
@@ -8,8 +8,7 @@
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="country">
|
||||
<type>db field</type>
|
||||
<values>user_extended_country,country_iso,country_name,country_name</values>
|
||||
<type>country</type>
|
||||
<include_text></include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
|
@@ -2608,6 +2608,10 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
return $this->tabs;
|
||||
}
|
||||
|
||||
public function addTab($key,$val)
|
||||
{
|
||||
$this->tabs[$key] = (string) $val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Tab data
|
||||
|
@@ -6,17 +6,10 @@
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @package e107
|
||||
* @subpackage e107_handlers
|
||||
* @version $Id$
|
||||
* @author SecretR
|
||||
*
|
||||
* e107 Single Entry Point handling
|
||||
*
|
||||
* Currently this file contains all classes required for single entry point functionallity
|
||||
@@ -1821,7 +1814,7 @@ class eRouter
|
||||
if(isset($params['#']))
|
||||
{
|
||||
$anc = '#'.$params['#'];
|
||||
usnet($params['#']);
|
||||
unset($params['#']);
|
||||
}
|
||||
|
||||
// Config independent - Deny parameter keys, useful for directly denying sensitive data e.g. password db fields
|
||||
@@ -4326,6 +4319,7 @@ class eHelper
|
||||
|
||||
public static function secureIdAttr($string)
|
||||
{
|
||||
$string = str_replace(array('/','_'),'-',$string);
|
||||
return preg_replace(self::$_idRegEx, '', $string);
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ if (!defined('e107_INIT'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_comment.php");
|
||||
global $comment_shortcodes;
|
||||
require_once (e_CORE."shortcodes/batch/comment_shortcodes.php");
|
||||
/**
|
||||
|
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_date.php");
|
||||
|
||||
class convert
|
||||
{
|
||||
|
@@ -352,7 +352,8 @@ class e107_db_debug {
|
||||
}
|
||||
|
||||
|
||||
function Show_Performance() {
|
||||
function Show_Performance()
|
||||
{
|
||||
//
|
||||
// Stats by Time Marker
|
||||
//
|
||||
@@ -362,28 +363,55 @@ class e107_db_debug {
|
||||
|
||||
$this->Mark_Time('Stop');
|
||||
|
||||
if (!E107_DBG_TIMEDETAILS) return '';
|
||||
if(!E107_DBG_TIMEDETAILS)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$totTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop);
|
||||
|
||||
$text = "\n<table class='fborder table table-striped table-condensed'>\n";
|
||||
$bRowHeaders=FALSE;
|
||||
$bRowHeaders = false;
|
||||
reset($this->aTimeMarks);
|
||||
$aSum = $this->aTimeMarks[0]; // create a template from the 'real' array
|
||||
|
||||
$aSum['Index'] = '';
|
||||
$aSum['What'] = 'Total';
|
||||
$aSum['Time'] = 0;
|
||||
$aSum['DB Time'] = 0;
|
||||
$aSum['DB Count'] = 0;
|
||||
$aSum['Memory']='';
|
||||
$aSum['Memory'] = 0;
|
||||
|
||||
while (list($tKey, $tMarker) = each($this->aTimeMarks)) {
|
||||
if (!$bRowHeaders) {
|
||||
// Calculate Memory Usage per entry.
|
||||
$prevMem = 0;
|
||||
|
||||
foreach($this->aTimeMarks as $k=>$v)
|
||||
{
|
||||
|
||||
$prevKey = $k-1;
|
||||
|
||||
if(!empty($prevKey))
|
||||
{
|
||||
$this->aTimeMarks[$prevKey]['Memory Used'] = (intval($v['Memory']) - $prevMem);
|
||||
}
|
||||
|
||||
$prevMem = intval($v['Memory']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
while(list($tKey, $tMarker) = each($this->aTimeMarks))
|
||||
{
|
||||
if(!$bRowHeaders)
|
||||
{
|
||||
// First time: emit headers
|
||||
$bRowHeaders=TRUE;
|
||||
$bRowHeaders = true;
|
||||
$text .= "<tr><td class='fcaption' style='text-align:right'><b>" . implode("</b> </td><td class='fcaption' style='text-align:right'><b>", array_keys($tMarker)) . "</b> </td><td class='fcaption' style='text-align:right'><b>OB Lev </b></td></tr>\n";
|
||||
$aUnits = $tMarker;
|
||||
foreach ($aUnits as $key=>$val) {
|
||||
switch ($key) {
|
||||
foreach($aUnits as $key => $val)
|
||||
{
|
||||
switch($key)
|
||||
{
|
||||
case 'DB Time':
|
||||
case 'Time':
|
||||
$aUnits[$key] = '(msec)';
|
||||
@@ -395,12 +423,35 @@ class e107_db_debug {
|
||||
}
|
||||
$aUnits['OB Lev'] = 'lev(buf bytes)';
|
||||
$aUnits['Memory'] = '(kb)';
|
||||
$aUnits['Memory Used'] = '(kb)';
|
||||
$text .= "<tr><td class='fcaption' style='text-align:right'><b>" . implode("</b> </td><td class='fcaption' style='text-align:right'><b>", $aUnits) . "</b> </td></tr>\n";
|
||||
}
|
||||
|
||||
$tMem = $tMarker['Memory'];
|
||||
|
||||
|
||||
// $tMem = ($tMarker['Memory'] - $aSum['Memory']);
|
||||
|
||||
$tMem = ($tMarker['Memory']);
|
||||
|
||||
if($tMem < 0) // Quick Fix for negative numbers.
|
||||
{
|
||||
// $tMem = 0.0000000001;
|
||||
}
|
||||
|
||||
$tMarker['Memory'] = ($tMem ? number_format($tMem / 1024.0, 1) : '?'); // display if known
|
||||
if ($tMarker['What'] == 'Stop') {
|
||||
|
||||
$tUsage = $tMarker['Memory Used'];
|
||||
$tMarker['Memory Used'] = number_format($tUsage / 1024.0, 1);
|
||||
|
||||
if($tUsage > 400000) // Highlight high memory usage.
|
||||
{
|
||||
$tMarker['Memory Used'] = "<span class='label label-danger'>".$tMarker['Memory Used']."</span>";
|
||||
}
|
||||
|
||||
$aSum['Memory'] = $tMem;
|
||||
|
||||
if($tMarker['What'] == 'Stop')
|
||||
{
|
||||
$tMarker['Time'] = ' ';
|
||||
$tMarker['%Time'] = ' ';
|
||||
$tMarker['%DB Count'] = ' ';
|
||||
@@ -408,7 +459,9 @@ class e107_db_debug {
|
||||
$tMarker['DB Time'] = ' ';
|
||||
$tMarker['OB Lev'] = $this->aOBMarks[$tKey];
|
||||
$tMarker['DB Count'] = ' ';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
// Convert from start time to delta time, i.e. from now to next entry
|
||||
$nextMarker = current($this->aTimeMarks);
|
||||
$aNextT = $nextMarker['Time'];
|
||||
@@ -429,11 +482,16 @@ class e107_db_debug {
|
||||
|
||||
$text .= "<tr><td class='forumheader3' >" . implode(" </td><td class='forumheader3' style='text-align:right'>", array_values($tMarker)) . " </td></tr>\n";
|
||||
|
||||
if (isset($this->aMarkNotes[$tKey])) {
|
||||
if(isset($this->aMarkNotes[$tKey]))
|
||||
{
|
||||
$text .= "<tr><td class='forumheader3' > </td><td class='forumheader3' colspan='4'>";
|
||||
$text .= $this->aMarkNotes[$tKey] . "</td></tr>\n";
|
||||
}
|
||||
if ($tMarker['What'] == 'Stop') break;
|
||||
|
||||
if($tMarker['What'] == 'Stop')
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$aSum['%Time'] = $totTime ? number_format(100.0 * ($aSum['Time'] / $totTime), 0) : 0;
|
||||
@@ -449,10 +507,12 @@ class e107_db_debug {
|
||||
<td class='fcaption' style='text-align:right'><b>" . $aSum['%Time'] . "</b></td>
|
||||
<td class='fcaption' style='text-align:right'><b>" . $aSum['%DB Time'] . "</b></td>
|
||||
<td class='fcaption' style='text-align:right'><b>" . $aSum['%DB Count'] . "</b></td>
|
||||
<td class='fcaption' style='text-align:right'><b>".$aSum['Time']."</b></td>
|
||||
<td class='fcaption' style='text-align:right'><b>".$aSum['DB Time']."</b></td>
|
||||
<td class='fcaption' style='text-align:right' title='Time (msec)'><b>" . $aSum['Time'] . "</b></td>
|
||||
<td class='fcaption' style='text-align:right' title='DB Time (msec)'><b>" . $aSum['DB Time'] . "</b></td>
|
||||
<td class='fcaption' style='text-align:right'><b>" . $aSum['DB Count'] . "</b></td>
|
||||
<td class='fcaption' style='text-align:right'><b>".$tMarker['Memory']."</b></td>
|
||||
<td class='fcaption' style='text-align:right' title='Memory (Kb)'><b>" . number_format($aSum['Memory'] / 1024, 1) . "</b></td>
|
||||
<td class='fcaption' style='text-align:right' title='Memory (Kb)'><b>" . number_format($aSum['Memory'] / 1024, 1) . "</b></td>
|
||||
|
||||
<td class='fcaption' style='text-align:right'><b>" . $tMarker['OB Lev'] . "</b></td>
|
||||
|
||||
</tr>
|
||||
@@ -470,7 +530,7 @@ class e107_db_debug {
|
||||
|
||||
$text .= "\n<table class='fborder table table-striped table-condensed'>\n";
|
||||
|
||||
$bRowHeaders=FALSE;
|
||||
$bRowHeaders = false;
|
||||
$aSum = $this->aDBbyTable['core']; // create a template from the 'real' array
|
||||
$aSum['Table'] = 'Total';
|
||||
$aSum['%DB Count'] = 0;
|
||||
@@ -478,13 +538,17 @@ class e107_db_debug {
|
||||
$aSum['DB Time'] = 0;
|
||||
$aSum['DB Count'] = 0;
|
||||
|
||||
foreach ($this->aDBbyTable as $curTable) {
|
||||
if (!$bRowHeaders) {
|
||||
$bRowHeaders=TRUE;
|
||||
foreach($this->aDBbyTable as $curTable)
|
||||
{
|
||||
if(!$bRowHeaders)
|
||||
{
|
||||
$bRowHeaders = true;
|
||||
$text .= "<tr><td class='fcaption'><b>" . implode("</b></td><td class='fcaption'><b>", array_keys($curTable)) . "</b></td></tr>\n";
|
||||
$aUnits = $curTable;
|
||||
foreach ($aUnits as $key=>$val) {
|
||||
switch ($key) {
|
||||
foreach($aUnits as $key => $val)
|
||||
{
|
||||
switch($key)
|
||||
{
|
||||
case 'DB Time':
|
||||
$aUnits[$key] = '(msec)';
|
||||
break;
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_db_verify.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_db_verify.php');
|
||||
|
||||
class db_verify
|
||||
{
|
||||
|
@@ -144,6 +144,9 @@ class e107_debug {
|
||||
|
||||
$aDVal = explode('.',$dVals); // support multiple values, OR'd together
|
||||
$dVal = 0;
|
||||
|
||||
|
||||
|
||||
foreach ($aDVal as $curDVal)
|
||||
{
|
||||
if (isset($this->aDebugShortcuts[$curDVal]))
|
||||
@@ -152,7 +155,7 @@ class e107_debug {
|
||||
}
|
||||
else
|
||||
{
|
||||
$dVal |= $curDVal;
|
||||
$dVal |= intval($curDVal);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -184,6 +184,7 @@ class e107
|
||||
'e_array' => '{e_HANDLER}core_functions.php', // Old ArrayStorage.
|
||||
'e_bbcode' => '{e_HANDLER}bbcode_handler.php',
|
||||
'e_bb_base' => '{e_HANDLER}bbcode_handler.php',
|
||||
'e_customfields' => '{e_HANDLER}e_customfields_class.php',
|
||||
'e_file' => '{e_HANDLER}file_class.php',
|
||||
'e_form' => '{e_HANDLER}form_handler.php',
|
||||
'e_jshelper' => '{e_HANDLER}js_helper.php',
|
||||
@@ -1116,7 +1117,7 @@ class e107
|
||||
$legacy_pref_name = ($pref_name) ? $pref_name = '/'.$pref_name : '';
|
||||
$tprefs = self::getConfig()->getPref('sitetheme_pref'.$legacy_pref_name, $default, $index);
|
||||
|
||||
return !empty($tprefs) ? $tprefs : array();
|
||||
return !empty($tprefs) ? $tprefs : $default;
|
||||
|
||||
}
|
||||
|
||||
@@ -1765,6 +1766,15 @@ class e107
|
||||
return self::getSingleton('comment', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve comments handler singleton object
|
||||
* @return e_customfields
|
||||
*/
|
||||
public static function getCustomFields()
|
||||
{
|
||||
return self::getSingleton('e_customfields', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Media handler singleton object
|
||||
* @return e_media
|
||||
@@ -2764,7 +2774,7 @@ class e107
|
||||
|
||||
/**
|
||||
* Load language file, replacement of include_lan()
|
||||
*
|
||||
* @outdated use e107::lan() or e107::coreLan(), e107::plugLan(), e107::themeLan()
|
||||
* @param string $path
|
||||
* @param boolean $force
|
||||
* @return string
|
||||
@@ -2778,9 +2788,11 @@ class e107
|
||||
return false;
|
||||
}
|
||||
|
||||
self::getMessage()->addDebug("Couldn't load language file: ".$path);
|
||||
|
||||
$path = str_replace(e_LANGUAGE, 'English', $path);
|
||||
|
||||
self::getDebug()->log("Couldn't load language file: ".$path);
|
||||
|
||||
if(!is_readable($path))
|
||||
{
|
||||
return false;
|
||||
|
464
e107_handlers/e_customfields_class.php
Normal file
464
e107_handlers/e_customfields_class.php
Normal file
@@ -0,0 +1,464 @@
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* e107 website system
|
||||
*
|
||||
* 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)
|
||||
*
|
||||
*/
|
||||
class e_customfields
|
||||
{
|
||||
private $_fieldTypes = array(
|
||||
'number', 'email', 'url', 'password', 'text', 'tags', 'textarea',
|
||||
'bbarea', 'image', 'file', 'icon', 'datestamp', 'checkboxes', 'dropdown', 'radio',
|
||||
'userclass', 'user', 'boolean', 'checkbox', 'hidden', 'lanlist', 'language', 'country', 'video'
|
||||
|
||||
);
|
||||
|
||||
private $_config = array();
|
||||
|
||||
private $_data = array();
|
||||
|
||||
private $_field_limit = 20;
|
||||
|
||||
private $_tab = array('additional'=>'Additional FieldsXX');
|
||||
|
||||
|
||||
function __construct()
|
||||
{
|
||||
asort($this->_fieldTypes);
|
||||
|
||||
}
|
||||
|
||||
public function getFieldTypes()
|
||||
{
|
||||
|
||||
return $this->_fieldTypes;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load the configuration for all custom fields
|
||||
* @param string $data - json custom-field configuration data.
|
||||
* @return $this
|
||||
*/
|
||||
public function loadConfig($data)
|
||||
{
|
||||
if(empty($data))
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
if(is_array($data))
|
||||
{
|
||||
$this->_config = $data;
|
||||
return $this;
|
||||
}
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
if($arr = $tp->isJSON($data))
|
||||
{
|
||||
$this->_config = $arr;
|
||||
}
|
||||
|
||||
|
||||
// e107::getDebug()->log($this->_config);
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load a set of custom-field data for the current configuration.
|
||||
* @param string $data json custom-field form data.
|
||||
* @return $this
|
||||
*/
|
||||
public function loadData($data)
|
||||
{
|
||||
$this->_data = e107::unserialize($data);
|
||||
|
||||
// e107::getDebug()->log($this->_data);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getConfig()
|
||||
{
|
||||
return $this->_config;
|
||||
}
|
||||
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
|
||||
public function setTab($key, $label)
|
||||
{
|
||||
$this->_tab = array((string) $key => (string) $label);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getFieldValue($key, $parm=array())
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$value = $this->_data[$key];
|
||||
$raw = (!empty($parm['mode']) && $parm['mode'] === 'raw') ? true : false;
|
||||
$type = (!empty($parm['type'])) ? $parm['type'] : null;
|
||||
|
||||
$fieldType = $this->_config[$key]['type'];
|
||||
|
||||
switch($fieldType)
|
||||
{
|
||||
case "dropdown":
|
||||
case "checkboxes":
|
||||
case "radio":
|
||||
return ($raw) ? $value : e107::getForm()->renderValue($key,$value,$this->_config[$key]);
|
||||
break;
|
||||
|
||||
case "video":
|
||||
return ($raw) ? 'https://www.youtube.com/watch?v='.str_replace(".youtube", '', $value) : $tp->toVideo($value);
|
||||
break;
|
||||
|
||||
case "image":
|
||||
return ($raw) ? $tp->thumbUrl($value) : $tp->toImage($value);
|
||||
break;
|
||||
|
||||
case "icon":
|
||||
return ($raw) ? str_replace(".glyph", '', $value) : $tp->toIcon($value);
|
||||
break;
|
||||
|
||||
case "country":
|
||||
return ($raw) ? $value : e107::getForm()->getCountry($value);
|
||||
break;
|
||||
|
||||
case "tags":
|
||||
return ($raw) ? $value : $tp->toLabel($value,$type);
|
||||
break;
|
||||
|
||||
case "lanlist":
|
||||
case "language":
|
||||
return ($raw) ? $value : e107::getLanguage()->convert($value);
|
||||
break;
|
||||
|
||||
case "datestamp":
|
||||
return ($raw) ? $value : $tp->toDate($value);
|
||||
break;
|
||||
|
||||
case "file":
|
||||
return ($raw) ? $tp->toFile($value, array('raw'=>1)) : $tp->toFile($value);
|
||||
break;
|
||||
|
||||
case "url":
|
||||
case "email":
|
||||
return ($raw) ? $value : $tp->toHtml($value);
|
||||
break;
|
||||
|
||||
case "user":
|
||||
return ($raw) ? $value : e107::getSystemUser($value,true)->getName();
|
||||
break;
|
||||
|
||||
case "userclass":
|
||||
return ($raw) ? $value : e107::getUserClass()->getName($value);
|
||||
break;
|
||||
|
||||
case "textarea":
|
||||
case "bbarea":
|
||||
return $tp->toHtml($value, true);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
return $tp->toHtml($value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function renderTest()
|
||||
{
|
||||
|
||||
$text = '<table class="table table-bordered table-striped">
|
||||
<tr><th>Name</th><th>Title<br /><small>{CPAGEFIELDTITLE: name=x}</small></th><th>Normal<br /><small>{CPAGEFIELD: name=x}</small></th><th>Raw<br /><small>{CPAGEFIELD: name=x&mode=raw}</small></th></tr>';
|
||||
|
||||
foreach($this->_data as $ok=>$v)
|
||||
{
|
||||
|
||||
$text .= "<tr><td>".$ok."</td><td>".$this->getFieldTitle($ok)."</td><td>".$this->getFieldValue($ok)."</td><td>".$this->getFieldValue($ok, array('mode'=>'raw'))."</td></tr>";
|
||||
}
|
||||
|
||||
$text .= "</table>";
|
||||
|
||||
return $text;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getFieldTitle($key)
|
||||
{
|
||||
|
||||
if(!empty($this->_config[$key]['title']))
|
||||
{
|
||||
return $this->_config[$key]['title'];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function renderConfigForm($name)
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
$curVal = $this->_config;
|
||||
$value = array();
|
||||
|
||||
if(!empty($curVal))
|
||||
{
|
||||
$i = 0;
|
||||
foreach($curVal as $k=>$v)
|
||||
{
|
||||
$v['key'] = $k;
|
||||
$value[$i] = $v;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$text = "<table class='table table-striped table-bordered'>
|
||||
<colgroup>
|
||||
<col />
|
||||
<col />
|
||||
<col />
|
||||
<col style='width:40%' />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr><th>".LAN_NAME."</th><th>".LAN_TITLE."</th><th>".LAN_TYPE."</th><th>Params</th><th>".LAN_TOOLTIP."</th></tr>
|
||||
";
|
||||
|
||||
for ($i = 0; $i <= $this->_field_limit; $i++)
|
||||
{
|
||||
|
||||
$writeParms = array(
|
||||
// 'class' => 'form-control',
|
||||
'useValues' => 1,
|
||||
'default' => 'blank',
|
||||
'data-src' => e_REQUEST_URI,
|
||||
|
||||
);
|
||||
|
||||
$parmsWriteParms= array(
|
||||
'size' => 'block-level',
|
||||
'placeholder' => $this->getCustomFieldPlaceholder($value[$i]['type'])
|
||||
|
||||
);
|
||||
|
||||
$fieldName = $frm->text($name.'['.$i.'][key]', $value[$i]['key'],30, array('pattern'=>'^[a-z0-9-]*'));
|
||||
$fieldTitle = $frm->text($name.'['.$i.'][title]',$value[$i]['title'], 80);
|
||||
$fieldType = $frm->select($name.'['.$i.'][type]',$this->getFieldTypes(),$value[$i]['type'], $writeParms);
|
||||
$fieldParms = $frm->text($name.'['.$i.'][writeParms]',$value[$i]['writeParms'], 255, $parmsWriteParms);
|
||||
$fieldHelp = $frm->text($name.'['.$i.'][help]',$value[$i]['help'], 255, array('size'=>'block-level'));
|
||||
$text .= "<tr><td>".$fieldName."</td><td>".$fieldTitle."</td><td>".$fieldType."</td><td>".$fieldParms."</td><td>".$fieldHelp."</td></tr>";
|
||||
}
|
||||
|
||||
$text .= "</tbody></table>";
|
||||
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $type
|
||||
* @return null|string
|
||||
*/
|
||||
private function getCustomFieldPlaceholder($type)
|
||||
{
|
||||
switch($type)
|
||||
{
|
||||
case "radio":
|
||||
case "dropdown":
|
||||
case "checkboxes":
|
||||
return 'eg. { "optArray": { "blue": "Blue", "green": "Green", "red": "Red" }, "default": "blank" }';
|
||||
break;
|
||||
|
||||
case "datestamp":
|
||||
return 'eg. (Optional) { "format": "yyyy-mm-dd" }';
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param $fieldName
|
||||
* @param e_admin_ui $ui
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdminUIConfig($fieldName, e_admin_ui &$ui)
|
||||
{
|
||||
$fields = array();
|
||||
|
||||
$tabKey = key($this->_tab);
|
||||
$ui->addTab($tabKey, $this->_tab[$tabKey]);
|
||||
|
||||
|
||||
foreach($this->_config as $key=>$fld)
|
||||
{
|
||||
$fld['tab'] = $tabKey;
|
||||
$fld['data'] = false;
|
||||
|
||||
if($fld['type'] === 'icon')
|
||||
{
|
||||
$fld['writeParms'] .= "&glyphs=1";
|
||||
}
|
||||
|
||||
if($fld['type'] == 'checkboxes')
|
||||
{
|
||||
if($tmp = e107::getParser()->isJSON($fld['writeParms']))
|
||||
{
|
||||
$fld['writeParms'] = $tmp;
|
||||
}
|
||||
|
||||
$fld['writeParms']['useKeyValues'] = 1;
|
||||
}
|
||||
|
||||
$fields[$fieldName.'__'.$key] = $fld;
|
||||
|
||||
}
|
||||
|
||||
$ui->setFieldAttr($fields);
|
||||
|
||||
return $this;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $fieldname
|
||||
* @param e_admin_ui $ui
|
||||
* @return $this
|
||||
*/
|
||||
public function setAdminUIData($fieldname, e_admin_ui &$ui)
|
||||
{
|
||||
|
||||
$ui->getModel()->set($fieldname, null);
|
||||
|
||||
foreach($this->_data as $key=>$value)
|
||||
{
|
||||
$ui->getModel()->set($fieldname.'__'.$key, $value);
|
||||
// e107::getDebug()->log($fieldname.'__'.$key.": ".$value);
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process Posted form data and compiled Configuration Form data if found.
|
||||
* @param string $fieldname
|
||||
* @param array $postData all posted data.
|
||||
* @return array
|
||||
*/
|
||||
public function processConfigPost($fieldname, $postData)
|
||||
{
|
||||
|
||||
if(empty($postData[$fieldname]))
|
||||
{
|
||||
return $postData;
|
||||
}
|
||||
|
||||
|
||||
$new = array();
|
||||
foreach($postData[$fieldname] as $fields)
|
||||
{
|
||||
if(empty($fields['key']) || empty($fields['type']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$key = $fields['key'];
|
||||
unset($fields['key']);
|
||||
$new[$key] = $fields;
|
||||
|
||||
|
||||
}
|
||||
|
||||
$postData[$fieldname] = empty($new) ? null : $new;
|
||||
|
||||
return $postData;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Process all posted data and compile into a single field array.
|
||||
* @param $fieldname
|
||||
* @param $new_data
|
||||
* @return null
|
||||
* @internal param array $newdata - all posted data.
|
||||
*/
|
||||
public function processDataPost($fieldname, $new_data)
|
||||
{
|
||||
if(empty($new_data))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
unset($new_data[$fieldname]); // Reset.
|
||||
|
||||
$len = strlen($fieldname);
|
||||
|
||||
foreach($new_data as $k=>$v)
|
||||
{
|
||||
if(substr($k,0,$len) === $fieldname)
|
||||
{
|
||||
list($tmp,$newkey) = explode("__",$k);
|
||||
$new_data[$fieldname][$newkey] = $v;
|
||||
unset($new_data[$k]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(empty($new_data[$fieldname]))
|
||||
{
|
||||
// $new_data[$fieldname] = array();
|
||||
}
|
||||
|
||||
return $new_data;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@@ -2590,8 +2590,6 @@ class e_parse extends e_parser
|
||||
|
||||
// $parms['x'] = $encode;
|
||||
|
||||
|
||||
|
||||
if(!empty($parm['return']) && $parm['return'] == 'src')
|
||||
{
|
||||
return $this->thumbUrl($src, $parms);
|
||||
@@ -3641,6 +3639,49 @@ class e_parser
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $text
|
||||
* @return string
|
||||
*/
|
||||
public function toLabel($text, $type = null)
|
||||
{
|
||||
if($type === null)
|
||||
{
|
||||
$type = 'default';
|
||||
}
|
||||
|
||||
$tmp = explode(",",$text);
|
||||
|
||||
$opt = array();
|
||||
foreach($tmp as $v)
|
||||
{
|
||||
$opt[] = "<span class='label label-".$type."'>".$v."</span>";
|
||||
}
|
||||
|
||||
return implode(" ",$opt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Take a file-path and convert it to a download link.
|
||||
* @param $text
|
||||
* @return string
|
||||
*/
|
||||
public function toFile($text, $parm=array())
|
||||
{
|
||||
$srch = array(
|
||||
'{e_MEDIA_FILE}' => 'e_MEDIA_FILE/',
|
||||
'{e_PLUGIN}' => 'e_PLUGIN/'
|
||||
);
|
||||
|
||||
$link = e_HTTP."request.php?file=". str_replace(array_keys($srch), $srch,$text);
|
||||
|
||||
if(!empty($parm['raw']))
|
||||
{
|
||||
return $link;
|
||||
}
|
||||
|
||||
return "<a href='".$link."'>-attachment-</a>"; //TODO Add pref for this.
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an avatar based on supplied user data or current user when missing.
|
||||
@@ -3655,6 +3696,12 @@ class e_parser
|
||||
$linkStart = '';
|
||||
$linkEnd = '';
|
||||
|
||||
if(!empty($options['h']))
|
||||
{
|
||||
$height = intval($options['h']);
|
||||
}
|
||||
|
||||
|
||||
if($userData === null && USERID)
|
||||
{
|
||||
$userData = array();
|
||||
@@ -3704,7 +3751,7 @@ class e_parser
|
||||
}
|
||||
|
||||
$title = (ADMIN) ? $image : $tp->toAttribute($userData['user_name']);
|
||||
$shape = (!empty($options['shape'])) ? "img-".$options['shape'] : "img-rounded";
|
||||
$shape = (!empty($options['shape'])) ? "img-".$options['shape'] : "img-rounded rounded";
|
||||
|
||||
if(!empty($options['type']) && $options['type'] == 'url')
|
||||
{
|
||||
@@ -3857,10 +3904,18 @@ class e_parser
|
||||
|
||||
unset($parm['src']);
|
||||
$path = $tp->thumbUrl($file,$parm);
|
||||
|
||||
|
||||
if(empty($parm['w']) && empty($parm['h']))
|
||||
{
|
||||
$parm['srcset'] = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$srcSetParm = $parm;
|
||||
$srcSetParm['size'] = ($parm['w'] < 100) ? '4x' : '2x';
|
||||
|
||||
$parm['srcset'] = $tp->thumbSrcSet($file, $srcSetParm);
|
||||
}
|
||||
|
||||
}
|
||||
elseif(strpos($file,'http')===0)
|
||||
@@ -3897,7 +3952,7 @@ class e_parser
|
||||
|
||||
|
||||
$id = (!empty($parm['id'])) ? "id=\"".$parm['id']."\" " : "" ;
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : "img-responsive";
|
||||
$class = (!empty($parm['class'])) ? $parm['class'] : "img-responsive img-fluid";
|
||||
$alt = (!empty($parm['alt'])) ? $tp->toAttribute($parm['alt']) : basename($file);
|
||||
$style = (!empty($parm['style'])) ? "style=\"".$parm['style']."\" " : "" ;
|
||||
$srcset = (!empty($parm['srcset'])) ? "srcset=\"".$parm['srcset']."\" " : "";
|
||||
@@ -3950,6 +4005,35 @@ class e_parser
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if string is json and parse or return false.
|
||||
* @param $text
|
||||
* @return bool|mixed return false if not json, and json values if true.
|
||||
*/
|
||||
public function isJSON($text)
|
||||
{
|
||||
if(!is_string($text))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(substr($text,0,1) === '{' || substr($text,0,1) === '[') // json
|
||||
{
|
||||
$dat = json_decode($text, true);
|
||||
|
||||
if(json_last_error() != JSON_ERROR_NONE)
|
||||
{
|
||||
// e107::getDebug()->log("Json data found");
|
||||
return false;
|
||||
}
|
||||
|
||||
return $dat;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -4074,7 +4158,7 @@ class e_parser
|
||||
|
||||
if($thumb == 'tag')
|
||||
{
|
||||
return "<img class='img-responsive' src='".$thumbSrc."' alt='Youtube Video' style='width:".vartrue($parm['w'],'80')."px'/>";
|
||||
return "<img class='img-responsive img-fluid' src='".$thumbSrc."' alt='Youtube Video' style='width:".vartrue($parm['w'],'80')."px'/>";
|
||||
}
|
||||
|
||||
if($thumb == 'email')
|
||||
@@ -4120,7 +4204,7 @@ class e_parser
|
||||
{
|
||||
$thumbSrc = e_IMAGE_ABS."generic/playlist_120.png";
|
||||
}
|
||||
return "<img class='img-responsive' src='".$thumbSrc."' alt='".LAN_YOUTUBE_PLAYLIST."' style='width:".vartrue($parm['w'],'80')."px'/>";
|
||||
return "<img class='img-responsive img-fluid' src='".$thumbSrc."' alt='".LAN_YOUTUBE_PLAYLIST."' style='width:".vartrue($parm['w'],'80')."px'/>";
|
||||
|
||||
}
|
||||
|
||||
|
@@ -16,8 +16,8 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php");
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_print.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_email.php");
|
||||
|
||||
class emailprint
|
||||
{
|
||||
|
@@ -67,6 +67,8 @@ class e_form
|
||||
protected $_tabindex_enabled = true;
|
||||
protected $_cached_attributes = array();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @var user_class
|
||||
*/
|
||||
@@ -531,10 +533,11 @@ class e_form
|
||||
$text .= '</ul>';
|
||||
|
||||
$initTab = varset($options['active'],false);
|
||||
$tabClass = varset($options['class'],null);
|
||||
|
||||
$text .= '
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">';
|
||||
<div class="tab-content '.$tabClass.'">';
|
||||
|
||||
$c=0;
|
||||
foreach($array as $key=>$tab)
|
||||
@@ -896,7 +899,7 @@ class e_form
|
||||
|
||||
if(!empty($extras['video']))
|
||||
{
|
||||
$url .= "&video=1";
|
||||
$url .= ($extras['video'] == 2) ? "&video=2" : "&video=1";
|
||||
}
|
||||
|
||||
if(!empty($extras['path']) && $extras['path'] == 'plugin')
|
||||
@@ -982,13 +985,13 @@ class e_form
|
||||
if($localonly == true)
|
||||
{
|
||||
$text = "<input class='tbox' style='width:80%' id='{$idinput}' type='hidden' name='image' value='{$curVal}' />";
|
||||
$text .= "<img src='".$img."' id='{$previnput}' class='img-rounded e-expandit e-tip avatar' style='cursor:pointer; width:".$pref['im_width']."px; height:".$pref['im_height']."px' title='".LAN_EFORM_001."' alt='Click on the avatar to change it' />";
|
||||
$text .= "<img src='".$img."' id='{$previnput}' class='img-rounded rounded e-expandit e-tip avatar' style='cursor:pointer; width:".$pref['im_width']."px; height:".$pref['im_height']."px' title='".LAN_EFORM_001."' alt='Click on the avatar to change it' />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = "<input class='tbox' style='width:80%' id='{$idinput}' type='text' name='image' size='40' value='$curVal' maxlength='100' title=\"".LAN_SIGNUP_111."\" />";
|
||||
$text .= "<img src='".$img."' id='{$previnput}' style='display:none' />";
|
||||
$text .= "<input class='img-rounded btn btn-default button e-expandit' type ='button' style='cursor:pointer' size='30' value=\"".LAN_EFORM_002."\" />";
|
||||
$text .= "<input class='img-rounded rounded btn btn-default button e-expandit' type ='button' style='cursor:pointer' size='30' value=\"".LAN_EFORM_002."\" />";
|
||||
}
|
||||
|
||||
$avFiles = e107::getFile()->get_files(e_AVATAR_DEFAULT,".jpg|.png|.gif|.jpeg|.JPG|.GIF|.PNG");
|
||||
@@ -1028,9 +1031,9 @@ class e_form
|
||||
|
||||
if(ADMIN)
|
||||
{
|
||||
$EAVATAR = "<b>".e_AVATAR_DEFAULT."</b>";
|
||||
$EAVATAR = e_AVATAR_DEFAULT;
|
||||
$text .= "<div class='alert alert-danger'>";
|
||||
$text .= e107::getParser()->lanVars(LAN_EFORM_006, array('x'=>$EAVATAR));
|
||||
$text .= e107::getParser()->lanVars(e107::getParser()->toHTML(LAN_EFORM_006, true), array('x'=>$EAVATAR));
|
||||
$text .= "</div>";
|
||||
}
|
||||
|
||||
@@ -1105,7 +1108,7 @@ class e_form
|
||||
}
|
||||
|
||||
|
||||
e107::getDebug()->log($sc_parameters);
|
||||
// e107::getDebug()->log($sc_parameters);
|
||||
|
||||
$default_thumb = $default;
|
||||
$class = '';
|
||||
@@ -1181,7 +1184,7 @@ e107::getDebug()->log($sc_parameters);
|
||||
$thpath = empty($default) || !empty($video) ? $default_url : $tp->thumbUrl($default_thumb, $att, true);
|
||||
//isset($sc_parameters['nothumb']) || vartrue($hide) ?
|
||||
|
||||
$label = "<img id='{$name_id}_prev' src='".$thpath."' alt='{$default_url}' class='well well-small image-selector img-responsive' style='display:block;' />";
|
||||
$label = "<img id='{$name_id}_prev' src='".$thpath."' alt='{$default_url}' class='well well-small image-selector img-responsive img-fluid' style='display:block;' />";
|
||||
|
||||
if($cat != 'news' && $cat !='page' && $cat !='' && strpos($cat,'_image')===false)
|
||||
{
|
||||
@@ -2763,29 +2766,29 @@ e107::getDebug()->log($sc_parameters);
|
||||
switch ($image)
|
||||
{
|
||||
case 'edit':
|
||||
$icon = "e-edit-32";
|
||||
$icon = (e_ADMIN_AREA === true) ? ADMIN_EDIT_ICON : $tp->toIcon("e-edit-32");
|
||||
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action edit' : $options['class'];
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
$icon = (e_ADMIN_AREA === true) ? "e-delete-32" : 'fa-trash.glyph';
|
||||
$icon = (e_ADMIN_AREA === true) ? ADMIN_DELETE_ICON : $tp->toIcon('fa-trash.glyph');
|
||||
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action delete' : $options['class'];
|
||||
$options['other'] = 'data-confirm="'.LAN_JSCONFIRM.'"';
|
||||
break;
|
||||
|
||||
case 'execute':
|
||||
$icon = "e-execute-32";
|
||||
$icon = (e_ADMIN_AREA === true) ? ADMIN_EXECUTE_ICON : $tp->toIcon('fa-power-off.glyph');
|
||||
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action execute' : $options['class'];
|
||||
break;
|
||||
|
||||
case 'view':
|
||||
$icon = "e-view-32";
|
||||
$icon = $tp->toIcon("e-view-32");
|
||||
$options['class'] = $options['class'] == 'action' ? 'btn btn-default action view' : $options['class'];
|
||||
break;
|
||||
}
|
||||
$options['title'] = $title;//shorthand
|
||||
|
||||
return "<button type='submit' name='{$name}' data-placement='left' value='{$value}'".$this->get_attributes($options, $name, $value)." >".$tp->toIcon($icon)."</button>";
|
||||
return "<button type='submit' name='{$name}' data-placement='left' value='{$value}'".$this->get_attributes($options, $name, $value)." >".$icon."</button>";
|
||||
|
||||
|
||||
}
|
||||
@@ -3011,6 +3014,11 @@ e107::getDebug()->log($sc_parameters);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Helper function to get default button class by action.
|
||||
*
|
||||
@@ -3877,6 +3885,12 @@ e107::getDebug()->log($sc_parameters);
|
||||
$parms = $attributes['readParms'];
|
||||
}
|
||||
|
||||
// @see custom fields in cpage which accept json params.
|
||||
if(!empty($attributes['writeParms']) && $tmpOpt = e107::getParser()->isJSON($attributes['writeParms']))
|
||||
{
|
||||
$attributes['writeParms'] = $tmpOpt;
|
||||
unset($tmpOpt);
|
||||
}
|
||||
|
||||
|
||||
if(!empty($attributes['inline'])) $parms['editable'] = true; // attribute alias
|
||||
@@ -3982,9 +3996,15 @@ e107::getDebug()->log($sc_parameters);
|
||||
break;
|
||||
|
||||
case 'checkboxes':
|
||||
$value = $this->checkbox(vartrue($attributes['toggle'], 'multiselect').'['.$id.']', $id);
|
||||
|
||||
//$attributes['type'] = 'text';
|
||||
if(empty($attributes['writeParms'])) // avoid comflicts with a field called 'checkboxes'
|
||||
{
|
||||
$value = $this->checkbox(vartrue($attributes['toggle'], 'multiselect').'['.$id.']', $id);
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -4009,6 +4029,10 @@ e107::getDebug()->log($sc_parameters);
|
||||
// else same
|
||||
break;
|
||||
|
||||
case 'country':
|
||||
$value = $this->getCountry($value);
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
//$e107 = e107::getInstance();
|
||||
$value = "<span title='".$value."'>".e107::getIPHandler()->ipDecode($value).'</span>';;
|
||||
@@ -4082,7 +4106,7 @@ e107::getDebug()->log($sc_parameters);
|
||||
$opts['multiple'] = true;
|
||||
}
|
||||
|
||||
if(vartrue($opts['multiple']))
|
||||
if(!empty($opts['multiple']))
|
||||
{
|
||||
$ret = array();
|
||||
$value = is_array($value) ? $value : explode(',', $value);
|
||||
@@ -4091,6 +4115,8 @@ e107::getDebug()->log($sc_parameters);
|
||||
if(isset($wparms[$v])) $ret[] = $wparms[$v];
|
||||
}
|
||||
$value = implode(', ', $ret);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4837,10 +4863,14 @@ e107::getDebug()->log($sc_parameters);
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
|
||||
$parms = vartrue($attributes['writeParms'], array());
|
||||
|
||||
if($tmpOpt = $tp->isJSON($parms))
|
||||
{
|
||||
$parms = $tmpOpt;
|
||||
unset($tmpOpt);
|
||||
}
|
||||
|
||||
if(is_string($parms)) parse_str($parms, $parms);
|
||||
|
||||
$ajaxParms = array();
|
||||
@@ -4850,9 +4880,11 @@ e107::getDebug()->log($sc_parameters);
|
||||
$ajaxParms['data-src'] = varset($parms['ajax']['src']);
|
||||
$ajaxParms['data-target'] = varset($parms['ajax']['target']);
|
||||
$ajaxParms['data-method'] = varset($parms['ajax']['method'], 'html');
|
||||
$ajaxParms['data-loading'] = varset($parms['ajax']['loading'], $tp->toGlyph('fa-spinner', array('spin'=>1)));
|
||||
$ajaxParms['data-loading'] = varset($parms['ajax']['loading'], 'fa-spinner'); //$tp->toGlyph('fa-spinner', array('spin'=>1))
|
||||
|
||||
unset($attributes['writeParms']['ajax']);
|
||||
|
||||
// e107::getDebug()->log($parms['ajax']);
|
||||
}
|
||||
|
||||
if(!empty($attributes['multilan']))
|
||||
@@ -4932,6 +4964,10 @@ e107::getDebug()->log($sc_parameters);
|
||||
$ret = vartrue($parms['pre']).$this->number($key, $value, $maxlength, $parms).vartrue($parms['post']);
|
||||
break;
|
||||
|
||||
case 'country':
|
||||
$ret = vartrue($parms['pre']).$this->country($key, $value).vartrue($parms['post']);
|
||||
break;
|
||||
|
||||
case 'ip':
|
||||
$ret = vartrue($parms['pre']).$this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms).vartrue($parms['post']);
|
||||
break;
|
||||
@@ -4953,6 +4989,11 @@ e107::getDebug()->log($sc_parameters);
|
||||
case 'password': // encrypts to md5 when saved.
|
||||
$maxlength = vartrue($parms['maxlength'], 255);
|
||||
unset($parms['maxlength']);
|
||||
if(!isset($parms['required']))
|
||||
{
|
||||
|
||||
$parms['required'] = false;
|
||||
}
|
||||
$ret = vartrue($parms['pre']).$this->password($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
|
||||
|
||||
break;
|
||||
@@ -5024,9 +5065,17 @@ e107::getDebug()->log($sc_parameters);
|
||||
$ret = vartrue($parms['pre']).$this->bbarea($key, $value, vartrue($parms['template']), vartrue($parms['media']), vartrue($parms['size'], 'medium'),$options ).vartrue($parms['post']);
|
||||
break;
|
||||
|
||||
case 'video':
|
||||
case 'image': //TODO - thumb, image list shortcode, js tooltip...
|
||||
$label = varset($parms['label'], 'LAN_EDIT');
|
||||
unset($parms['label']);
|
||||
|
||||
if($attributes['type'] === 'video')
|
||||
{
|
||||
$parms['video'] = 2; // ie. video only.
|
||||
$parms['w'] = 280;
|
||||
}
|
||||
|
||||
$ret = $this->imagepicker($key, $value, defset($label, $label), $parms);
|
||||
break;
|
||||
|
||||
@@ -5574,7 +5623,7 @@ e107::getDebug()->log($sc_parameters);
|
||||
".$this->token()."
|
||||
";
|
||||
|
||||
foreach ($form['fieldsets'] as $elid => $data) //XXX rename 'fieldsets' to 'forms' ?
|
||||
foreach ($form['fieldsets'] as $elid => $data)
|
||||
{
|
||||
$elid = $form['id'].'-'.$elid;
|
||||
|
||||
@@ -5593,6 +5642,12 @@ e107::getDebug()->log($sc_parameters);
|
||||
{
|
||||
$active = (strval($tabId) === $curTab) ? 'active' : '';
|
||||
$text .= '<div class="tab-pane '.$active.'" id="tab'.$tabId.'">';
|
||||
|
||||
// e107::getDebug()->log('elid: '.$elid. " tabid: ".$tabId);
|
||||
// e107::getDebug()->log($data);
|
||||
// e107::getDebug()->log($model);
|
||||
|
||||
|
||||
$text .= $this->renderCreateFieldset($elid, $data, $model, $tabId);
|
||||
$text .= "</div>";
|
||||
}
|
||||
@@ -5632,12 +5687,13 @@ e107::getDebug()->log($sc_parameters);
|
||||
* @param string $id field id
|
||||
* @param array $fdata fieldset data
|
||||
* @param object $model
|
||||
* @return string
|
||||
* @return string | false
|
||||
*/
|
||||
function renderCreateFieldset($id, $fdata, $model, $tab=0)
|
||||
{
|
||||
|
||||
$text = vartrue($fdata['fieldset_pre'])."
|
||||
|
||||
$start = vartrue($fdata['fieldset_pre'])."
|
||||
<fieldset id='{$id}-".$tab."'>
|
||||
<legend>".vartrue($fdata['legend'])."</legend>
|
||||
".vartrue($fdata['table_pre'])."
|
||||
@@ -5649,6 +5705,8 @@ e107::getDebug()->log($sc_parameters);
|
||||
<tbody>
|
||||
";
|
||||
|
||||
$text = '';
|
||||
|
||||
// required fields - model definition
|
||||
$model_required = $model->getValidationRules();
|
||||
$required_help = false;
|
||||
@@ -5770,7 +5828,7 @@ e107::getDebug()->log($sc_parameters);
|
||||
$text .= "
|
||||
<tr><td colspan='2'>";
|
||||
|
||||
$text .= "<div style='padding-bottom:8px'>".$leftCell."</div>";
|
||||
$text .= (isset($writeParms['nolabel']) && $writeParms['nolabel'] == 2) ? '' : "<div style='padding-bottom:8px'>".$leftCell."</div>" ;
|
||||
$text .= $rightCell."
|
||||
</td>
|
||||
|
||||
@@ -5814,6 +5872,11 @@ e107::getDebug()->log($sc_parameters);
|
||||
$required_help = '<div class="form-note">'.$this->getRequiredString().' - required fields</div>'; //TODO - lans
|
||||
}
|
||||
|
||||
|
||||
if(!empty($text) || !empty($hidden_fields))
|
||||
{
|
||||
$text = $start.$text;
|
||||
|
||||
$text .= "
|
||||
</tbody>
|
||||
</table>";
|
||||
@@ -5825,6 +5888,11 @@ e107::getDebug()->log($sc_parameters);
|
||||
$text .= vartrue($fdata['fieldset_post']);
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
|
||||
/*
|
||||
$text .= "
|
||||
|
@@ -1336,13 +1336,25 @@ class e_jsmanager
|
||||
if('css' === $external)
|
||||
{
|
||||
$path = explode($this->_sep, $path, 4);
|
||||
|
||||
|
||||
|
||||
$media = $path[0];
|
||||
// support of IE checks
|
||||
$pre = varset($path[2]) ? $path[2]."\n" : '';
|
||||
$post = varset($path[3]) ? "\n".$path[3] : '';
|
||||
$path = $path[1];
|
||||
|
||||
$insertID ='';
|
||||
|
||||
if(strpos($path, 'http') !== 0) // local file.
|
||||
{
|
||||
|
||||
if($label === 'Theme CSS') // add an id for local theme stylesheets.
|
||||
{
|
||||
$insertID = 'id="stylesheet-'. eHelper::secureIdAttr(str_replace(array('{e_THEME}','.css'),'',$path)).'"' ;
|
||||
}
|
||||
|
||||
if($this->addCache($external,$path) === true) // if cache enabled, then skip and continue.
|
||||
{
|
||||
continue;
|
||||
@@ -1354,7 +1366,8 @@ class e_jsmanager
|
||||
continue;
|
||||
}
|
||||
|
||||
echo $pre.'<link rel="stylesheet" media="'.$media.'" property="stylesheet" type="text/css" href="'.$path.'" />'.$post;
|
||||
|
||||
echo $pre.'<link '.$insertID.' rel="stylesheet" media="'.$media.'" property="stylesheet" type="text/css" href="'.$path.'" />'.$post;
|
||||
echo "\n";
|
||||
|
||||
continue;
|
||||
|
@@ -15,7 +15,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
|
||||
// require_once(e_HANDLER.'user_handler.php'); //shouldn't be necessary
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_login.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_login.php');
|
||||
|
||||
// TODO - class constants
|
||||
define ('LOGIN_TRY_OTHER', 2); // Try some other authentication method
|
||||
|
@@ -787,7 +787,7 @@ class e107Email extends PHPMailer
|
||||
{
|
||||
$size = isset($mediaParms[$nk]) ? "?w=".$mediaParms[$nk]['w'] : '';
|
||||
//echo $nk.": ".$val['path'].$size."<br />";
|
||||
$eml['shortcodes'][$id] = "<div class='media media-image'><img class='img-responsive ".strtolower($id)."' src='".$val['path'].$size."' alt='' /></div>";
|
||||
$eml['shortcodes'][$id] = "<div class='media media-image'><img class='img-responsive img-fluid ".strtolower($id)."' src='".$val['path'].$size."' alt='' /></div>";
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -97,7 +97,7 @@ Variables relating to DB values all begin 'mail_' - others are internal (volatil
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php'); // May be needed by anything loading this class
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_mailout.php'); // May be needed by anything loading this class
|
||||
|
||||
define('MAIL_STATUS_SENT', 0); // Mail sent. Email handler happy, but may have bounced (or may be yet to bounce)
|
||||
define('MAIL_STATUS_BOUNCED', 1);
|
||||
|
@@ -37,7 +37,7 @@ class e_media
|
||||
$this->logging = true;
|
||||
}
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_image.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_image.php');
|
||||
}
|
||||
|
||||
|
||||
@@ -1267,7 +1267,7 @@ class e_media
|
||||
|
||||
if($data['type'] == 'image')
|
||||
{
|
||||
$text .= '<img class="img-responsive" alt="" src="'.$data['thumbUrl'].'" style="width:100%;display:inline-block" />';
|
||||
$text .= '<img class="img-responsive img-fluid" alt="" src="'.$data['thumbUrl'].'" style="width:100%;display:inline-block" />';
|
||||
}
|
||||
elseif($data['type'] == 'glyph')
|
||||
{
|
||||
|
@@ -451,6 +451,8 @@ class e_menu
|
||||
public function renderMenu($mpath, $mname='', $parm = '', $return = false)
|
||||
{
|
||||
// global $sql; // required at the moment.
|
||||
|
||||
|
||||
global $sc_style, $e107_debug;
|
||||
|
||||
|
||||
@@ -540,7 +542,8 @@ class e_menu
|
||||
$id = e107::getForm()->name2id($mpath . $mname);
|
||||
$ns->setUniqueId($id);
|
||||
|
||||
global $pref; // possibly used by plugin menu.
|
||||
|
||||
$pref = e107::getPref(); // possibly used by plugin menu.
|
||||
|
||||
|
||||
$e107_debug ? include(e_PLUGIN.$mpath.$mname.'.php') : @include(e_PLUGIN.$mpath.$mname.'.php');
|
||||
|
@@ -2659,6 +2659,14 @@ class e_front_model extends e_model
|
||||
return $tp->toDB($value);
|
||||
break;
|
||||
|
||||
case 'json':
|
||||
if(empty($value))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return e107::serialize($value,'json');
|
||||
break;
|
||||
|
||||
case 'code':
|
||||
return $tp->toDB($value, false, false, 'pReFs');
|
||||
break;
|
||||
|
@@ -23,7 +23,7 @@ class notify
|
||||
|
||||
function __construct()
|
||||
{
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
|
||||
|
||||
if(empty($this->notify_prefs))
|
||||
{
|
||||
|
@@ -277,11 +277,11 @@ class e107plugin
|
||||
foreach($plugVersions as $path=>$version)
|
||||
{
|
||||
$fullPath = e_PLUGIN.$path."/plugin.xml";
|
||||
if(is_file(e_PLUGIN.$path."/plugin.xml"))
|
||||
if(file_exists(e_PLUGIN.$path."/plugin.xml"))
|
||||
{
|
||||
$data = $xml->loadXMLfile($fullPath, true);
|
||||
|
||||
if(!in_array($path, $this->core_plugins)) // check non-core plugins for sql file changes.
|
||||
if(!isset($this->core_plugins[$path])) // check non-core plugins for sql file changes.
|
||||
{
|
||||
$dbv->errors = array();
|
||||
$dbv->compare($path);
|
||||
@@ -2839,7 +2839,7 @@ class e107plugin
|
||||
{
|
||||
if(empty($dir))
|
||||
{
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
global $sysprefs, $mySQLprefix;
|
||||
@@ -2854,7 +2854,7 @@ class e107plugin
|
||||
|
||||
if(!is_array($plug))
|
||||
{
|
||||
return "'{$id}' is missing from the plugin db table";
|
||||
return "'{$dir}' is missing from the plugin db table";
|
||||
}
|
||||
|
||||
$_path = e_PLUGIN.$plug['plugin_path'].'/';
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_rate.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_rate.php");
|
||||
|
||||
class rater {
|
||||
|
||||
|
@@ -107,10 +107,15 @@ class e_parse_shortcode
|
||||
// $_SESSION['editable'] = array();
|
||||
|
||||
$this->ignoreCodes = e107::getParser()->getUrlConstants(); // ignore all URL shortcodes. ie. {e_PLUGIN}
|
||||
|
||||
if(e_ADMIN_AREA !== true)
|
||||
{
|
||||
$this->loadOverrideShortcodes();
|
||||
$this->loadThemeShortcodes();
|
||||
$this->loadPluginShortcodes();
|
||||
$this->loadPluginSCFiles();
|
||||
|
||||
}
|
||||
//$this->loadCoreShortcodes(); DEPRECATED
|
||||
|
||||
$editableActivePref = e107::getPref('inline_editing',255);
|
||||
@@ -1310,7 +1315,7 @@ class e_parse_shortcode
|
||||
|
||||
if (E107_DBG_SC || E107_DBG_TIMEDETAILS)
|
||||
{
|
||||
$sql->db_Mark_Time("(After SC {$code})");
|
||||
// $sql->db_Mark_Time("(After SC {$code})");
|
||||
}
|
||||
|
||||
if (($noDebugLog != true) && (E107_DBG_BBSC || E107_DBG_SC || E107_DBG_TIMEDETAILS))
|
||||
|
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_sitelinks.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_sitelinks.php');
|
||||
|
||||
class sitelinks
|
||||
{
|
||||
@@ -150,12 +150,17 @@ class sitelinks
|
||||
$link['link_expand'] = ((isset($pref['sitelinks_expandsub']) && $pref['sitelinks_expandsub']) && !vartrue($style['linkmainonly']) && !defined("LINKSRENDERONLYMAIN") && isset($this->eLinkList[$main_linkid]) && is_array($this->eLinkList[$main_linkid])) ? TRUE : FALSE;
|
||||
$render_link[$key] = $this->makeLink($link,'', $style, $css_class);
|
||||
|
||||
if(!defined("LINKSRENDERONLYMAIN") && !varset($style['linkmainonly'])) /* if this is defined in theme.php only main links will be rendered */
|
||||
if(!defined("LINKSRENDERONLYMAIN") && !isset($style['linkmainonly'])) /* if this is defined in theme.php only main links will be rendered */
|
||||
{
|
||||
$render_link[$key] .= $this->subLink($main_linkid,$aSubStyle,$css_class);
|
||||
}
|
||||
}
|
||||
$text .= implode(varset($style['linkseparator']), $render_link);
|
||||
|
||||
if(!empty($style['linkseparator']))
|
||||
{
|
||||
$text .= implode($style['linkseparator'], $render_link);
|
||||
}
|
||||
|
||||
$text .= $style['postlink'];
|
||||
if ($style['linkdisplay'] == 2)
|
||||
{
|
||||
@@ -266,7 +271,7 @@ class sitelinks
|
||||
$tmp = explode('.', $linkInfo['link_name'], 3);
|
||||
$linkInfo['link_name'] = $tmp[2];
|
||||
}
|
||||
$indent = ($style['linkdisplay'] != 3) ? varset($style['subindent']) : "";
|
||||
$indent = ($style['linkdisplay'] != 3) ? ($style['subindent']) : "";
|
||||
}
|
||||
|
||||
// Convert any {e_XXX} to absolute URLs (relative ones sometimes get broken by adding e_HTTP at the front)
|
||||
@@ -316,7 +321,9 @@ class sitelinks
|
||||
$linkstart = (isset($style['linkstart_hilite'])) ? $style['linkstart_hilite'] : "";
|
||||
$highlighted = TRUE;
|
||||
}
|
||||
if ($this->hilite(varset($linkInfo['link_url']), varset($style['linkclass_hilite']))== TRUE)
|
||||
|
||||
|
||||
if ($this->hilite(varset($linkInfo['link_url']), !empty($style['linkclass_hilite'])))
|
||||
{
|
||||
$linkadd = (isset($style['linkclass_hilite'])) ? " class='".$style['linkclass_hilite']."'" : "";
|
||||
$highlighted = TRUE;
|
||||
@@ -358,7 +365,7 @@ e107::getDebug()->log($linkInfo['link_url']);
|
||||
// If its a link.. make a link
|
||||
$_link = "";
|
||||
$_link .= $accessdigit;
|
||||
if (!empty($href) && ((varset($style['hilite_nolink']) && $highlighted)!=TRUE))
|
||||
if (!empty($href) && ((isset($style['hilite_nolink']) && $highlighted)!=TRUE))
|
||||
{
|
||||
$_link .= "<a".$linkadd.$screentip.$href.$link_append.$accesskey.">".$tp->toHTML($linkInfo['link_name'],"","emotes_off, defs, no_hook")."</a>";
|
||||
}
|
||||
@@ -1237,25 +1244,22 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
// echo "ap = ".$active_page;
|
||||
// echo " act = ".$act."<br /><br />";
|
||||
|
||||
|
||||
|
||||
|
||||
if($rid == 'adminhome')
|
||||
{
|
||||
$temp = $tmpl['button_other'.$kpost];
|
||||
}
|
||||
|
||||
if($rid == 'home')
|
||||
if(!empty($e107_vars[$act]['template']))
|
||||
{
|
||||
$temp = $tmpl['button_home'.$kpost];
|
||||
$tmplateKey = 'button_'.$e107_vars[$act]['template'].$kpost;
|
||||
$temp = $tmpl[$tmplateKey];
|
||||
|
||||
// e107::getDebug()->log($tmplateKey);
|
||||
}
|
||||
|
||||
if($rid == 'language')
|
||||
{
|
||||
$temp = $tmpl['button_language'.$kpost];
|
||||
}
|
||||
|
||||
if($rid == 'logout')
|
||||
{
|
||||
$temp = $tmpl['button_logout'.$kpost];
|
||||
}
|
||||
|
||||
$replace[0] = str_replace(" ", " ", $e107_vars[$act]['text']);
|
||||
// valid URLs
|
||||
@@ -1782,6 +1786,26 @@ class navigation_shortcodes extends e_shortcode
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns only the anchor target in the URL if one is found.
|
||||
* @param null $parm
|
||||
* @return null|string
|
||||
*/
|
||||
function sc_link_target($parm=null)
|
||||
{
|
||||
if(strpos($this->var['link_url'],'#')!==false)
|
||||
{
|
||||
list($tmp,$segment) = explode('#',$this->var['link_url'],2);
|
||||
return '#'.$segment;
|
||||
|
||||
}
|
||||
|
||||
return '#';
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_link_open($parm = '')
|
||||
{
|
||||
$type = $this->var['link_open'] ? (int) $this->var['link_open'] : 0;
|
||||
|
@@ -329,7 +329,7 @@ class e_theme
|
||||
$vars['path'] = $path;
|
||||
$vars['@attributes']['default'] = (varset($vars['@attributes']['default']) && strtolower($vars['@attributes']['default']) == 'true') ? 1 : 0;
|
||||
$vars['preview'] = varset($vars['screenshots']['image']);
|
||||
$vars['thumbnail'] = varset($vars['preview'][0]);
|
||||
$vars['thumbnail'] = isset($vars['preview'][0]) ? $vars['preview'][0] : '';
|
||||
|
||||
|
||||
if(!empty($vars['themePrefs']))
|
||||
@@ -653,7 +653,7 @@ class themeHandler
|
||||
{
|
||||
$key = key($_POST['installplugin']);
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_plugin.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_plugin.php");
|
||||
require_once (e_HANDLER."plugin_class.php");
|
||||
|
||||
$eplug = new e107plugin;
|
||||
@@ -664,7 +664,7 @@ class themeHandler
|
||||
if(isset($_POST['setMenuPreset']))
|
||||
{
|
||||
$key = key($_POST['setMenuPreset']);
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_menus.php");
|
||||
require_once (e_HANDLER."menumanager_class.php");
|
||||
$men = new e_menuManager();
|
||||
$men->curLayout = $key;
|
||||
@@ -1422,7 +1422,7 @@ class themeHandler
|
||||
|
||||
|
||||
$text .= "<div class='col-md-6'>
|
||||
<img class='img-responsive' src='".$picFull."' alt=\"".$theme['name']."\" />
|
||||
<img class='img-responsive img-fluid' src='".$picFull."' alt=\"".$theme['name']."\" />
|
||||
</div>";
|
||||
|
||||
}
|
||||
@@ -2290,7 +2290,7 @@ class themeHandler
|
||||
|
||||
function showPreview()
|
||||
{
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_theme.php");
|
||||
$text = "<br /><div class='indent'>".TPVLAN_1.".</div><br />";
|
||||
global $ns;
|
||||
$ns->tablerender(TPVLAN_2, $text);
|
||||
|
@@ -30,7 +30,7 @@ if (!defined('e107_INIT'))
|
||||
exit;
|
||||
}
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_upload_handler.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_upload_handler.php');
|
||||
|
||||
//define("UH_DEBUG",TRUE);
|
||||
|
||||
|
@@ -50,7 +50,7 @@ class e107_user_extended
|
||||
private $nameIndex = array(); // Array for field name lookup - initialised by constructor
|
||||
public $systemCount = 0; // Count of system fields - always zero ATM
|
||||
public $userCount = 0; // Count of non-system fields
|
||||
private $fieldPermissions = array(); // Field Permissionss with field name as key.
|
||||
private $fieldAttributes = array(); // Field Permissionss with field name as key.
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -67,20 +67,22 @@ class e107_user_extended
|
||||
define('EUF_CHECKBOX',10);
|
||||
define('EUF_PREFIELD',11); // should be EUF_PREDEFINED, useful when creating fields from e.g. plugin XML
|
||||
define('EUF_ADDON', 12); // defined within e_user.php addon
|
||||
define('EUF_COUNTRY', 13); // $frm->country()
|
||||
|
||||
$this->typeArray = array(
|
||||
'text' => 1,
|
||||
'radio' => 2,
|
||||
'dropdown' => 3,
|
||||
'db field' => 4,
|
||||
'textarea' => 5,
|
||||
'integer' => 6,
|
||||
'date' => 7,
|
||||
'language' => 8,
|
||||
'list' => 9,
|
||||
'checkbox' => 10,
|
||||
'predefined' => 11, // DON'T USE IT IN PREDEFINED FIELD XML!!! Used in plugin installation routine.
|
||||
'addon' => 12
|
||||
'text' => EUF_TEXT,
|
||||
'radio' => EUF_RADIO,
|
||||
'dropdown' => EUF_DROPDOWN,
|
||||
'db field' => EUF_DB_FIELD,
|
||||
'textarea' => EUF_TEXTAREA,
|
||||
'integer' => EUF_INTEGER,
|
||||
'date' => EUF_DATE,
|
||||
'language' => EUF_LANGUAGE,
|
||||
'list' => EUF_PREDEFINED,
|
||||
'checkbox' => EUF_CHECKBOX,
|
||||
'predefined' => EUF_PREFIELD, // DON'T USE IT IN PREDEFINED FIELD XML!!! Used in plugin installation routine.
|
||||
'addon' => EUF_ADDON,
|
||||
'country' => EUF_COUNTRY,
|
||||
);
|
||||
|
||||
$this->user_extended_types = array(
|
||||
@@ -93,7 +95,8 @@ class e107_user_extended
|
||||
7 => LAN_DATE,
|
||||
8 => UE_LAN_8,
|
||||
9 => UE_LAN_9,
|
||||
10=> UE_LAN_10
|
||||
10=> UE_LAN_10,
|
||||
13=> UE_LAN_13
|
||||
// 12=> UE_LAN_10
|
||||
);
|
||||
|
||||
@@ -129,8 +132,14 @@ class e107_user_extended
|
||||
{ // Its a field definition
|
||||
$this->fieldDefinitions[$row['user_extended_struct_id']] = $row;
|
||||
$id = 'user_' . $row['user_extended_struct_name'];
|
||||
$this->fieldPermissions[$id] = array('read'=>$row['user_extended_struct_read'], 'write'=>$row['user_extended_struct_write']);
|
||||
|
||||
$this->fieldAttributes[$id] = array(
|
||||
'read' => $row['user_extended_struct_read'],
|
||||
'write' => $row['user_extended_struct_write'],
|
||||
'type' => $row['user_extended_struct_type']
|
||||
);
|
||||
$this->nameIndex['user_' . $row['user_extended_struct_name']] = $row['user_extended_struct_id']; // Create name to ID index
|
||||
|
||||
if($row['user_extended_struct_text'] == '_system_')
|
||||
{
|
||||
$this->systemCount++;
|
||||
@@ -152,7 +161,7 @@ class e107_user_extended
|
||||
*/
|
||||
public function hasPermission($field, $type='read')
|
||||
{
|
||||
$class = ($type == 'read') ? $this->fieldPermissions[$field]['read'] : $this->fieldPermissions[$field]['write'];
|
||||
$class = ($type == 'read') ? $this->fieldAttributes[$field]['read'] : $this->fieldAttributes[$field]['write'];
|
||||
return check_class($class);
|
||||
}
|
||||
|
||||
@@ -263,19 +272,35 @@ class e107_user_extended
|
||||
$requiredField = $params['user_extended_struct_required'] == 1;
|
||||
$regex = $tp->toText($parms[1]);
|
||||
$regexfail = $tp->toText($parms[2]);
|
||||
if (defined($regexfail)) { $regexfail = constant($regexfail); }
|
||||
if($val == '' && $requiredField) return TRUE;
|
||||
if(defined($regexfail))
|
||||
{
|
||||
$regexfail = constant($regexfail);
|
||||
}
|
||||
if($val == '' && $requiredField)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
$type = $params['user_extended_struct_type'];
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case EUF_DATE :
|
||||
if ($requiredField && ($val == '0000-00-00')) return TRUE;
|
||||
if($requiredField && ($val == '0000-00-00'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if($regex != "" && $val != "")
|
||||
{
|
||||
if(!preg_match($regex, $val)) return $regexfail ? $regexfail : TRUE;
|
||||
if(!preg_match($regex, $val))
|
||||
{
|
||||
return $regexfail ? $regexfail : true;
|
||||
}
|
||||
return FALSE; // Pass by default here
|
||||
}
|
||||
|
||||
return false; // Pass by default here
|
||||
}
|
||||
|
||||
|
||||
@@ -468,7 +493,32 @@ class e107_user_extended
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the field-type of a given field-name.
|
||||
* @param $field
|
||||
* @return bool|int
|
||||
*/
|
||||
public function getFieldType($field)
|
||||
{
|
||||
|
||||
if(!empty($this->fieldAttributes[$field]['type']))
|
||||
{
|
||||
return (int) $this->fieldAttributes[$field]['type'];
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of all field types.
|
||||
* @return array
|
||||
*/
|
||||
public function getFieldTypes()
|
||||
{
|
||||
return $this->user_extended_types;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Return the field creation text for a definition
|
||||
@@ -488,6 +538,10 @@ class e107_user_extended
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
case EUF_COUNTRY :
|
||||
$db_type = 'VARCHAR(2)';
|
||||
break;
|
||||
|
||||
case EUF_INTEGER :
|
||||
$db_type = 'INT(11)';
|
||||
break;
|
||||
@@ -529,7 +583,11 @@ class e107_user_extended
|
||||
{
|
||||
$default_text = '';
|
||||
}
|
||||
|
||||
|
||||
return $db_type.$default_text;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -577,6 +635,7 @@ class e107_user_extended
|
||||
|
||||
if ($this->user_extended_reserved($name))
|
||||
{
|
||||
e107::getMessage()->addDebug("Reserved Field");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -753,6 +812,12 @@ class e107_user_extended
|
||||
|
||||
switch($struct['user_extended_struct_type'])
|
||||
{
|
||||
|
||||
case EUF_COUNTRY:
|
||||
return e107::getForm()->country($fname,$curval);
|
||||
break;
|
||||
|
||||
|
||||
case EUF_TEXT : //textbox
|
||||
case EUF_INTEGER : //integer
|
||||
$ret = "<input id='{$fid}' type='text' name='{$fname}' {$title} value='{$curval}' {$include} {$required} {$placeholder} />";
|
||||
@@ -922,6 +987,11 @@ class e107_user_extended
|
||||
$curval = '';
|
||||
}
|
||||
|
||||
if(THEME_LEGACY === true)
|
||||
{
|
||||
return e107::getForm()->text($fname,$curval,10,array('placeholder'=>'yyyy-mm-dd'));
|
||||
}
|
||||
|
||||
return e107::getForm()->datepicker($fname,$curval,array('format'=>'yyyy-mm-dd','return'=>'string'));
|
||||
break;
|
||||
|
||||
@@ -1155,13 +1225,26 @@ class e107_user_extended
|
||||
* @param $type
|
||||
* @return array|string
|
||||
*/
|
||||
function renderValue($value, $type='')
|
||||
public function renderValue($value, $type=null)
|
||||
{
|
||||
|
||||
|
||||
//TODO FIXME Add more types.
|
||||
|
||||
switch($type)
|
||||
{
|
||||
|
||||
case EUF_COUNTRY:
|
||||
if(!empty($value))
|
||||
{
|
||||
return e107::getForm()->getCountry($value);
|
||||
}
|
||||
|
||||
return null;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case EUF_CHECKBOX:
|
||||
$value = e107::unserialize($value);
|
||||
|
||||
|
@@ -46,7 +46,7 @@ define ('PASSWORD_DEFAULT_TYPE',PASSWORD_E107_MD5);
|
||||
//define ('PASSWORD_DEFAULT_TYPE',PASSWORD_E107_SALT);
|
||||
|
||||
// Required language file - if not loaded elsewhere, uncomment next line
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_user.php');
|
||||
|
||||
class UserHandler
|
||||
{
|
||||
|
@@ -15,7 +15,7 @@
|
||||
/* @DEPRECATED - SUBJECT TO REMOVAL */
|
||||
// Possible replacements: $frm->userpicker();
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php");
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_user_select.php");
|
||||
|
||||
class user_select
|
||||
{
|
||||
|
@@ -21,7 +21,7 @@
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_userclass.php');
|
||||
e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_userclass.php');
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -61,6 +61,8 @@ define("LANG_LAN_141", "Select Script...");
|
||||
define("LANG_LAN_142", "Auto-Detect");
|
||||
define("LANG_LAN_143", "Specific LAN file:");
|
||||
define("LANG_LAN_144", "Must be re-enabled");
|
||||
|
||||
define("LANG_LAN_148", "Normal Mode");
|
||||
define("LANG_LAN_149", "Value");
|
||||
define("LANG_LAN_150", "[b]Search ENTIRE core before commenting out ANY LAN from ANY language file.[/b]");
|
||||
?>
|
||||
|
@@ -280,7 +280,13 @@ define("LAN_HOLD", "Hold");
|
||||
|
||||
define("LAN_MAILOUT_260", "User-Type");
|
||||
define("LAN_MAILOUT_261", "SMTP Port");
|
||||
|
||||
define("LAN_MAILOUT_262", "Template Preview");
|
||||
define("LAN_MAILOUT_263", "Total Recipients");
|
||||
define("LAN_MAILOUT_264", "Embed Media");
|
||||
define("LAN_MAILOUT_265", "Pending");
|
||||
define("LAN_MAILOUT_266", "Max Active");
|
||||
define("LAN_MAILOUT_267", "Generate Public/Private keys");
|
||||
define("LAN_MAILOUT_268", "Developer Mode Only");
|
||||
//define("LAN_SUBMIT", "Do it!"); LAN_RUN
|
||||
|
||||
?>
|
@@ -72,5 +72,5 @@ define("MENLAN_54", "Theme Layout");
|
||||
define("MENLAN_55", "Menu Layout");
|
||||
define("MENLAN_56", "Custom Pages");
|
||||
define("MENLAN_57", "Drag-and-Drop Menus");
|
||||
|
||||
define("MENLAN_58", "The Menu-Manager allows you to place and arrange your menus within your theme template. Hover over the sub-areas to modify existing menu items.");
|
||||
?>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user