当前位置: 首页>>代码示例>>PHP>>正文


PHP EasyBlogHelper::removeFeatured方法代码示例

本文整理汇总了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();
 }
开发者ID:alexinteam,项目名称:joomla3,代码行数:34,代码来源:users.php

示例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;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:35,代码来源:view.ajax.php

示例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;
 }
开发者ID:Tommar,项目名称:vino2,代码行数:41,代码来源:view.ejax.php


注:本文中的EasyBlogHelper::removeFeatured方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。