本文整理汇总了PHP中EasyBlogHelper::populateCategories方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::populateCategories方法的具体用法?PHP EasyBlogHelper::populateCategories怎么用?PHP EasyBlogHelper::populateCategories使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::populateCategories方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display($tpl = null)
{
// @rule: Test for user access if on 1.6 and above
if (EasyBlogHelper::getJoomlaVersion() >= '1.6') {
if (!JFactory::getUser()->authorise('easyblog.manage.category', 'com_easyblog')) {
JFactory::getApplication()->redirect('index.php', JText::_('JERROR_ALERTNOAUTHOR'), 'error');
JFactory::getApplication()->close();
}
}
//initialise variables
$document = JFactory::getDocument();
$user = JFactory::getUser();
$mainframe = JFactory::getApplication();
$config = EasyBlogHelper::getConfig();
$acl = EasyBlogACLHelper::getRuleSet();
//Load pane behavior
jimport('joomla.html.pane');
$catId = JRequest::getVar('catid', '');
$cat = EasyBlogHelper::getTable('Category', 'Table');
$cat->load($catId);
$this->cat = $cat;
// Set default values for new entries.
if (empty($cat->created)) {
$date = EasyBlogDateHelper::getDate();
$now = EasyBlogDateHelper::toFormat($date);
$cat->created = $now;
$cat->published = true;
}
$catRuleItems = EasyBlogHelper::getTable('CategoryAclItem', 'Table');
$categoryRules = $catRuleItems->getAllRuleItems();
$assignedACL = $cat->getAssignedACL();
$parentList = EasyBlogHelper::populateCategories('', '', 'select', 'parent_id', $cat->parent_id, false, false, false, array($cat->id));
$editor = JFactory::getEditor($config->get('layout_editor'));
$this->assignRef('editor', $editor);
$this->assignRef('cat', $cat);
$this->assignRef('config', $config);
$this->assignRef('acl', $acl);
$this->assignRef('parentList', $parentList);
$this->assignRef('categoryRules', $categoryRules);
$this->assignRef('assignedACL', $assignedACL);
parent::display($tpl);
}
示例2:
<tr>
<td width="300" class="key">
<span class="editlinktip">
<?php
echo JText::_('COM_EASYBLOG_INTEGRATIONS_TWITTER_MICROBLOGGING_CATEGORY');
?>
</span>
</td>
<td valign="top">
<div class="has-tip">
<div class="tip"><i></i><?php
echo JText::_('COM_EASYBLOG_INTEGRATIONS_TWITTER_MICROBLOGGING_CATEGORY_DESC');
?>
</div>
<?php
echo EasyBlogHelper::populateCategories('', '', 'select', 'integrations_twitter_microblog_category', $this->config->get('integrations_twitter_microblog_category'), true);
?>
</div>
</td>
</tr>
<tr>
<td width="300" class="key">
<span class="editlinktip">
<?php
echo JText::_('COM_EASYBLOG_INTEGRATIONS_TWITTER_MICROBLOGGING_PUBLISH_STATE');
?>
</span>
</td>
<td valign="top">
<div class="has-tip">
<div class="tip"><i></i><?php
示例3:
<tr>
<td width="300" class="key">
<span class="editlinktip">
<?php
echo JText::_('COM_EASYBLOG_SETTINGS_WORKFLOW_REMOTE_PUBLISHING_MAILBOX_CATEGORY');
?>
</span>
</td>
<td valign="top">
<div class="has-tip">
<div class="tip"><i></i><?php
echo JText::_('COM_EASYBLOG_SETTINGS_WORKFLOW_REMOTE_PUBLISHING_MAILBOX_CATEGORY_DESC');
?>
</div>
<?php
echo EasyBlogHelper::populateCategories('', '', 'select', 'main_remotepublishing_mailbox_categoryid', $this->config->get('main_remotepublishing_mailbox_categoryid'), true);
?>
</div>
</td>
</tr>
<tr>
<td width="300" class="key">
<span class="editlinktip">
<?php
echo JText::_('COM_EASYBLOG_SETTINGS_WORKFLOW_REMOTE_PUBLISHING_MAILBOX_PUBLISH_STATE');
?>
</span>
</td>
<td valign="top">
<div class="has-tip">
<div class="tip"><i></i><?php
示例4: microblog
/**
* Micro blogging layout
*
* @since 3.0.7706
* @access public
* @param null
* @return null
*/
public function microblog()
{
$mainframe = JFactory::getApplication();
$config = EasyBlogHelper::getConfig();
$acl = EasyBlogACLHelper::getRuleSet();
if (!EasyBlogHelper::isLoggedIn()) {
EasyBlogHelper::showLogin();
return;
}
$my = JFactory::getuser();
$user = EasyBlogHelper::getTable('Profile', 'Table');
$user->load($my->id);
// @rule: Test if microblogging is allowed
if (!$config->get('main_microblog')) {
EasyBlogHelper::setMessageQueue(JText::_('COM_EASYBLOG_NOT_ALLOWED'), 'error');
JFactory::getApplication()->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false));
}
// @rule: Test ACL if add entry is allowed
if (!$acl->rules->add_entry) {
$mainframe->redirect(EasyBlogRouter::_('index.php?option=com_easyblog&view=dashboard', false), JText::_('COM_EASYBLOG_NO_PERMISSION_TO_CREATE_BLOG'));
$mainframe->close();
}
$document = JFactory::getDocument();
$title = EasyBlogHelper::getPageTitle(JText::_('COM_EASYBLOG_DASHBOARD_SHARE_A_STORY_TITLE'));
// @task: Set the page title
parent::setPageTitle($title, false, $config->get('main_pagetitle_autoappend'));
// Add toolbar to the output
echo $this->showToolbar(__FUNCTION__, $user);
// Get active tabs
$activeType = JRequest::getVar('type', 'text');
// Add the breadcrumbs
$breadcrumbs = array(JText::_('COM_EASYBLOG_DASHBOARD_BREADCRUMB_SHARE_STORY') => '');
// @task: Retrieve existing categories
$categoryModel = $this->getModel('Categories');
$categories = EasyBlogHelper::populateCategories('', '', 'select', 'category_id', '', true, true, true);
// @task: Retrieve existing tags
$tagsModel = $this->getModel('Tags');
$tags = $tagsModel->getTags();
$template = new CodeThemes('dashboard');
$template->set('activeType', $activeType);
$template->set('categories', $categories);
$template->set('breadcrumbs', $breadcrumbs);
$template->set('tags', $tags);
echo $template->fetch('dashboard.microblog.php');
}
示例5:
echo JText::_($title);
?>
<i data-html="true" data-placement="top" data-title=" <?php
echo JText::_($title);
?>
"
data-content=" <?php
echo JText::_($desc);
?>
" data-eb-provide="popover" class="fa fa-question-circle pull-right"></i>
</label>
<div class="col-md-7">
<?php
echo EasyBlogHelper::populateCategories('', '', 'select', '', $this->config->get($name), true);
?>
<?php
if ($instructions) {
?>
<div class="alert alert-warning mt-10">
<?php
echo $instructions;
?>
</div>
<?php
}
?>
</div>
</div>
示例6: editCategory
function editCategory($id)
{
$my = JFactory::getUser();
$ajax = new Ejax();
$acl = EasyBlogACLHelper::getRuleSet();
$config = EasyBlogHelper::getConfig();
if (!$acl->rules->create_category || $my->id == 0) {
$ajax->alert(JText::_('COM_EASYBLOG_NO_PERMISSION_TO_EDIT_CATEGORY'), JText::_('COM_EASYBLOG_INFO'), '450', 'auto');
return $ajax->send();
}
$category = EasyBlogHelper::getTable('Category', 'Table');
$category->load($id);
// @rule: Make sure the category belongs to the user or if he is a super admin.
if ($category->id && $category->created_by != $my->id && !EasyBlogHelper::isSiteAdmin()) {
$ajax->alert(JText::_('COM_EASYBLOG_NOT_ALLOWED'), '', '450');
return $ajax->send();
}
// #26 do not restrict the parent category creator.
$parentList = EasyBlogHelper::populateCategories('', '', 'select', 'parent_id', $category->parent_id);
$catRuleItems = EasyBlogHelper::getTable('CategoryAclItem', 'Table');
$categoryRules = $catRuleItems->getAllRuleItems();
// assigned acl
$assignedACL = $category->getAssignedACL();
$tpl = new CodeThemes('dashboard');
$tpl->set('category', $category);
$tpl->set('config', $config);
$tpl->set('parentList', $parentList);
$tpl->set('categoryRules', $categoryRules);
$tpl->set('assignedACL', $assignedACL);
$options = new stdClass();
$options->title = JText::_('COM_EASYBLOG_DASHBOARD_CATEGORIES_DIALOG_EDIT_CATEGORY_TITLE');
$options->content = $tpl->fetch('ajax.dialog.category.edit.php');
$ajax->dialog($options);
return $ajax->send();
}