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


PHP FD::makeArray方法代码示例

本文整理汇总了PHP中FD::makeArray方法的典型用法代码示例。如果您正苦于以下问题:PHP FD::makeArray方法的具体用法?PHP FD::makeArray怎么用?PHP FD::makeArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FD的用法示例。


在下文中一共展示了FD::makeArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: fetch

 /**
  * Does a remote call to the server to fetch contents of a given url.
  *
  * @since	1.0
  * @access	public
  */
 public function fetch()
 {
     // Check for request forgeries!
     $urls = JRequest::getVar('urls');
     // Ensure that the urls are in an array
     FD::makeArray($urls);
     // Get the current view.
     $view = $this->getCurrentView();
     // Result placeholder
     $result = array();
     if (!$urls || empty($urls)) {
         $view->setMessage(JText::_('COM_EASYSOCIAL_CRAWLER_INVALID_URL_PROVIDED'), SOCIAL_MSG_ERROR);
         return $view->call(__FUNCTION__);
     }
     $crawler = FD::get('Crawler');
     foreach ($urls as $url) {
         $hash = md5($url);
         $link = FD::table('Link');
         $exists = $link->load(array('hash' => $hash));
         // If it doesn't exist, store it.
         if (!$exists) {
             $crawler->crawl($url);
             $data = $crawler->getData();
             $link->hash = $hash;
             $link->data = FD::json()->encode($data);
             // Store the new link
             $link->store();
         }
         $result[$url] = FD::json()->decode($link->data);
     }
     return $view->call(__FUNCTION__, $result);
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:38,代码来源:crawler.php

示例2: getParticipants

 /**
  * Retrieves a list of participants from a discussion
  *
  * @since	1.2
  * @access	public
  * @param	int 	The discussion id.
  * @return
  */
 public function getParticipants($id, $options = array())
 {
     $db = FD::db();
     $sql = $db->sql();
     $sql->column('DISTINCT( a.created_by )');
     $sql->select('#__social_discussions', 'a');
     if (FD::config()->get('users.blocking.enabled') && !JFactory::getUser()->guest) {
         $sql->leftjoin('#__social_block_users', 'bus');
         $sql->on('a.created_by', 'bus.user_id');
         $sql->on('bus.target_id', JFactory::getUser()->id);
         $sql->isnull('bus.id');
     }
     $sql->where('(');
     $sql->where('a.parent_id', $id);
     $sql->where('a.id', $id, '=', 'OR');
     $sql->where(')');
     $sql->where('a.state', SOCIAL_STATE_PUBLISHED);
     $exclude = isset($options['exclude']) ? $options['exclude'] : '';
     if ($exclude) {
         $exclude = FD::makeArray($exclude);
         $sql->where('a.created_by', $exclude, 'NOT IN');
     }
     $db->setQuery($sql);
     $rows = $db->loadColumn();
     if (!$rows) {
         return $rows;
     }
     $users = FD::user($rows);
     return $users;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:38,代码来源:discussions.php

示例3: onBeforeSave

 public function onBeforeSave(&$post, &$group)
 {
     $value = !empty($post['eventcreate']) ? $post['eventcreate'] : '[]';
     $params = $group->getParams();
     $params->set('eventcreate', FD::makeArray($value));
     $group->params = $params->toString();
     unset($post['eventcreate']);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:8,代码来源:eventcreate.php

示例4: __construct

 public function __construct($string = '', $args = array())
 {
     if (!empty($string)) {
         $this->string = $string;
     }
     if (!empty($args)) {
         $this->arguments = FD::makeArray($args);
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:9,代码来源:language.php

示例5: togglePublish

 public function togglePublish()
 {
     FD::checkToken();
     $action = $this->getTask();
     $ids = JRequest::getVar('cid');
     $ids = FD::makeArray($ids);
     $table = FD::table('Region');
     $table->{$action}($ids);
     $message = JText::_($action === 'publish' ? 'COM_EASYSOCIAL_REGIONS_PUBLISHED_SUCCESS' : 'COM_EASYSOCIAL_REGIONS_UNPUBLISHED_SUCCESS');
     $this->view->setMessage($message, SOCIAL_MSG_SUCCESS);
     return $this->view->call(__FUNCTION__);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:regions.php

示例6: form

 public function form()
 {
     // Check for request forgeries
     FD::checkToken();
     $ids = JRequest::getVar('cid');
     $ids = FD::makeArray($ids);
     if (empty($ids)) {
         $this->view->setMessage(JText::_('COM_EASYSOCIAL_MAINTENANCE_NO_SCRIPT_SELECTED'));
         return $this->view->call(__FUNCTION__);
     }
     return $this->view->call(__FUNCTION__, $ids);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:12,代码来源:maintenance.php

示例7: addDependency

 /**
  * Initializes files that are required by the module
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function addDependency($dependencies = array())
 {
     $dependencies = FD::makeArray($dependencies);
     if (!$dependencies) {
         return false;
     }
     // Determine what dependencies are required
     foreach ($dependencies as $dependency) {
         if (!method_exists($this, $dependency)) {
             continue;
         }
         $this->{$dependency}();
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:22,代码来源:modules.php

示例8: allowed

 /**
  * Determines if the username is allowed
  *
  * @since	1.0
  * @access	public
  * @param	string		The username to check against.
  * @param	JRegistry	The field's registry.
  * @return	bool	True if username is allowed, false otherwise.
  */
 public static function allowed($username, &$params)
 {
     $disallowed = trim($params->get('disallowed', ''));
     // If nothing is defined as allowed
     if (empty($disallowed)) {
         return true;
     }
     $disallowed = FD::makeArray($disallowed, ',');
     if (empty($disallowed)) {
         return true;
     }
     if (!in_array($username, $disallowed)) {
         return true;
     }
     return false;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:25,代码来源:helper.php

示例9: publish

 public function publish()
 {
     FD::checkToken();
     $ids = FD::makeArray(JRequest::getVar('cid'));
     $view = $this->getCurrentView();
     $task = $this->getTask();
     if (empty($ids)) {
         $view->setMessage(JText::_('COM_EASYSOCIAL_ACCESS_INVALID_ID_PROVIDED'), SOCIAL_MSG_ERROR);
         return $view->call(__FUNCTION__);
     }
     foreach ($ids as $id) {
         $acc = FD::table('accessrules');
         $acc->load($id);
         $acc->{$task}();
     }
     $message = $task === 'publish' ? 'COM_EASYSOCIAL_ACCESS_PUBLISHED_SUCCESSFULLY' : 'COM_EASYSOCIAL_ACCESS_UNPUBLISHED_SUCCESSFULLY';
     $view->setMessage(JText::_($message), SOCIAL_MSG_SUCCESS);
     return $view->call(__FUNCTION__);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:19,代码来源:access.php

示例10: delete

 /**
  * Deletes a label
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function delete()
 {
     // Check for request forgeries
     FD::checkToken();
     $ids = JRequest::getVar('cid');
     $ids = FD::makeArray($ids);
     $view = $this->getCurrentView();
     if (empty($ids)) {
         $view->setMessage(JText::_('COM_EASYSOCIAL_LABELS_EMPTY_ID_PROVIDED'), SOCIAL_MSG_ERROR);
         return $view->call(__FUNCTION__);
     }
     foreach ($ids as $id) {
         $label = FD::table('Label');
         $label->load($id);
         $label->delete();
     }
     $view->setMessage(JText::_('COM_EASYSOCIAL_LABELS_LABEL_DELETED_SUCCESSFULLY'), SOCIAL_MSG_SUCCESS);
     return $view->call(__FUNCTION__);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:27,代码来源:labels.php

示例11: allowed

 /**
  * Determines if the username is allowed
  *
  * @since   1.0
  * @access  public
  * @param   string      The username to check against.
  * @param   JRegistry   The field's registry.
  * @return  bool    True if username is allowed, false otherwise.
  */
 public static function allowed($username, &$params, $current = '')
 {
     // Exception for current
     if (!empty($current) && $username === $current) {
         return true;
     }
     $disallowed = trim($params->get('disallowed', ''));
     // If nothing is defined as allowed
     if (empty($disallowed)) {
         return true;
     }
     $disallowed = FD::makeArray($disallowed, ',');
     if (empty($disallowed)) {
         return true;
     }
     if (!in_array($username, $disallowed)) {
         return true;
     }
     return false;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:29,代码来源:helper.php

示例12: remove

 /**
  * Deletes an album from the site
  *
  * @since	1.0
  * @access	public
  */
 public function remove()
 {
     // Check for request forgeries
     FD::checkToken();
     // Get the current view
     $view = $this->getCurrentView();
     // Get the list of ids
     $ids = JRequest::getVar('cid');
     // Ensure that the id's are in an array
     $ids = FD::makeArray($ids);
     foreach ($ids as $id) {
         $album = FD::table('Album');
         $album->load($id);
         $album->delete();
         // @points: photos.albums.delete
         // Deduct points from creator when his album is deleted.
         $album->assignPoints('photos.albums.delete', $album->uid);
     }
     $view->setMessage(JText::_('COM_EASYSOCIAL_ALBUMS_ALBUM_DELETED_SUCCESSFULLY'), SOCIAL_MSG_SUCCESS);
     return $view->call(__FUNCTION__);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:27,代码来源:albums.php

示例13: getStream

 /**
  * Retrieves the stream contents.
  *
  * @since	1.0
  * @access	public
  */
 public function getStream($stream, $type = '', $hashtags = array())
 {
     $ajax = FD::ajax();
     if ($this->hasErrors()) {
         return $ajax->reject($this->getMessage());
     }
     $streamCnt = $stream->getCount();
     // Initialize the default ids
     $groupId = false;
     $eventId = false;
     // Retrieve the story lib
     $story = FD::get('Story', SOCIAL_TYPE_USER);
     // Get the tags
     if ($hashtags) {
         $hashtags = FD::makeArray($hashtags);
         $story->setHashtags($hashtags);
     }
     if ($type == SOCIAL_TYPE_GROUP) {
         $story = FD::get('Story', $type);
         $groupId = $this->input->getInt('id', 0);
         $story->setCluster($groupId, $type);
         $story->showPrivacy(false);
     }
     if ($type == SOCIAL_TYPE_EVENT) {
         $story = FD::get('Story', $type);
         $eventId = $this->input->getInt('id', 0);
         $story->setCluster($eventId, $type);
         $story->showPrivacy(false);
     }
     $stream->story = $story;
     $theme = FD::themes();
     $theme->set('eventId', $eventId);
     $theme->set('groupId', $groupId);
     $theme->set('hashtag', false);
     $theme->set('stream', $stream);
     $theme->set('story', $story);
     $theme->set('streamcount', $streamCnt);
     $contents = $theme->output('site/dashboard/feeds');
     return $ajax->resolve($contents, $streamCnt);
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:46,代码来源:view.ajax.php

示例14: removeFile

 /**
  * Removes a file from a group.
  *
  * @since	1.2
  * @access	public
  * @return	mixed 	True if success, exception if false.
  */
 public function removeFile()
 {
     // Check if the user has access to delete files from this group
     if (!$this->group->isMember()) {
         return FD::exception(JText::_('COM_EASYSOCIAL_EXPLORER_NO_ACCESS_TO_DELETE'));
     }
     // Get the file id
     $ids = JRequest::getInt('id');
     $ids = FD::makeArray($ids);
     foreach ($ids as $id) {
         $file = FD::table('File');
         $file->load($id);
         if (!$id || !$file->id) {
             return FD::exception(JText::_('COM_EASYSOCIAL_EXPLORER_INVALID_FILE_ID_PROVIDED'));
         }
         $state = $file->delete();
         if (!$state) {
             return FD::exception(JText::_($file->getError()));
         }
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:29,代码来源:user.php

示例15: publish

 /**
  * Publishes a point
  *
  * @since	1.0
  * @access	public
  */
 public function publish()
 {
     // Check for request forgeries.
     FD::checkToken();
     $id = JRequest::getVar('cid');
     // Get current view
     $view = $this->getCurrentView();
     // Get current task
     $task = $this->getTask();
     // Ensure that it's an array.
     $ids = FD::makeArray($id);
     if (empty($id)) {
         $view->setMessage(JText::_('COM_EASYSOCIAL_POINTS_INVALID_ID_PROVIDED'), SOCIAL_MSG_ERROR);
         return $view->call(__FUNCTION__);
     }
     foreach ($ids as $id) {
         $point = FD::table('Points');
         $point->load($id);
         $point->{$task}();
     }
     $message = $task == 'publish' ? 'COM_EASYSOCIAL_POINTS_PUBLISHED_SUCCESSFULLY' : 'COM_EASYSOCIAL_POINTS_UNPUBLISHED_SUCCESSFULLY';
     $view->setMessage(JText::_($message), SOCIAL_MSG_SUCCESS);
     return $view->call(__FUNCTION__);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:30,代码来源:points.php


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