本文整理汇总了PHP中admin::components方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::components方法的具体用法?PHP admin::components怎么用?PHP admin::components使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::components方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
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);
}
}
示例2: cache
function cache()
{
admin::components('shiftable');
db::table('pages');
db::where('site_id', ADMIN_SITE_ID);
db::where('page_pub', '2', '!=');
db::order('page_map');
$res = db::select();
while ($row = mysql_fetch_assoc($res)) {
if ($row['page_cache'] == '1') {
$row['page_cache'] = ' checked="checked"';
} else {
$row['page_cache'] = '';
}
if ($row['page_folder'] == '/') {
$page_path = 'http://' . ADMIN_SITE;
} else {
$page_path = 'http://' . ADMIN_SITE . '' . $row['page_folder'];
}
$row['page_line'] = $row['page_title'];
if ($row['page_dynamic'] == '0') {
$row['page_line'] = $row['page_line'] . ' <a href="' . $page_path . '" style="top: 0;" class="ico ico16 ico_goto" title="Посмотреть на сайте"> </a>';
}
$page_tree[$row['page_parent']][$row['page_id']] = $row;
}
s::tree('page_tree', $page_tree);
}
示例3: view
function view()
{
events::observe('save', 'system', 'users', 'saveProfile');
events::observer();
admin::components('validator');
admin::addHeader(' ' . adminUser::get('user_login'));
f::set(adminUser::gets());
}
示例4: edit
function edit()
{
events::observe('save', 'mails', 'saveMail');
events::observer();
admin::components('redactor', 'validator');
db::table('mails');
db::where('mail_id', admin::get('id'));
$row = db::assoc();
f::set($row);
}
示例5: add
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');
}
示例6: addsection
function addsection()
{
admin::components('validator');
events::observe('add', 'info', '_addsection');
events::observer();
f::set('section_year', 2009);
}
示例7: 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);
}
示例8: add
function add()
{
events::observe('add', 'news', '_add');
events::observer();
admin::components('validator', 'redactor');
}
示例9: add
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);
}
示例10: addsection
function addsection()
{
admin::components('validator');
events::observe('add', 'catalog', '_addsection');
events::observer();
}
示例11: add
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);
}
示例12: 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);
}
}