|
|
|
@@ -31,14 +31,14 @@ include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
|
|
|
|
|
|
|
|
|
$e_sub_cat = 'custom';
|
|
|
|
|
|
|
|
|
|
require_once('auth.php');
|
|
|
|
|
require_once(e_HANDLER.'userclass_class.php');
|
|
|
|
|
require_once(e_HANDLER.'message_handler.php');
|
|
|
|
|
require_once(e_HANDLER.'form_handler.php');
|
|
|
|
|
$frm = new e_form(true);
|
|
|
|
|
$emessage = &eMessage::getInstance();
|
|
|
|
|
$page = new page;
|
|
|
|
|
$emessage = eMessage::getInstance();
|
|
|
|
|
// $page = new page;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if (e_QUERY)
|
|
|
|
|
{
|
|
|
|
|
$tmp = explode(".", e_QUERY);
|
|
|
|
@@ -47,36 +47,13 @@ if (e_QUERY)
|
|
|
|
|
$id = intval(varset($tmp[2], 0));
|
|
|
|
|
$from = intval(varset($tmp[3], 0));
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['submitPage']))
|
|
|
|
|
{
|
|
|
|
|
$page->submitPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['uploadfiles']))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
$page->uploadPage();
|
|
|
|
|
$id = intval(varset($_POST['pe_id'], 0));
|
|
|
|
|
$sub_action = ($_POST['pe_id']) ? "edit" : "";
|
|
|
|
|
$page->createPage($_POST['mode']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['submitMenu']))
|
|
|
|
|
{
|
|
|
|
|
$page->submitPage("", TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['updateMenu']))
|
|
|
|
|
{
|
|
|
|
|
$page->submitPage($_POST['pe_id'], TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['updatePage']))
|
|
|
|
|
{
|
|
|
|
|
$page->submitPage($_POST['pe_id']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if(isset($_POST['delete']) || varset($_POST['etrigger_delete']))
|
|
|
|
|
{
|
|
|
|
|
if($_POST['etrigger_delete'])
|
|
|
|
@@ -93,12 +70,10 @@ if(isset($_POST['delete']) || varset($_POST['etrigger_delete']))
|
|
|
|
|
$page->delete_page($pid);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
if (isset($_POST['saveOptions']))
|
|
|
|
|
{
|
|
|
|
|
$page->saveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
if(!e_QUERY)
|
|
|
|
|
{
|
|
|
|
|
if(getperms('5'))
|
|
|
|
@@ -129,144 +104,176 @@ else
|
|
|
|
|
$function = $action.'Page';
|
|
|
|
|
$page->$function();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
require_once(e_ADMIN.'footer.php');
|
|
|
|
|
|
|
|
|
|
// FIXME - add page link to sitelinks is completely disabled as current implementation is not reliable (+ is obsolete and generates sql error)
|
|
|
|
|
class page
|
|
|
|
|
{
|
|
|
|
|
var $fields;
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function page()
|
|
|
|
|
|
|
|
|
|
class page_admin extends e_admin_dispatcher
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
global $pref,$user_pref, $admin_log;
|
|
|
|
|
if(isset($_POST['etrigger_ecolumns']))
|
|
|
|
|
{
|
|
|
|
|
$user_pref['admin_cpage_columns'] = $_POST['e-columns'];
|
|
|
|
|
save_prefs('user');
|
|
|
|
|
protected $modes = array(
|
|
|
|
|
'main' => array(
|
|
|
|
|
'controller' => 'page_admin_ui',
|
|
|
|
|
'path' => null,
|
|
|
|
|
'ui' => 'page_admin_form_ui',
|
|
|
|
|
'uipath' => null
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected $adminMenu = array(
|
|
|
|
|
'main/list' => array('caption'=> CUSLAN_48, 'perm' => '5'),
|
|
|
|
|
'main/menus' => array('caption'=> CUSLAN_49, 'perm' => 'J'),
|
|
|
|
|
'main/create' => array('caption'=> CUSLAN_12, 'perm' => '5'),
|
|
|
|
|
'main/createem' => array('caption'=> CUSLAN_31, 'perm' => 'J'),
|
|
|
|
|
'main/options' => array('caption'=> LAN_OPTIONS, 'perm' => '0')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected $adminMenuAliases = array(
|
|
|
|
|
'main/edit' => 'main/list'
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
protected $menuTitle = 'Custom Pages';
|
|
|
|
|
}
|
|
|
|
|
$this->fieldpref = (varset($user_pref['admin_cpage_columns'])) ? $user_pref['admin_cpage_columns'] : array("page_id","page_title","page_theme"); ;
|
|
|
|
|
|
|
|
|
|
$this->fields = array(
|
|
|
|
|
class page_admin_form_ui extends e_admin_form_ui
|
|
|
|
|
{
|
|
|
|
|
/*public function faq_info_parent($curVal,$mode)
|
|
|
|
|
{
|
|
|
|
|
// TODO - catlist combo without current cat ID in write mode, parents only for batch/filter
|
|
|
|
|
// Get UI instance
|
|
|
|
|
$controller = $this->getController();
|
|
|
|
|
switch($mode)
|
|
|
|
|
{
|
|
|
|
|
case 'read':
|
|
|
|
|
return e107::getParser()->toHTML($controller->getFaqCategoryTree($curVal), false, 'TITLE');
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'write':
|
|
|
|
|
return $this->selectbox('faq_info_parent', $controller->getFaqCategoryTree(), $curVal);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'filter':
|
|
|
|
|
case 'batch':
|
|
|
|
|
return $controller->getFaqCategoryTree();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class page_admin_ui extends e_admin_ui
|
|
|
|
|
{
|
|
|
|
|
protected $pluginTitle = ADLAN_42;
|
|
|
|
|
protected $pluginName = 'core';
|
|
|
|
|
protected $table = "page";
|
|
|
|
|
|
|
|
|
|
protected $listQry = "SELECT 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.page_theme = '' "; // without any Order or Limit.
|
|
|
|
|
//protected $editQry = "SELECT * FROM #comments WHERE comment_id = {ID}";
|
|
|
|
|
|
|
|
|
|
protected $pid = "page_id";
|
|
|
|
|
protected $listOrder = 'p.page_id desc';
|
|
|
|
|
protected $perPage = 10;
|
|
|
|
|
protected $batchDelete = true;
|
|
|
|
|
protected $batchCopy = true;
|
|
|
|
|
|
|
|
|
|
protected $fields = array(
|
|
|
|
|
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
|
|
|
|
|
'page_id' => array('title'=> 'ID', 'width'=>'5%', 'forced'=> TRUE),
|
|
|
|
|
'page_title' => array('title'=> CUSLAN_1, 'type' => 'text', 'width'=>'auto'),
|
|
|
|
|
'page_theme' => array('title'=> CUSLAN_2, 'type' => 'text', 'width' => 'auto','nolist'=>true),
|
|
|
|
|
'page_template' => array('title'=> 'Template', 'type' => 'text', 'width' => 'auto'),
|
|
|
|
|
'page_author' => array('title'=> LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'),
|
|
|
|
|
'page_author' => array('title'=> LAN_AUTHOR, 'type' => 'user', 'width' => 'auto', 'thclass' => 'left'),
|
|
|
|
|
'page_datestamp' => array('title'=> LAN_DATE, 'type' => 'datestamp', 'width' => 'auto'),
|
|
|
|
|
'page_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass', 'width' => 'auto'),
|
|
|
|
|
'page_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass', 'width' => 'auto', 'filter' => true, 'batch' => true),
|
|
|
|
|
'page_rating_flag' => array('title'=> LAN_RATING, 'type' => 'boolean', 'width' => '10%', 'thclass' => 'center', 'class' => 'center' ),
|
|
|
|
|
'page_comment_flag' => array('title'=> ADLAN_114, 'type' => 'boolean', 'width' => '10%', 'thclass' => 'center', 'class' => 'center' ),
|
|
|
|
|
// 'page_password' => array('title'=> LAN_USER_05, 'type' => 'text', 'width' => 'auto'),
|
|
|
|
|
|
|
|
|
|
// 'page_ip_restrict' => array('title'=> LAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar
|
|
|
|
|
|
|
|
|
|
'options' => array('title'=> LAN_OPTIONS, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center')
|
|
|
|
|
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// $this->fieldpref = array("page_id","page_title","page_author","page_class");
|
|
|
|
|
protected $fieldpref = array("page_id","page_title","page_template","page_author","page_class");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function init()
|
|
|
|
|
{
|
|
|
|
|
//FIX ME - mode not retained after using drop-down 'filter' or 'search'.
|
|
|
|
|
if($_GET['mode'] =='main' && $_GET['action'] =='menus')
|
|
|
|
|
{
|
|
|
|
|
$this->listQry = "SELECT 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.page_theme != '' "; // without any Order or Limit.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
if(isset($_POST['uploadfiles']))
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
function menusPage()
|
|
|
|
|
$this->uploadPage();
|
|
|
|
|
$id = intval(varset($_POST['pe_id'], 0));
|
|
|
|
|
$sub_action = ($_POST['pe_id']) ? "edit" : "";
|
|
|
|
|
$this->createPage($_POST['mode']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isset($_POST['saveOptions']))
|
|
|
|
|
{
|
|
|
|
|
$this->saveSettings();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['submitPage']))
|
|
|
|
|
{
|
|
|
|
|
$this->submitPage();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['submitMenu']))
|
|
|
|
|
{
|
|
|
|
|
$this->submitPage("", TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['updateMenu']))
|
|
|
|
|
{
|
|
|
|
|
$this->submitPage($_POST['pe_id'], TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(isset($_POST['updatePage']))
|
|
|
|
|
{
|
|
|
|
|
$this->submitPage($_POST['pe_id']);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Create Menu Page.
|
|
|
|
|
function createemPage()
|
|
|
|
|
{
|
|
|
|
|
if(!getperms("J")){ return; }
|
|
|
|
|
return $this->showExistingPages('menus');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function showExistingPages($mode=FALSE)
|
|
|
|
|
{
|
|
|
|
|
global $sql, $e107, $emessage, $frm, $pref;
|
|
|
|
|
|
|
|
|
|
$text = "<form method='post' action='".e_SELF."?".e_QUERY."'>
|
|
|
|
|
<fieldset id='core-cpage-list'>
|
|
|
|
|
<legend class='e-hideme'>".CUSLAN_5."</legend>
|
|
|
|
|
<table cellpadding='0' cellspacing='0' class='adminlist'>".
|
|
|
|
|
$frm->colGroup($this->fields,$this->fieldpref).
|
|
|
|
|
$frm->thead($this->fields,$this->fieldpref).
|
|
|
|
|
|
|
|
|
|
"<tbody>";
|
|
|
|
|
|
|
|
|
|
if($mode=='menus')
|
|
|
|
|
{
|
|
|
|
|
$qry = "page_theme !='' ";
|
|
|
|
|
$caption = CUSLAN_50;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(!getperms("5")){ return; }
|
|
|
|
|
$qry = "page_theme ='' ";
|
|
|
|
|
$caption = CUSLAN_5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!$sql->db_Select("page", "*", $qry." ORDER BY page_datestamp DESC"))
|
|
|
|
|
{
|
|
|
|
|
$text .= "
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan='4' class='center middle'>
|
|
|
|
|
".CUSLAN_42."
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$pages = $sql->db_getList('ALL', FALSE, FALSE);
|
|
|
|
|
|
|
|
|
|
foreach($pages as $pge)
|
|
|
|
|
{
|
|
|
|
|
$title_text = $pge['page_title'] ? $pge['page_title'] : ($pge['page_theme'] ? CUSLAN_43.$pge['page_theme'] : CUSLAN_44);
|
|
|
|
|
$pge['page_title'] = "<a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e107::getUrl()->create('page/view', $pge, 'allow=page_id,page_sef'))."'>{$title_text}</a>";
|
|
|
|
|
$authorData = get_user_data($pge['page_author']);
|
|
|
|
|
$pge['page_author'] = varset($authorData['user_name'], '?');
|
|
|
|
|
|
|
|
|
|
$text .= $frm->renderTableRow($this->fields,$this->fieldpref,$pge,'page_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$text .= "
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
$e107->ns->tablerender($caption, $emessage->render().$text);
|
|
|
|
|
$this->createPage('menu');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function createmPage()
|
|
|
|
|
{
|
|
|
|
|
$this->createPage(TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function uploadPage()
|
|
|
|
|
{
|
|
|
|
|
global $pref;
|
|
|
|
|
$pref['upload_storagetype'] = "1";
|
|
|
|
|
require_once(e_HANDLER."upload_handler.php");
|
|
|
|
|
$uploaded = file_upload(e_IMAGE."custom/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create Page Page.
|
|
|
|
|
function createPage($mode=FALSE)
|
|
|
|
|
{
|
|
|
|
|
/* mode: FALSE == page, mode: TRUE == menu */
|
|
|
|
|
|
|
|
|
|
global $e107, $sub_action, $id, $e_userclass, $e_event;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $e107, $e_userclass, $e_event;
|
|
|
|
|
|
|
|
|
|
$frm = e107::getForm();
|
|
|
|
|
$sql = e107::getDb();
|
|
|
|
|
$tp = e107::getParser();
|
|
|
|
|
$ns = e107::getRender();
|
|
|
|
|
$mes = e107::getMessage();
|
|
|
|
|
|
|
|
|
|
$id = intval($_GET['id']);
|
|
|
|
|
$sub_action = $_GET['action'];
|
|
|
|
|
|
|
|
|
|
$edit = ($sub_action == 'edit');
|
|
|
|
|
$caption =(!$mode ? ($edit ? CUSLAN_23 : CUSLAN_24) : ($edit ? CUSLAN_25 : CUSLAN_26));
|
|
|
|
@@ -509,16 +516,97 @@ class page
|
|
|
|
|
</form>
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
$ns->tablerender($caption, $text);
|
|
|
|
|
// $ns->tablerender($caption, $text);
|
|
|
|
|
|
|
|
|
|
echo $mes->render().$text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function optionsPage()
|
|
|
|
|
{
|
|
|
|
|
global $e107, $pref;
|
|
|
|
|
|
|
|
|
|
$ns = e107::getRender();
|
|
|
|
|
$mes = e107::getMessage();
|
|
|
|
|
$frm = e107::getForm();
|
|
|
|
|
$sql = e107::getDb();
|
|
|
|
|
$tp = e107::getParser();
|
|
|
|
|
|
|
|
|
|
if(!isset($pref['pageCookieExpire'])) $pref['pageCookieExpire'] = 84600;
|
|
|
|
|
|
|
|
|
|
//XXX Lan - Options
|
|
|
|
|
$text = "
|
|
|
|
|
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
|
|
|
|
<fieldset id='core-cpage-options'>
|
|
|
|
|
<legend class='e-hideme'>".LAN_OPTIONS."</legend>
|
|
|
|
|
<table cellpadding='0' cellspacing='0' class='adminform'>
|
|
|
|
|
<colgroup span='2'>
|
|
|
|
|
<col class='col-label' />
|
|
|
|
|
<col class='col-control' />
|
|
|
|
|
</colgroup>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class='label'>".CUSLAN_29."</td>
|
|
|
|
|
<td class='control'>
|
|
|
|
|
".$frm->radio_switch('listPages', $pref['listPages'])."
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class='label'>".CUSLAN_30."</td>
|
|
|
|
|
<td class='control'>
|
|
|
|
|
".$frm->text('pageCookieExpire', $pref['pageCookieExpire'], 10)."
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<div class='buttons-bar center'>
|
|
|
|
|
".$frm->admin_button('saveOptions', CUSLAN_40, 'submit')."
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
//$ns->tablerender(LAN_OPTIONS, $mes->render().$text);
|
|
|
|
|
echo $mes->render().$text;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function saveSettings()
|
|
|
|
|
{
|
|
|
|
|
global $pref, $admin_log, $emessage;
|
|
|
|
|
$temp['listPages'] = $_POST['listPages'];
|
|
|
|
|
$temp['pageCookieExpire'] = $_POST['pageCookieExpire'];
|
|
|
|
|
if ($admin_log->logArrayDiffs($temp, $pref, 'CPAGE_04'))
|
|
|
|
|
{
|
|
|
|
|
save_prefs(); // Only save if changes
|
|
|
|
|
$emessage->add(LAN_SETSAVED, E_MESSAGE_SUCCESS);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$emessage->add(LAN_NOCHANGE_NOTSAVED);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Write new/edited page/menu to the DB
|
|
|
|
|
// $mode - zero for new page, page id for existing
|
|
|
|
|
// $type = FALSE for page, TRUE for menu
|
|
|
|
|
function submitPage($mode = FALSE, $type=FALSE)
|
|
|
|
|
{
|
|
|
|
|
global $sql, $tp, $e107cache, $admin_log, $e_event;
|
|
|
|
|
|
|
|
|
|
global $e107cache, $admin_log, $e_event;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$frm = e107::getForm();
|
|
|
|
|
$sql = e107::getDb();
|
|
|
|
|
$tp = e107::getParser();
|
|
|
|
|
$ns = e107::getRender();
|
|
|
|
|
$mes = e107::getMessage();
|
|
|
|
|
|
|
|
|
|
$page_title = $tp->toDB($_POST['page_title']);
|
|
|
|
|
$page_text = $tp->toDB($_POST['data']);
|
|
|
|
@@ -580,7 +668,7 @@ class page
|
|
|
|
|
$status = $sql -> db_Update("page", "page_title='{$page_title}', page_sef='{$page_sef}', page_metakeys='{$page_metak}', page_metadscr='{$page_metad}', page_text='{$page_text}', page_datestamp='".time()."', page_author='{$pauthor}', page_rating_flag='".intval($_POST['page_rating_flag'])."', page_comment_flag='".intval($_POST['page_comment_flag'])."', page_password='".$_POST['page_password']."', page_class='".$_POST['page_class']."', page_ip_restrict='".varset($_POST['page_ip_restrict'],'')."', page_template='".$_POST['page_template']."' {$menuname} WHERE page_id='{$mode}'") ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
|
|
|
|
if ($status == E_MESSAGE_SUCCESS) $update++;
|
|
|
|
|
|
|
|
|
|
$mes = e107::getMessage();
|
|
|
|
|
|
|
|
|
|
$mes->add($message, $status);
|
|
|
|
|
|
|
|
|
|
$admin_log->log_event('CPAGE_02',$mode.'[!br!]'.$page_title.'[!br!]'.$pauthor,E_LOG_INFORMATIVE,'');
|
|
|
|
@@ -628,6 +716,8 @@ class page
|
|
|
|
|
$e107cache->clear("sitelinks");
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin_update($update, 'update', LAN_UPDATED, false, false); // Display result of update
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@@ -684,8 +774,150 @@ class page
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function uploadPage()
|
|
|
|
|
{
|
|
|
|
|
global $pref;
|
|
|
|
|
$pref['upload_storagetype'] = "1";
|
|
|
|
|
require_once(e_HANDLER."upload_handler.php");
|
|
|
|
|
$uploaded = file_upload(e_IMAGE."custom/");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
require_once('auth.php');
|
|
|
|
|
new page_admin();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
e107::getAdminUI()->runPage();
|
|
|
|
|
|
|
|
|
|
require_once(e_ADMIN.'footer.php');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME - add page link to sitelinks is completely disabled as current implementation is not reliable (+ is obsolete and generates sql error)
|
|
|
|
|
class page
|
|
|
|
|
{
|
|
|
|
|
var $fields;
|
|
|
|
|
|
|
|
|
|
// DEPRECATED
|
|
|
|
|
function page()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
global $pref,$user_pref, $admin_log;
|
|
|
|
|
if(isset($_POST['etrigger_ecolumns']))
|
|
|
|
|
{
|
|
|
|
|
$user_pref['admin_cpage_columns'] = $_POST['e-columns'];
|
|
|
|
|
save_prefs('user');
|
|
|
|
|
}
|
|
|
|
|
$this->fieldpref = (varset($user_pref['admin_cpage_columns'])) ? $user_pref['admin_cpage_columns'] : array("page_id","page_title","page_theme"); ;
|
|
|
|
|
|
|
|
|
|
$this->fields = array(
|
|
|
|
|
'page_id' => array('title'=> 'ID', 'width'=>'5%', 'forced'=> TRUE),
|
|
|
|
|
'page_title' => array('title'=> CUSLAN_1, 'type' => 'text', 'width'=>'auto'),
|
|
|
|
|
'page_theme' => array('title'=> CUSLAN_2, 'type' => 'text', 'width' => 'auto','nolist'=>true),
|
|
|
|
|
'page_template' => array('title'=> 'Template', 'type' => 'text', 'width' => 'auto'),
|
|
|
|
|
'page_author' => array('title'=> LAN_AUTHOR, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'),
|
|
|
|
|
'page_datestamp' => array('title'=> LAN_DATE, 'type' => 'datestamp', 'width' => 'auto'),
|
|
|
|
|
'page_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass', 'width' => 'auto', 'filter' => true, 'batch' => true,),
|
|
|
|
|
'page_rating_flag' => array('title'=> LAN_RATING, 'type' => 'boolean', 'width' => '10%', 'thclass' => 'center', 'class' => 'center' ),
|
|
|
|
|
'page_comment_flag' => array('title'=> ADLAN_114, 'type' => 'boolean', 'width' => '10%', 'thclass' => 'center', 'class' => 'center' ),
|
|
|
|
|
// 'page_password' => array('title'=> LAN_USER_05, 'type' => 'text', 'width' => 'auto'),
|
|
|
|
|
|
|
|
|
|
// 'page_ip_restrict' => array('title'=> LAN_USER_07, 'type' => 'text', 'width' => 'auto'), // Avatar
|
|
|
|
|
|
|
|
|
|
'options' => array('title'=> LAN_OPTIONS, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center')
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// $this->fieldpref = array("page_id","page_title","page_author","page_class");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
// DEPRECATED
|
|
|
|
|
/*
|
|
|
|
|
function menusPage()
|
|
|
|
|
{
|
|
|
|
|
if(!getperms("J")){ return; }
|
|
|
|
|
return $this->showExistingPages('menus');
|
|
|
|
|
}
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
|
/*
|
|
|
|
|
function showExistingPages($mode=FALSE)
|
|
|
|
|
{
|
|
|
|
|
global $sql, $e107, $emessage, $frm, $pref;
|
|
|
|
|
|
|
|
|
|
$text = "<form method='post' action='".e_SELF."?".e_QUERY."'>
|
|
|
|
|
<fieldset id='core-cpage-list'>
|
|
|
|
|
<legend class='e-hideme'>".CUSLAN_5."</legend>
|
|
|
|
|
<table cellpadding='0' cellspacing='0' class='adminlist'>".
|
|
|
|
|
$frm->colGroup($this->fields,$this->fieldpref).
|
|
|
|
|
$frm->thead($this->fields,$this->fieldpref).
|
|
|
|
|
|
|
|
|
|
"<tbody>";
|
|
|
|
|
|
|
|
|
|
if($mode=='menus')
|
|
|
|
|
{
|
|
|
|
|
$qry = "page_theme !='' ";
|
|
|
|
|
$caption = CUSLAN_50;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(!getperms("5")){ return; }
|
|
|
|
|
$qry = "page_theme ='' ";
|
|
|
|
|
$caption = CUSLAN_5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!$sql->db_Select("page", "*", $qry." ORDER BY page_datestamp DESC"))
|
|
|
|
|
{
|
|
|
|
|
$text .= "
|
|
|
|
|
<tr>
|
|
|
|
|
<td colspan='4' class='center middle'>
|
|
|
|
|
".CUSLAN_42."
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$pages = $sql->db_getList('ALL', FALSE, FALSE);
|
|
|
|
|
|
|
|
|
|
foreach($pages as $pge)
|
|
|
|
|
{
|
|
|
|
|
$title_text = $pge['page_title'] ? $pge['page_title'] : ($pge['page_theme'] ? CUSLAN_43.$pge['page_theme'] : CUSLAN_44);
|
|
|
|
|
$pge['page_title'] = "<a href='".($pge['page_theme'] ? e_ADMIN."menus.php" : e107::getUrl()->create('page/view', $pge, 'allow=page_id,page_sef'))."'>{$title_text}</a>";
|
|
|
|
|
$authorData = get_user_data($pge['page_author']);
|
|
|
|
|
$pge['page_author'] = varset($authorData['user_name'], '?');
|
|
|
|
|
|
|
|
|
|
$text .= $frm->renderTableRow($this->fields,$this->fieldpref,$pge,'page_id');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$text .= "
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
$e107->ns->tablerender($caption, $emessage->render().$text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// DEPRECATED
|
|
|
|
|
function delete_page($del_id)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
global $sql, $e107cache, $admin_log, $e_event;
|
|
|
|
|
//if(!$sql->db_Select('page', '*', "page_id={$del_id}")) return;
|
|
|
|
|
//$row = $sql->db_Fetch();
|
|
|
|
@@ -707,51 +939,8 @@ class page
|
|
|
|
|
$this->message = $e_event->triggerHook($data);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function optionsPage()
|
|
|
|
|
{
|
|
|
|
|
global $e107, $pref, $frm, $emessage;
|
|
|
|
|
|
|
|
|
|
$ns = e107::getRender();
|
|
|
|
|
|
|
|
|
|
if(!isset($pref['pageCookieExpire'])) $pref['pageCookieExpire'] = 84600;
|
|
|
|
|
|
|
|
|
|
//XXX Lan - Options
|
|
|
|
|
$text = "
|
|
|
|
|
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
|
|
|
|
<fieldset id='core-cpage-options'>
|
|
|
|
|
<legend class='e-hideme'>".LAN_OPTIONS."</legend>
|
|
|
|
|
<table cellpadding='0' cellspacing='0' class='adminform'>
|
|
|
|
|
<colgroup span='2'>
|
|
|
|
|
<col class='col-label' />
|
|
|
|
|
<col class='col-control' />
|
|
|
|
|
</colgroup>
|
|
|
|
|
<tbody>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class='label'>".CUSLAN_29."</td>
|
|
|
|
|
<td class='control'>
|
|
|
|
|
".$frm->radio_switch('listPages', $pref['listPages'])."
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
|
<td class='label'>".CUSLAN_30."</td>
|
|
|
|
|
<td class='control'>
|
|
|
|
|
".$frm->text('pageCookieExpire', $pref['pageCookieExpire'], 10)."
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
<div class='buttons-bar center'>
|
|
|
|
|
".$frm->admin_button('saveOptions', CUSLAN_40, 'submit')."
|
|
|
|
|
</div>
|
|
|
|
|
</fieldset>
|
|
|
|
|
</form>
|
|
|
|
|
";
|
|
|
|
|
|
|
|
|
|
$ns->tablerender(LAN_OPTIONS, $emessage->render().$text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
function saveSettings()
|
|
|
|
|
{
|
|
|
|
|
global $pref, $admin_log, $emessage;
|
|
|
|
@@ -803,8 +992,10 @@ class page
|
|
|
|
|
|
|
|
|
|
e_admin_menu(CUSLAN_33, $action, $var);
|
|
|
|
|
}
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function cpage_adminmenu()
|
|
|
|
|
{
|
|
|
|
|
global $page;
|
|
|
|
@@ -819,6 +1010,7 @@ function cpage_adminmenu()
|
|
|
|
|
*/
|
|
|
|
|
function headerjs()
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
require_once(e_HANDLER.'js_helper.php');
|
|
|
|
|
$ret = "
|
|
|
|
|
<script type='text/javascript'>
|
|
|
|
|