本文整理汇总了PHP中AppContext::get_uid方法的典型用法代码示例。如果您正苦于以下问题:PHP AppContext::get_uid方法的具体用法?PHP AppContext::get_uid怎么用?PHP AppContext::get_uid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppContext
的用法示例。
在下文中一共展示了AppContext::get_uid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_get_uid
function test_get_uid()
{
$ret = AppContext::get_uid();
self::assertEquals($ret, 1764);
$ret = AppContext::get_uid();
self::assertEquals($ret, 1765);
}
示例2: process_movie_tag
/**
* Inserts the javascript calls for the movie tag.
* @param $matches The matched elements
* @return The movie insertion code containing javascrpt calls
*/
private static function process_movie_tag($matches)
{
$id = 'movie_' . AppContext::get_uid();
return '<a class="video-player" href="' . $matches[1] . '" style="display:block;margin:auto;width:' . $matches[2] . 'px;height:' . $matches[3] . 'px;" id="' . $id . '"></a><br />' . '<script><!--' . "\n" . 'insertMoviePlayer(\'' . $id . '\');' . "\n" . '--></script>';
}
示例3: update_uid
/**
* Update the menu uid
*/
public function update_uid()
{
$this->uid = AppContext::get_uid();
}
示例4: lateral_menu
lateral_menu();
$tpl = new FileTemplate('admin/menus/links.tpl');
$tpl->put_all(array('L_NAME' => $LANG['name'], 'L_URL' => $LANG['url'], 'L_IMAGE' => LangLoader::get_message('form.picture', 'common'), 'L_STATUS' => $LANG['status'], 'L_HIDDEN_WITH_SMALL_SCREENS' => $LANG['hidden_with_small_screens'], 'L_AUTHS' => $LANG['auths'], 'L_ENABLED' => LangLoader::get_message('enabled', 'common'), 'L_DISABLED' => LangLoader::get_message('disabled', 'common'), 'L_GUEST' => $LANG['guest'], 'L_USER' => $LANG['member'], 'L_MODO' => $LANG['modo'], 'L_ADMIN' => $LANG['admin'], 'L_LOCATION' => $LANG['location'], 'L_ACTION_MENUS' => $menu_id > 0 ? $LANG['menus_edit'] : LangLoader::get_message('add', 'common'), 'L_ACTION' => $menu_id > 0 ? $LANG['update'] : $LANG['submit'], 'L_RESET' => $LANG['reset'], 'ACTION' => 'save', 'L_TYPE' => $LANG['type'], 'L_CONTENT' => $LANG['content'], 'L_AUTHORIZATIONS' => $LANG['authorizations'], 'L_ADD' => LangLoader::get_message('add', 'common'), 'L_REQUIRE_NAME' => $LANG['require_name'], 'J_AUTH_FORM' => str_replace(array(""", "<!--", "-->"), array('"', "", ""), TextHelper::to_js_string(Authorizations::generate_select(Menu::MENU_AUTH_BIT, array('r-1' => Menu::MENU_AUTH_BIT, 'r0' => Menu::MENU_AUTH_BIT, 'r1' => Menu::MENU_AUTH_BIT), array(), 'menu_element_##UID##_auth'))), 'JL_AUTHORIZATIONS' => TextHelper::to_js_string($LANG['authorizations']), 'JL_PROPERTIES' => TextHelper::to_js_string($LANG['properties']), 'JL_NAME' => TextHelper::to_js_string($LANG['name']), 'JL_URL' => TextHelper::to_js_string($LANG['url']), 'JL_IMAGE' => TextHelper::to_js_string(LangLoader::get_message('form.picture', 'common')), 'JL_DELETE_ELEMENT' => TextHelper::to_js_string(LangLoader::get_message('confirm.delete', 'status-messages-common')), 'JL_MORE' => TextHelper::to_js_string($LANG['more_details']), 'JL_DELETE' => TextHelper::to_js_string(LangLoader::get_message('delete', 'common')), 'JL_ADD_SUB_ELEMENT' => TextHelper::to_js_string($LANG['add_sub_element']), 'JL_ADD_SUB_MENU' => TextHelper::to_js_string($LANG['add_sub_menu'])));
//Localisation possibles.
$block = retrieve(GET, 's', Menu::BLOCK_POSITION__HEADER, TINTEGER);
$array_location = array(Menu::BLOCK_POSITION__HEADER => $LANG['menu_header'], Menu::BLOCK_POSITION__SUB_HEADER => $LANG['menu_subheader'], Menu::BLOCK_POSITION__LEFT => $LANG['menu_left'], Menu::BLOCK_POSITION__TOP_CENTRAL => $LANG['menu_top_central'], Menu::BLOCK_POSITION__BOTTOM_CENTRAL => $LANG['menu_bottom_central'], Menu::BLOCK_POSITION__RIGHT => $LANG['menu_right'], Menu::BLOCK_POSITION__TOP_FOOTER => $LANG['menu_top_footer'], Menu::BLOCK_POSITION__FOOTER => $LANG['menu_footer']);
$edit_menu_tpl = new FileTemplate('admin/menus/menu_edition.tpl');
$edit_menu_tpl->put_all(array('L_NAME' => $LANG['name'], 'L_IMAGE' => LangLoader::get_message('form.picture', 'common'), 'L_URL' => $LANG['url'], 'L_PROPERTIES' => $LANG['properties'], 'L_AUTHORIZATIONS' => $LANG['authorizations'], 'L_ADD_SUB_ELEMENT' => $LANG['add_sub_element'], 'L_ADD_SUB_MENU' => $LANG['add_sub_menu'], 'L_MORE' => $LANG['more_details'], 'L_DELETE' => LangLoader::get_message('delete', 'common')));
$menu = null;
if ($menu_id > 0) {
$menu = MenuService::load($menu_id);
if (!$menu instanceof LinksMenu) {
AppContext::get_response()->redirect('menus.php');
}
$block = $menu->get_block();
} else {
// Create a new generic menu
$menu = new LinksMenu('', '', '', LinksMenu::AUTOMATIC_MENU);
}
$tpl->put_all(array('IDMENU' => $menu_id, 'AUTH_MENUS' => Authorizations::generate_select(Menu::MENU_AUTH_BIT, $menu->get_auth(), array(), 'menu_element_' . $menu->get_uid() . '_auth'), 'C_ENABLED' => !empty($menu_id) ? $menu->is_enabled() : true, 'C_MENU_HIDDEN_WITH_SMALL_SCREENS' => $menu->is_hidden_with_small_screens(), 'MENU_ID' => $menu->get_id(), 'MENU_TREE' => $menu->display($edit_menu_tpl, LinksMenuElement::LINKS_MENU_ELEMENT__FULL_DISPLAYING), 'MENU_NAME' => $menu->get_title(), 'MENU_URL' => $menu->get_url(true), 'MENU_IMG' => $menu->get_image(true), 'ID' => $menu->get_uid()));
foreach (LinksMenu::get_menu_types_list() as $type_name) {
$tpl->assign_block_vars('type', array('NAME' => $type_name, 'L_NAME' => $LANG[$type_name . '_menu'], 'SELECTED' => $menu->get_type() == $type_name ? ' selected="selected"' : ''));
}
foreach ($array_location as $key => $name) {
$tpl->assign_block_vars('location', array('C_SELECTED' => $block == $key, 'VALUE' => $key, 'NAME' => $name));
}
//Filtres
MenuAdminService::add_filter_fieldset($menu, $tpl);
$tpl->put_all(array('ID_MAX' => AppContext::get_uid()));
$tpl->display();
require_once PATH_TO_ROOT . '/admin/admin_footer.php';