本文整理汇总了PHP中admin::get方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::get方法的具体用法?PHP admin::get怎么用?PHP admin::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::get方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
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);
}
示例2: edit
function edit()
{
events::observe('save', 'templates', '_edit');
events::observer();
if (events::detect('restore')) {
self::restoreVersion(events::get('restore'));
}
admin::components('tabs', 'validator', 'upload');
appPages::getPagesSelect(ADMIN_SITE_ID);
appTemplates::getTmpls(ADMIN_SITE_ID);
$tmpl_id = admin::get('id');
db::table('templates');
db::where('tmpl_id', $tmpl_id);
$row = db::assoc();
f::set($row);
$file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $row['tmpl_file'];
f::set('tmpl_code', files::get($file));
db::table('pages');
db::where('tmpl_id', $tmpl_id);
$res = db::select();
$pages = array();
while ($row = mysql_fetch_assoc($res)) {
$pages[$row['page_id']] = $row['page_id'];
}
if ($pages) {
f::set('allPages', 0);
f::set('pages', $pages);
}
/*
Load versions
*/
db::table('templates_versions');
db::where('tmpl_id', $tmpl_id);
db::order('version_date', 'DESC');
$res = db::select();
while ($row = mysql_fetch_assoc($res)) {
$row['version_date'] = dt::date2print('%H:%i:%s %d.%m.%Y', $row['version_date']);
$row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}';
s::roll('versions', $row);
}
}
示例3: editsection
function editsection()
{
admin::components('validator');
events::observe('save', 'info', '_savesection');
events::observer();
db::table('info_sections');
db::where('section_id', admin::get('id'));
$section = db::assoc();
f::set($section);
}
示例4: edit
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);
}
示例5: editsection
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' . '" />');
}
}
示例6: edit
function edit()
{
events::observe('save', 'pages', 'savePage');
events::observer();
if (events::detect('save')) {
return true;
}
if (events::detect('restore')) {
self::restoreVersion(events::get('restore'));
}
admin::components('tabs', 'validator', 'upload');
if (settings::get('pages', 'redactor')) {
admin::components('redactor');
s::section('redactor');
}
$page_id = admin::get('id');
appPages::getPagesSelect(ADMIN_SITE_ID, $page_id);
appPages::getParentPages(ADMIN_SITE_ID, true);
appTemplates::getTmpls(ADMIN_SITE_ID);
db::table('pages');
db::where('page_id', $page_id);
$row = db::assoc();
s::set('page_link', '<a href="' . self::getUrl($row['page_folder']) . '">Посмотреть страницу на сайте</a>');
if ($row['page_dynamic'] == '1') {
$row['page_folder'] = '';
} else {
if ($row['page_folder'] != '/') {
$row['page_folder'] = string::clearBoth($row['page_folder']);
$arr = explode('/', $row['page_folder']);
$row['page_folder'] = arrays::lastValue($arr);
}
}
f::set('page_content', $row['page_content'], 0);
f::set($row);
s::set('page_id', $page_id);
db::table('pages_files');
db::where('page_id', $page_id);
$r = db::select();
while ($a = mysql_fetch_assoc($r)) {
$a['file_type'] = files::getFileIco($a['file_type']);
s::roll('page_files', $a);
}
/*
Load versions
*/
db::table('pages_versions');
db::where('page_id', $page_id);
db::order('version_date', 'DESC');
$res = db::select();
$versions = array();
while ($row = mysql_fetch_assoc($res)) {
$versions[$row['version_date']][$row['content_id']] = array('version_id' => $row['version_id'], 'content_id' => $row['content_id'], 'version_content' => $row['version_content']);
}
foreach ($versions as $k => $v) {
s::roll('versions', array('date' => dt::date2print('%H:%i:%s %d.%m.%Y', $k), 'version_date' => $k, 'id' => md5($k)));
foreach ($v as $d => $f) {
$f['version_content'] = htmlspecialchars('{non}' . $f['version_content'] . '{/non}');
s::roll('versions_' . md5($k), $f);
}
}
}
示例7: editGroup
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);
}
}