Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8 [1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560 [2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85 [3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50 [4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13 [5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
| Server IP : 94.177.8.99 / Your IP : 216.73.217.165 Web Server : Apache/2.4.58 (Ubuntu) System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64 User : www-data ( 33) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/theyoungdesigners_com/modules/pageFooter/controller/ |
Upload File : |
<?php
class pageFooter_admin extends Controller {
var $model_menuedit;
public function __construct() {
parent::__construct(dirname(__DIR__));
}
public function __Register() {
$this->RegisterView(__CLASS__ .'::menus', ['pagefooter_view' => ['menuedit', 'menuedit_detail']]);
}
/** staff */
public function menus($action = '', $param1 = '', $param2 = '') {
$result = $this->DefaultResult(__METHOD__);
$this->model_menuedit = $this->LoadModel('menuedit_model');
switch($action) {
case 'load':
$dynamic = hook_execute('cms.dynamic.get', []);
return $this->model_menuedit->LoadMenus($dynamic);
case 'save':
if ($this->isPost) {
// get the session stuff
$page = $this->post('page', ''); // what overrides do we have?
$auth = isset($_POST['auth']) ? $_POST['auth'] : '';
unset($_POST['auth']);
$valid = hook_execute('nonce.verify', FALSE, 'menuedit', FALSE, $auth);
if ($valid == '') {
return $this->model_menuedit->SaveMenus($_POST, $page);
} else { // not authorized
$result['result'] = 92151;
$result['message'] = 'You are not authorized to access this function';
return $result;
}
}
// this is to edit an existing menu item
case 'custom':
$auth = isset($_POST['auth']) ? $_POST['auth'] : '';
$valid = hook_execute('nonce.verify', FALSE, 'menuedit', FALSE, $auth);
if (is_string($valid)) {
[$active, $idx] = explode(':', $valid);
$id = trim($this->post('id', ''));
$page = trim($this->post('page', ''));
$caption = trim($this->post('caption', ''));
if ($active == 'source') { // this is to add a new item to the right-side menu
return $this->model_menuedit->UpdateCustomMenu($id, $caption);
} else {
$data = [
'active' => $active,
'index' => $idx,
'id' => $id,
'caption' => $caption,
'initial' => trim($this->post('initial', '')),
'default' => (int) trim($this->post('default', '0')),
'link' => trim($this->post('link', '')),
];
$_SESSION['page']["$active:$idx"] = $data;
// return html to update the grid
$title = $data['default'] ? $data['initial'] : $data['caption'];
return [
'html' => [
[
'field' => "{$data['active']}_{$data['index']} .me-caption",
'value' => $title,
'title' => $title,
'href' => $data['link'],
],
],
'data' => $data
];
}
} else {
return [
'result' => 92153,
'message' => 'You are not authorized to access this function',
];
}
case 'delete':
$id = isset($_GET['id']) ? trim($_GET['id']) : '';
return $this->model_menuedit->RemoveCustomMenu($id);
case 'edit':
$dynamic = hook_execute('cms.dynamic.get', []);
$param = [
'caption' => isset($_GET['caption']) ? trim($_GET['caption']) : '',
'href' => isset($_GET['href']) ? trim($_GET['href']) : '',
'flags' => isset($_GET['flags']) ? intval($_GET['flags']) : 0,
'idx' => isset($_GET['idx']) ? intval($_GET['idx']) : -1,
'active' => isset($_GET['active']) ? trim($_GET['active']) : '',
'id' => isset($_GET['id']) ? trim($_GET['id']) : '',
'page' => isset($_GET['page']) ? trim($_GET['page']) : '',
];
return $this->model_menuedit->getEditPopup($result, $param, $dynamic);
}
$result['auth'] = hook_execute('nonce.create', FALSE, 'menuedit', '', 15 * 60);
$result['page'] = \Misc::uuid4();
$result['template'] = 'menuedit';
return $result;
}
}