本文整理汇总了PHP中EasyBlogHelper::removeFeatured方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyBlogHelper::removeFeatured方法的具体用法?PHP EasyBlogHelper::removeFeatured怎么用?PHP EasyBlogHelper::removeFeatured使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyBlogHelper
的用法示例。
在下文中一共展示了EasyBlogHelper::removeFeatured方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toggleFeatured
/**
* Toggle featured bloggers.
*
* @since 3.5
* @access public
*/
public function toggleFeatured()
{
// Check for request forgeries
JRequest::checkToken() or jexit('Invalid Token');
// @task: Check for acl rules.
$this->checkAccess('user');
$mainframe = JFactory::getApplication();
$records = JRequest::getVar('cid', '');
$message = '';
$task = JRequest::getVar('task');
if (empty($records)) {
$mainframe->enqueueMessage(JText::_('COM_EASYBLOG_INVALID_BLOGGER_ID'), 'error');
$mainframe->redirect('index.php?option=com_easyblog&view=users');
$mainframe->close();
}
foreach ($records as $record) {
if ($task == 'unfeature') {
EasyBlogHelper::removeFeatured(EBLOG_FEATURED_BLOGGER, $record);
$message = JText::_('COM_EASYBLOG_BLOGGER_UNFEATURED_SUCCESSFULLY');
} else {
EasyBlogHelper::makeFeatured(EBLOG_FEATURED_BLOGGER, $record);
$message = JText::_('COM_EASYBLOG_BLOGGER_FEATURED_SUCCESSFULLY');
}
}
$mainframe->enqueueMessage($message, 'message');
$mainframe->redirect('index.php?option=com_easyblog&view=users');
$mainframe->close();
}
示例2: removeFeaturedx
/**
* Remove an item as featured
*
* @param string $type The type of this item
* @param int $postId The unique id of the item
*
* @return string Json string
**/
function removeFeaturedx($type, $postId)
{
$ajax = new Ejax();
$acl = EB::acl();
EasyBlogHelper::removeFeatured($type, $postId);
$idName = '';
$message = '';
switch ($type) {
case 'blogger':
$idName = '#blogger_title_' . $postId;
$message = JText::_('COM_EASYBLOG_BLOGGER_UNFEATURED');
break;
case 'teamblog':
$idName = '#teamblog_title_' . $postId;
$message = JText::_('COM_EASYBLOG_TEAMBLOG_UNFEATURED');
break;
case 'post':
default:
$idName = '#title_' . $postId;
$message = JText::_('COM_EASYBLOG_BLOG_UNFEATURED');
break;
}
$ajax->script('$("' . $idName . '").removeClass("featured-item");');
$ajax->alert($message, JText::_('COM_EASYBLOG_INFO'), '450', 'auto');
$ajax->send();
return;
}
示例3: removeFeatured
/**
* Remove an item as featured
*
* @param string $type The type of this item
* @param int $postId The unique id of the item
*
* @return string Json string
**/
function removeFeatured($type, $postId)
{
$ajax = new Ejax();
$acl = EasyBlogACLHelper::getRuleset();
// Only super admins can feature items
if (!EasyBlogHelper::isSiteAdmin() && !$acl->rules->feature_entry) {
$ajax->alert(JText::_('COM_EASYBLOG_NOT_ALLOWED'), '', '450');
$ajax->send();
return;
}
EasyBlogHelper::removeFeatured($type, $postId);
$idName = '';
$message = '';
switch ($type) {
case 'blogger':
$idName = '#blogger_title_' . $postId;
$message = JText::_('COM_EASYBLOG_BLOGGER_UNFEATURED');
break;
case 'teamblog':
$idName = '#teamblog_title_' . $postId;
$message = JText::_('COM_EASYBLOG_TEAMBLOG_UNFEATURED');
break;
case 'post':
default:
$idName = '#title_' . $postId;
$message = JText::_('COM_EASYBLOG_BLOG_UNFEATURED');
break;
}
$ajax->script('$("' . $idName . '").removeClass("featured-item");');
$ajax->alert($message, JText::_('COM_EASYBLOG_INFO'), '450', 'auto');
$ajax->send();
return;
}