本文整理汇总了PHP中HC_App::app方法的典型用法代码示例。如果您正苦于以下问题:PHP HC_App::app方法的具体用法?PHP HC_App::app怎么用?PHP HC_App::app使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HC_App
的用法示例。
在下文中一共展示了HC_App::app方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _n
static function _n($singular, $plural, $count)
{
if (function_exists('_n')) {
$domain = HC_App::app();
return _n($singular, $plural, $count, $domain);
} else {
$gettext_obj = hc_get_gettext();
if ($gettext_obj === NULL) {
return $plural;
} else {
return $gettext_obj->ngettext($singular, $plural, $count);
}
}
}
示例2: __construct
function __construct()
{
parent::__construct();
// if we need to simulate user - in WP shortcut page */
$app = HC_App::app();
if (isset($GLOBALS['NTS_CONFIG'][$app]['SIMULATE_USER_ID'])) {
$acl = HC_App::acl();
$simulate_id = $GLOBALS['NTS_CONFIG'][$app]['SIMULATE_USER_ID'];
$auth_user = $this->auth->user();
$acl_user = $this->auth->user($simulate_id);
if ($auth_user->level >= $auth_user->_const('LEVEL_MANAGER')) {
$acl->set_user($acl_user);
}
}
}
示例3: _drop_tables
protected function _drop_tables()
{
$this->db->reset_data_cache();
$app = HC_App::app();
$my_table_prefix = isset($GLOBALS['NTS_CONFIG'][$app]['DB_TABLES_PREFIX']) ? $GLOBALS['NTS_CONFIG'][$app]['DB_TABLES_PREFIX'] : NTS_DB_TABLES_PREFIX;
$dbprefix_version = $this->config->item('nts_dbprefix_version');
if ($dbprefix_version) {
$my_table_prefix = $my_table_prefix . $dbprefix_version . '_';
}
$tables = array();
$sth = $this->db->query("SHOW TABLES LIKE '" . $my_table_prefix . "%'");
foreach ($sth->result_array() as $r) {
reset($r);
foreach ($r as $k => $v) {
$tables[] = $v;
}
}
reset($tables);
foreach ($tables as $t) {
$this->db->query("DROP TABLE " . $t . "");
}
}
示例4:
$user_title .= $user->username;
} else {
$user_title .= $user->email;
}
$user_title .= ']';
$link_profile = 'auth/profile';
$nav->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', HC_Lib::link($link_profile))->add_child($user_title));
$auth_user = $this->auth->user();
$acl = HC_App::acl();
$acl_user = $acl->user();
$ri = HC_Lib::ri();
if ($auth_user->id != $acl_user->id) {
if ($ri == 'wordpress') {
if ($auth_user->level >= $auth_user->_const('LEVEL_MANAGER')) {
$nav->add_divider();
$app = HC_App::app();
$admin_url = get_admin_url() . 'admin.php?page=' . $app;
$nav->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', $admin_url)->add_child(HC_Html::icon('cogs'))->add_child(HC_Html_Factory::element('span')->add_attr('class', 'hidden-xs')->add_child(HCM::__('Admin Area'))));
}
}
}
$nav->add_divider();
$nav->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', HC_Lib::link('auth/logout'))->add_child(HC_Html_Factory::element('span')->add_attr('class', 'hidden-xs')->add_child(HCM::__('Log Out')))->add_child(HC_Html::icon('sign-out')));
} else {
if ($this_method != 'login') {
$nav->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', HC_Lib::link('auth/login'))->add_child(HC_Html::icon('sign-in'))->add_child(HC_Html_Factory::element('span')->add_attr('class', 'hidden-xs')->add_child(HCM::__('Log In'))));
} else {
$nav->add_item(HC_Html_Factory::widget('titled', 'a')->add_attr('href', HC_Lib::link())->add_child(HC_Html::icon('arrow-left'))->add_child(HCM::__('Back To Start Page')));
}
}
$out->add_child($nav);