本文整理汇总了PHP中Toolbar类的典型用法代码示例。如果您正苦于以下问题:PHP Toolbar类的具体用法?PHP Toolbar怎么用?PHP Toolbar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Toolbar类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testAddAndGetDataCollectors
/**
* @covers Fabfuel\Prophiler\Toolbar::addDataCollector
* @covers Fabfuel\Prophiler\Toolbar::getDataCollectors
* @uses Fabfuel\Prophiler\Toolbar
*/
public function testAddAndGetDataCollectors()
{
$profiler = $this->getMockBuilder('Fabfuel\\Prophiler\\Profiler')->disableOriginalConstructor()->getMock();
$toolbar = new Toolbar($profiler);
$this->assertCount(0, $toolbar->getDataCollectors());
$dataCollector = $this->getMock('Fabfuel\\Prophiler\\DataCollector\\Request');
$toolbar->addDataCollector($dataCollector);
$this->assertCount(1, $toolbar->getDataCollectors());
$this->assertSame($dataCollector, $toolbar->getDataCollectors()[0]);
}
开发者ID:tresemece,项目名称:monte,代码行数:15,代码来源:ToolbarTest.php
示例2: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$userId = User::get('id');
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == User::get('id'));
// Since we don't track these assets at the item level, use the category id.
$canDo = NewsfeedsHelper::getActions($this->item->catid, 0);
Toolbar::title(Lang::txt('COM_NEWSFEEDS_MANAGER_NEWSFEED'), 'newsfeeds.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count(User::getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0)) {
Toolbar::apply('newsfeed.apply');
Toolbar::save('newsfeed.save');
}
if (!$checkedOut && count(User::getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) {
Toolbar::save2new('newsfeed.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('newsfeed.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('newsfeed.cancel');
} else {
Toolbar::cancel('newsfeed.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS_EDIT');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:34,代码来源:view.html.php
示例3: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/languages.php';
$canDo = LanguagesHelper::getActions();
Toolbar::title(Lang::txt('COM_LANGUAGES_VIEW_LANGUAGES_TITLE'), 'langmanager.png');
if ($canDo->get('core.create')) {
Toolbar::addNew('language.add');
}
if ($canDo->get('core.edit')) {
Toolbar::editList('language.edit');
Toolbar::divider();
}
if ($canDo->get('core.edit.state')) {
if ($this->state->get('filter.published') != 2) {
Toolbar::publishList('languages.publish');
Toolbar::unpublishList('languages.unpublish');
}
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
Toolbar::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH');
Toolbar::divider();
} elseif ($canDo->get('core.edit.state')) {
Toolbar::trash('languages.trash');
Toolbar::divider();
}
if ($canDo->get('core.admin')) {
// Add install languages link to the lang installer component
Toolbar::appendButton('Link', 'extension', 'COM_LANGUAGES_INSTALL', 'index.php?option=com_installer&view=languages');
Toolbar::divider();
Toolbar::preferences('com_languages');
Toolbar::divider();
}
Toolbar::help('languages');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:39,代码来源:view.html.php
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = TemplatesHelper::getActions();
Toolbar::title($isNew ? Lang::txt('COM_TEMPLATES_MANAGER_ADD_STYLE') : Lang::txt('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
Toolbar::apply('style.apply');
Toolbar::save('style.save');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('style.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('style.cancel');
} else {
Toolbar::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
// Get the help information for the template item.
$lang = Lang::getRoot();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = Lang::txt($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
Toolbar::help('style');
//$help->key, false, $url);
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:39,代码来源:view.html.php
示例5: controller_exec
function controller_exec()
{
global $conf;
if (!authorized()) {
$err_str = 'Access restricted.';
if ($conf['modes']['db']['enabled']) {
$group = $conf['access_limit_to_group'];
Toolbar::title('Databases', 'databases');
Toolbar::preferences('com_databases', '200');
$err_str = "<p class=\"error\">Not authorized, access is limited to \"<em>{$group}</em>\"</p>. <h3>Use the Databases component parameters to change this</h3>";
}
print $err_str;
return;
}
// Get the task
$task = Request::getVar('task', 'list');
$task_file = JPATH_COMPONENT . DS . 'tasks' . DS . $task . '.php';
if (require_once $task_file) {
$task_func = 'dv_' . $task;
if (function_exists($task_func)) {
if (file_exists(JPATH_COMPONENT . DS . 'tasks' . DS . 'html' . DS . $task . '.js')) {
$document = App::get('document');
$document->addScript(DB_PATH . DS . 'tasks' . DS . 'html' . DS . $task . '.js?v=2');
}
$task_func();
}
}
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:28,代码来源:controller.php
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
Toolbar::title(Lang::txt($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'menu.png');
// If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid.
if ($isNew && $canDo->get('core.create')) {
if ($canDo->get('core.edit')) {
Toolbar::apply('menu.apply');
}
Toolbar::save('menu.save');
}
// If user can edit, can save the item.
if (!$isNew && $canDo->get('core.edit')) {
Toolbar::apply('menu.apply');
Toolbar::save('menu.save');
}
// If the user can create new items, allow them to see Save & New
if ($canDo->get('core.create')) {
Toolbar::save2new('menu.save2new');
}
if ($isNew) {
Toolbar::cancel('menu.cancel');
} else {
Toolbar::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('menu');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:35,代码来源:view.html.php
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ModulesHelper::getActions();
Toolbar::title(Lang::txt('COM_MODULES_MANAGER_MODULES'), 'module.png');
if ($canDo->get('core.create')) {
//Toolbar::addNew('module.add');
Toolbar::appendButton('Popup', 'new', 'JTOOLBAR_NEW', 'index.php?option=com_modules&view=select&tmpl=component', 850, 400);
}
if ($canDo->get('core.edit')) {
Toolbar::editList('module.edit');
}
if ($canDo->get('core.create')) {
Toolbar::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true);
}
if ($canDo->get('core.edit.state')) {
Toolbar::divider();
Toolbar::publish('modules.publish', 'JTOOLBAR_PUBLISH', true);
Toolbar::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true);
Toolbar::divider();
Toolbar::checkin('modules.checkin');
}
if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) {
Toolbar::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH');
Toolbar::divider();
} elseif ($canDo->get('core.edit.state')) {
Toolbar::trash('modules.trash');
Toolbar::divider();
}
if ($canDo->get('core.admin')) {
Toolbar::preferences('com_modules');
Toolbar::divider();
}
Toolbar::help('modules');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:40,代码来源:view.html.php
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$canDo = UsersHelper::getActions();
Toolbar::title(Lang::txt('COM_USERS_VIEW_USERS_TITLE'), 'user');
if ($canDo->get('core.create')) {
//Toolbar::addNew('user.add');
}
if ($canDo->get('core.edit')) {
Toolbar::editList('user.edit');
}
if ($canDo->get('core.edit.state')) {
Toolbar::divider();
Toolbar::publish('users.approve', 'COM_USERS_TOOLBAR_APPROVE', true);
Toolbar::unpublish('users.block', 'COM_USERS_TOOLBAR_BLOCK', true);
Toolbar::custom('users.unblock', 'unblock.png', 'unblock_f2.png', 'COM_USERS_TOOLBAR_UNBLOCK', true);
Toolbar::divider();
}
if ($canDo->get('core.delete')) {
Toolbar::deleteList('', 'users.delete');
Toolbar::divider();
}
if ($canDo->get('core.admin')) {
Toolbar::preferences('com_users');
Toolbar::divider();
}
Toolbar::help('users');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:32,代码来源:view.html.php
示例9: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
$state = $this->get('State');
$canDo = ContentHelper::getActions($this->state->get('filter.category_id'));
Toolbar::title(Lang::txt('COM_CONTENT_FEATURED_TITLE'), 'featured.png');
if ($canDo->get('core.create')) {
Toolbar::addNew('article.add');
}
if ($canDo->get('core.edit')) {
Toolbar::editList('article.edit');
}
if ($canDo->get('core.edit.state')) {
Toolbar::divider();
Toolbar::publish('articles.publish', 'JTOOLBAR_PUBLISH', true);
Toolbar::unpublish('articles.unpublish', 'JTOOLBAR_UNPUBLISH', true);
Toolbar::divider();
Toolbar::archiveList('articles.archive');
Toolbar::checkin('articles.checkin');
Toolbar::custom('featured.delete', 'remove.png', 'remove_f2.png', 'JTOOLBAR_REMOVE', true);
}
if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) {
Toolbar::deleteList('', 'articles.delete', 'JTOOLBAR_EMPTY_TRASH');
Toolbar::divider();
} elseif ($canDo->get('core.edit.state')) {
Toolbar::divider();
Toolbar::trash('articles.trash');
}
if ($canDo->get('core.admin')) {
Toolbar::preferences('com_content');
Toolbar::divider();
}
Toolbar::help('featured');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:38,代码来源:view.html.php
示例10: addSubmenu
/**
* Configure the Linkbar.
*
* @param string The name of the active view.
*/
public static function addSubmenu($vName)
{
Submenu::addEntry(Lang::txt('COM_NEWSFEEDS_SUBMENU_NEWSFEEDS'), Route::url('index.php?option=com_newsfeeds&view=newsfeeds'), $vName == 'newsfeeds');
Submenu::addEntry(Lang::txt('COM_NEWSFEEDS_SUBMENU_CATEGORIES'), Route::url('index.php?option=com_categories&extension=com_newsfeeds'), $vName == 'categories');
if ($vName == 'categories') {
Toolbar::title(Lang::txt('COM_CATEGORIES_CATEGORIES_TITLE', Lang::txt('com_newsfeeds')), 'newsfeeds-categories');
}
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:newsfeeds.php
示例11: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', 1);
Toolbar::title(Lang::txt('COM_ADMIN_VIEW_PROFILE_TITLE'), 'user-profile');
Toolbar::apply('profile.apply');
Toolbar::save('profile.save');
Toolbar::cancel('profile.cancel', 'JTOOLBAR_CLOSE');
Toolbar::divider();
Toolbar::help('JHELP_ADMIN_USER_PROFILE_EDIT');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:15,代码来源:view.html.php
示例12: display
/**
* Display module contents
*
* @return void
*/
public function display()
{
if (!\App::isAdmin()) {
return;
}
// Get the toolbar.
$toolbar = \Toolbar::render('toolbar');
// Get the view
require $this->getLayoutPath($this->params->get('layout', 'default'));
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:15,代码来源:helper.php
示例13: getInstance
/**
* Returns the global JToolBar object, only creating it if it
* doesn't already exist.
*
* @param string $name The name of the toolbar.
*
* @return JToolBar The JToolBar object.
*
* @since 11.1
*/
public static function getInstance($name = 'toolbar')
{
if ($name == 'toolbar' && class_exists('\\Toolbar')) {
return \Toolbar::getRoot();
}
if ($name == 'submenu' && class_exists('\\Submenu')) {
return \Submenu::getRoot();
}
if (empty(self::$instances[$name])) {
self::$instances[$name] = new JToolBar($name);
}
return self::$instances[$name];
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:23,代码来源:toolbar.php
示例14: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
if ($this->getLayout() == 'edit') {
Toolbar::title(Lang::txt('COM_MESSAGES_WRITE_PRIVATE_MESSAGE'), 'new-privatemessage.png');
Toolbar::save('message.save', 'COM_MESSAGES_TOOLBAR_SEND');
Toolbar::cancel('message.cancel');
Toolbar::help('JHELP_COMPONENTS_MESSAGING_WRITE');
} else {
Toolbar::title(Lang::txt('COM_MESSAGES_VIEW_PRIVATE_MESSAGE'), 'inbox.png');
$sender = JUser::getInstance($this->item->user_id_from);
if ($sender->authorise('core.admin') || $sender->authorise('core.manage', 'com_messages') && $sender->authorise('core.login.admin')) {
Toolbar::custom('message.reply', 'restore.png', 'restore_f2.png', 'COM_MESSAGES_TOOLBAR_REPLY', false);
}
Toolbar::cancel('message.cancel');
Toolbar::help('JHELP_COMPONENTS_MESSAGING_READ');
}
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:22,代码来源:view.html.php
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
// Set the titlebar text
Toolbar::title(Lang::txt('COM_MEDIA'), 'mediamanager.png');
// Add a delete button
if (User::authorise('core.delete', 'com_media')) {
$title = Lang::txt('JTOOLBAR_DELETE');
$dhtml = "<a href=\"#\" onclick=\"MediaManager.submit('folder.delete')\" data-title=\"{$title}\">\n\t\t\t\t\t\t<span class=\"icon-32-delete\">{$title}</span>\n\t\t\t\t\t</a>";
Toolbar::appendButton('Custom', $dhtml, 'delete');
Toolbar::divider();
}
// Add a delete button
if (User::authorise('core.admin', 'com_media')) {
Toolbar::preferences('com_media', 450, 800, 'JToolbar_Options', '', 'window.location.reload()');
Toolbar::divider();
}
Toolbar::help('media');
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:23,代码来源:view.html.php
示例16: seeViewEdit
/**
* @brief Renderiza la vista de edicion del componente
*/
function seeViewEdit()
{
Toolbar::editRotator();
JRequest::setVar('view', 'editrotator');
$css = JRequest::getVar('css', '', 'post', '', JREQUEST_ALLOWHTML);
if ($css == '') {
jimport('joomla.filesystem.file');
$css = JFile::read(JPATH_SITE . '/administrator/components/com_rotator/resource/default.txt');
JRequest::setVar('css', $css, 'post');
}
$class = JRequest::getVar('class', '', 'post');
if ($class == '') {
JRequest::setVar('class', 'theme-default', 'post');
}
$view =& $this->getView('editrotator', 'html');
$view->assign('task', $this->_task);
parent::display();
}
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:21,代码来源:rotator.php
示例17: dv_list
function dv_list()
{
global $com_name, $conf;
Toolbar::title(Lang::txt('Database List'), 'databases');
Toolbar::preferences(Request::getcmd('option'), '500');
$base = $conf['dir_base'];
$arry = array();
$list = `cd {$base}; ls ./*/database.json`;
$list = explode("\n", $list);
array_pop($list);
?>
<table class="adminlist">
<thead>
<tr>
<th width="50px">#</th>
<th width="40%">Name</th>
<th>Config</th>
<th width="30%">Data Views</th>
</tr>
</thead>
<tbody>
<?php
$c = 0;
foreach ($list as $item) {
chdir($base);
$id = explode('/', $item);
$id = $id[1];
$db = json_decode(file_get_contents($item), true);
print '<tr>';
print '<td >' . ++$c . '</td>';
print '<td >' . $db['name'] . '</td>';
print '<td><a href="/administrator/index.php?option=com_dataviewer&task=config&db=' . $id . '">Edit Config</a></td>';
print '<td><a href="/administrator/index.php?option=com_dataviewer&task=dataview_list&db=' . $id . '" target="_blank">' . 'Dataviews' . '</a></td>';
print '</tr>';
}
?>
<tbody>
</table>
<?php
}
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:40,代码来源:list.php
示例18: render
public function render()
{
if (count($this->listFields) > 0) {
$fieldNames = $this->listFields;
} else {
$fieldNames = $this->getDefaultFieldNames();
}
foreach ($fieldNames as $i => $fieldName) {
$fieldNames[$i] = substr($fieldName, 0, 1) == "." ? $this->redirectedPackage . $fieldName : $fieldName;
}
$this->setupList();
$params["fields"] = $fieldNames;
$params["page"] = 0;
$params["sort_field"] = array(array("field" => end(explode('.', reset($fieldNames))), "type" => "DESC"));
$params['hardConditions'] = $this->listConditions;
$this->table->setParams($params);
return $this->toolbar->render() . $this->table->render();
}
开发者ID:ekowabaka,项目名称:cfx,代码行数:18,代码来源:MCListView.php
示例19: getContents
/**
* Default controller action. This is the default action which is executed
* when no action is specified for a given call.
* @see lib/controllers/Controller::getContents()
*/
public function getContents()
{
if (count($this->listFields) > 0) {
$fieldNames = $this->listFields;
} else {
if ($this->app != null) {
$fieldNames = $this->app->xpath("/app:app/app:list/app:field");
$concatenatedLabels = $this->app->xpath("/app:app/app:list/app:field/@label");
} else {
$fieldNames = array();
$keyField = $this->model->getKeyField();
$fieldNames[$keyField] = "{$this->model->package}.{$keyField}";
$fields = $this->model->getFields();
foreach ($fields as $i => $field) {
if ($field["reference"] == "") {
$fieldNames[$i] = $this->model->package . "." . $field["name"];
} else {
$modelInfo = Model::resolvePath($field["reference"]);
$fieldNames[$i] = $modelInfo["model"] . "." . $field["referenceValue"];
}
}
}
}
foreach ($fieldNames as $i => $fieldName) {
$fieldNames[$i] = substr((string) $fieldName, 0, 1) == "." ? $this->redirectedPackage . (string) $fieldName : (string) $fieldName;
}
if (count($this->fieldNames) > 0) {
$fieldNames = $this->fieldNames;
}
if ($this->apiMode === false) {
$this->setupList();
$params["fields"] = $fieldNames;
$params["page"] = 0;
$params["sort_field"] = array(array("field" => $this->model->database . "." . $this->model->getKeyField(), "type" => "DESC"));
$this->table->setParams($params);
$return = '<div id="table-wrapper">' . $this->toolbar->render() . $this->table->render() . '</div>';
} else {
$params["fields"] = $fieldNames;
$params["page"] = 0;
$params["sort_field"] = array(array("field" => $this->model->database . "." . $this->model->getKeyField(), "type" => "DESC"));
$return = json_encode(SQLDBDataStore::getMulti($params));
}
return $return;
}
开发者ID:rocksyne,项目名称:wyf,代码行数:49,代码来源:ModelController.php
注:本文中的Toolbar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论