function view() { events::observe('save', 'pages', 'settings', 'save'); events::observer(); $settings = settings::get('pages'); f::set($settings); }
function edit() { events::observe('save', 'templates', 'apps', '_save'); events::observer(); $tmpl_file = events::get('tmpl_file'); $app = events::get('app'); if (events::detect('restore')) { self::restoreVersion($app, $tmpl_file, events::get('restore')); } admin::components('tabs', 'validator'); f::set('app', $app); f::set('tmpl_file', $tmpl_file); s::set('app', $app); s::set('tmpl_file', $tmpl_file); $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file; $code = files::get($file); f::set('tmpl_code', $code); self::getApps(); /* Load versions */ db::table('templates_versions'); db::where('app', $app); db::where('tmpl_file', $tmpl_file); db::order('version_date', 'DESC'); $res = db::select(); while ($row = mysql_fetch_assoc($res)) { $row['version_date'] = dt::date2print('%H:%i %d.%m.%Y', $row['version_date']); $row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}'; s::roll('versions', $row); } }
function view() { events::observe('save', 'feedback'); events::observer(); $settings = settings::get('feedback'); f::set($settings); }
function view() { events::observe('save', 'system', 'users', 'saveProfile'); events::observer(); admin::components('validator'); admin::addHeader(' ' . adminUser::get('user_login')); f::set(adminUser::gets()); }
function edit() { events::observe('save', 'news', 'save'); events::observer(); admin::components('validator', 'redactor'); db::table('news'); db::where('news_id', admin::get('id')); $row = db::assoc(); f::set($row); }
function view() { events::observe('save', 'system', 'settings', 'save'); events::observer(true); f::set('system_style', SYS_STYLE); f::set('system_lang', LANG_INDEX); appManage::rollApps(); if (GLOBAL_CACHE === true) { f::set('global_cache', 1); } f::set('global_cache_time', GLOBAL_CACHE_TIME); }
function add() { events::observe('add', 'templates', '_add'); events::observer(); admin::components('tabs', 'validator', 'upload'); appPages::getPagesSelect(ADMIN_SITE_ID); appTemplates::getTmpls(ADMIN_SITE_ID); // test reserved db::table('admin_reserved'); db::where('`table`', 'templates'); db::where('user_id', ADMIN_USER_ID); $tmpl_id = db::get('id'); if (db::rows() == 0) { db::table('templates'); db::smartInsert(array('tmpl_pub' => '2', 'site_id' => ADMIN_SITE_ID)); $tmpl_id = mysql_insert_id(); db::table('templates'); db::where('tmpl_id', $tmpl_id); db::update('tmpl_file', 'tmpl' . $tmpl_id . '.html'); db::table('admin_reserved'); db::insert('', 'templates', $tmpl_id, ADMIN_USER_ID); } f::set('tmpl_id', $tmpl_id); f::set('tmpl_file', 'tmpl' . $tmpl_id . '.html'); }
function addsection() { admin::components('validator'); events::observe('add', 'info', '_addsection'); events::observer(); f::set('section_year', 2009); }
function edit() { events::observe('save', 'menus', '_save'); events::observer(); admin::components('tabs', 'validator'); appPages::getPagesSelect(ADMIN_SITE_ID); appMenus::getMenus(ADMIN_SITE_ID); $menu_id = admin::get('id'); $pages_in = conf::getPagesIn('menus', $menu_id); $pages_out = conf::getPagesOut('menus', $menu_id); if (conf::testPages($pages_in) && conf::testPages($pages_out)) { f::set('allPages', 1); f::set('allPagesOut', 0); } else { if (conf::testPages($pages_in) && !conf::testPages($pages_out)) { f::set('allPages', 0); f::set('allPagesOut', 1); f::set('pages', $pages_out); } else { if (!conf::testPages($pages_in) && !conf::testPages($pages_out)) { f::set('allPages', 0); f::set('allPagesOut', 0); f::set('pages', $pages_in); } else { if (!conf::testPages($pages_in) && conf::testPages($pages_out)) { f::set('allPages', 0); f::set('allPagesOut', 0); f::set('pages', $pages_in); } } } } db::table('menus'); db::where('menu_id', $menu_id); $row = db::assoc(); f::set($row); }
function add() { events::observe('add', 'blocks', '_save'); events::observer(); admin::components('tabs', 'validator'); appPages::getPagesSelect(ADMIN_SITE_ID); appBlocks::getBlocks(ADMIN_SITE_ID); // test reserved db::table('admin_reserved'); db::where('`table`', 'blocks'); db::where('user_id', ADMIN_USER_ID); $block_id = db::get('id'); if (db::rows() == 0) { db::table('blocks'); db::smartInsert(array('block_pub' => '2', 'site_id' => ADMIN_SITE_ID)); $block_id = mysql_insert_id(); db::table('admin_reserved'); db::insert('', 'blocks', $block_id, ADMIN_USER_ID); } f::set('block_id', $block_id); }
function editsection() { $dir = IMAGES_ROOT . 'sections/'; $dir_path = IMAGES_PATH . 'sections/'; admin::components('validator'); events::observe('save', 'catalog', '_savesection'); events::observer(); db::table('catalog_sections'); db::where('section_id', admin::get('id')); $section = db::assoc(); f::set($section); $file = $dir . $section['section_id'] . '.jpg'; if (file_exists($file)) { s::set('section_img', '<img src="' . $dir_path . $section['section_id'] . '.jpg' . '" />'); } }
function add() { events::observe('add', 'pages', 'addPage'); events::observer(); if (events::detect('add')) { return true; } if (events::detect('parent')) { $parent = events::get('parent'); db::table('pages'); db::where('page_id', $parent); db::update('page_child', '1'); f::set('page_parent', $parent); } admin::components('tabs', 'validator', 'upload'); if (settings::get('pages', 'redactor')) { admin::components('redactor'); s::section('redactor'); } appPages::getPagesSelect(ADMIN_SITE_ID); appPages::getParentPages(ADMIN_SITE_ID, true); appTemplates::getTmpls(ADMIN_SITE_ID); // test reserved db::table('admin_reserved'); db::where('`table`', 'pages'); db::where('user_id', ADMIN_USER_ID); $page_id = db::get('id'); if (db::rows() == 0) { db::table('pages'); $array = array('page_date' => 'NOW()', 'page_pub' => '2', 'page_handler' => '0', 'page_dynamic' => '0', 'page_cache' => '0', 'page_map' => '0', 'page_child' => '0', 'page_level' => 0, 'site_id' => ADMIN_SITE_ID); db::smartInsert($array); $page_id = mysql_insert_id(); db::table('admin_reserved'); db::insert('', 'pages', $page_id, ADMIN_USER_ID); } f::set('page_id', $page_id); }
function editGroup() { events::observe('save', 'system', 'users', '_saveGroup'); events::observer(); admin::components('validator'); $check = self::loadGroupSetups(); $array = ini::parse(SYS_ROOT . 'conf/admin/groups.ini', admin::get('id')); f::set('group_name', $array['name']); f::set('rule', $array['rule']); f::set('group_id', admin::get('id')); f::set('start_app', $array['start_app']); if ($array['apps'] == '0') { f::set('all_apps', 1); f::set('app', $check['apps']); } else { $arr = explode(',', $array['apps']); $arr_t = array(); foreach ($arr as $v) { $arr_t[$v] = 1; } f::set('app', $arr_t); } if ($array['sites'] == '0') { f::set('all_sites', 1); f::set('site_id', $check['sites']); } else { $arr = explode(',', $array['sites']); $arr_t = array(); foreach ($arr as $v) { $arr_t[$v] = 1; } f::set('site_id', $arr_t); } }