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


PHP FD::get方法代码示例

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


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

示例1: add

 /**
  * type : 'profile' == profile status,
  * content : shared content.
  */
 public function add()
 {
     $type = JRequest::getString('type');
     $content = JRequest::getVar('text');
     $my = FD::get('People');
     $streamId = '';
     switch ($type) {
         case 'profile':
             $data = array();
             $data['actor_node_id'] = $my->get('node_id');
             $data['node_id'] = '1';
             $data['content'] = $content;
             $storyTbl = FD::table('Story');
             $storyTbl->bind($data);
             $storyTbl->store();
             $streamId = $storyTbl->streamId;
             if (!empty($streamId)) {
                 $story = FD::get('Stream')->get('people', '', '', false, $streamId);
                 FD::get('AJAX')->success($story[0]);
                 return;
             }
             break;
         default:
             break;
     }
     FD::get('AJAX')->success();
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:31,代码来源:view.ajax.php

示例2: getTitle

 /**
  * Retrieve the title of the stream
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function getTitle()
 {
     // Get the actors
     $actors = $this->item->actors;
     // Get the source id
     $sourceId = $this->share->uid;
     // Load the stream
     $stream = FD::table('Stream');
     $stream->load($sourceId);
     // If stream cannot be loaded, skip this altogether
     if (!$stream->id) {
         return;
     }
     // Build the permalink to the stream item
     $link = FRoute::stream(array('layout' => 'item', 'id' => $sourceId));
     // Get the target user.
     $target = FD::user($stream->actor_id);
     $actor = $actors[0];
     $theme = FD::get('Themes');
     $theme->set('actor', $actor);
     $theme->set('link', $link);
     $theme->set('target', $target);
     $title = $theme->output('apps/group/shares/streams/stream/title');
     return $title;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:33,代码来源:stream.php

示例3: load

 public function load($path)
 {
     // Locate for the manifest file in the folder.
     $files = FD::get('Folders')->files($path, '.xml', self::RECURSIVE_SEARCH, self::RETRIEVE_FULL_PATH);
     $this->source = $path;
     if (!count($files)) {
         // Throw errors
         FD::get('Errors')->set('installer.xml', self::XML_NOT_FOUND);
         return false;
     }
     // Load through the list of manifest files to perform the installation.
     foreach ($files as $file) {
         $xml = JFactory::getXML($file);
         if (!$xml) {
             FD::get('Errors')->set('installer', self::XML_NOT_VALID);
             unset($xml);
             continue;
         }
         $this->type = (string) $xml->attributes()->type;
         if ($xml->getName() != 'social' || !in_array($this->type, $this->allowed)) {
             FD::get('Errors')->set('installer', self::XML_NOT_VALID);
             unset($parser);
             continue;
         }
         $this->parser = JFactory::getXMLParser('Simple');
         $this->parser->loadFile($file);
         // Set the path of the current xml file.
         $this->path = $file;
         // Retrieves the element
         $this->element = $this->parser->document->getElementByPath('element')->data();
         unset($xml);
         return true;
     }
     return false;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:35,代码来源:joomla17.php

示例4: 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 = $this->input->get('urls', array(), 'array');
     // Result placeholder
     $result = array();
     if (!$urls) {
         $this->view->setMessage('COM_EASYSOCIAL_CRAWLER_INVALID_URL_PROVIDED', SOCIAL_MSG_ERROR);
         return $this->view->call(__FUNCTION__);
     }
     // Get the crawler
     $crawler = FD::get('crawler');
     foreach ($urls as $url) {
         // Generate a hash for the 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);
             // Get the data from our crawler library
             $data = $crawler->getData();
             // Now we need to cache the link so that the next time, we don't crawl it again.
             $link->hash = $hash;
             $link->data = json_encode($data);
             $link->store();
         }
         $result[$url] = json_decode($link->data);
     }
     return $this->view->call(__FUNCTION__, $result);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:37,代码来源:crawler.php

示例5: display

 public function display($theme = null)
 {
     if (is_null($theme)) {
         $theme = FD::get('Themes');
     }
     return $this->theme->output($theme);
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:7,代码来源:applications.php

示例6: load

 /**
  * Loads the installation file based on a given path.
  *
  * @since	1.0
  * @access	public
  * @param	string	The installation path to lookup for.
  * @return	bool	True if loaded successfully, false otherwise.
  *
  * @author	Mark Lee <mark@stackideas.com>
  */
 public function load($path)
 {
     // Locate for the manifest file in the folder.
     $files = JFolder::files($path, '.xml', self::RECURSIVE_SEARCH, self::RETRIEVE_FULL_PATH);
     // Set the source so the parent can manipulate it ?
     $this->source = $path;
     // If there's no .xml files, throw errors here.
     if (!$files || count($files) <= 0) {
         $this->setError(JText::_('Manifest file does not exist.'));
         return false;
     }
     // Load through the list of manifest files to perform the installation.
     foreach ($files as $file) {
         $parser = FD::get('Parser');
         // Render the xml file.
         $parser->load($file);
         // Set the app type.
         $this->type = (string) $parser->attributes()->type;
         // Set the app group.
         $this->group = (string) $parser->attributes()->group;
         if ($parser->getName() != self::XML_NAMESPACE || !in_array($this->type, $this->allowed)) {
             $this->setError(JText::_('Manifest file is not a valid EasySocial application'));
             continue;
         }
         // Set the path of the current xml file.
         $this->path = $file;
         // Retrieves the element
         $childs = $parser->children();
         $this->element = (string) $childs->element;
         // Assign the parser into the property.
         $this->parser = $parser;
         return true;
     }
     return false;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:45,代码来源:joomla25.php

示例7: create_report

 public function create_report()
 {
     $app = JFactory::getApplication();
     $msg = $app->input->get('message', '', 'STRING');
     $title = $app->input->get('user_title', '', 'STRING');
     $item_id = $app->input->get('itemId', 0, 'INT');
     $log_user = $this->plugin->get('user')->id;
     $data = array();
     $data['message'] = $msg;
     $data['uid'] = $item_id;
     $data['type'] = 'stream';
     $data['title'] = $title;
     $data['extension'] = 'com_easysocial';
     //build share url use for share post through app
     $sharing = FD::get('Sharing', array('url' => FRoute::stream(array('layout' => 'item', 'id' => $item_id, 'external' => true, 'xhtml' => true)), 'display' => 'dialog', 'text' => JText::_('COM_EASYSOCIAL_STREAM_SOCIAL'), 'css' => 'fd-small'));
     $url = $sharing->url;
     $data['url'] = $url;
     // Get the reports model
     $model = FD::model('Reports');
     // Determine if this user has the permissions to submit reports.
     $access = FD::access();
     // Determine if this user has exceeded the number of reports that they can submit
     $total = $model->getCount(array('created_by' => $log_user));
     if ($access->exceeded('reports.limit', $total)) {
         $final_result['message'] = "Limit exceeds";
         $final_result['status'] = true;
         return $final_result;
     }
     // Create the report
     $report = FD::table('Report');
     $report->bind($data);
     // Set the creator id.
     $report->created_by = $log_user;
     // Set the default state of the report to new
     $report->state = 0;
     // Try to store the report.
     $state = $report->store();
     // If there's an error, throw it
     if (!$state) {
         $final_result['message'] = "Can't save report";
         $final_result['status'] = true;
         return $final_result;
     }
     // @badge: reports.create
     // Add badge for the author when a report is created.
     $badge = FD::badges();
     $badge->log('com_easysocial', 'reports.create', $log_user, JText::_('COM_EASYSOCIAL_REPORTS_BADGE_CREATED_REPORT'));
     // @points: reports.create
     // Add points for the author when a report is created.
     $points = FD::points();
     $points->assign('reports.create', 'com_easysocial', $log_user);
     // Determine if we should send an email
     $config = FD::config();
     if ($config->get('reports.notifications.moderators')) {
         $report->notify();
     }
     $final_result['message'] = "Report logged successfully!";
     $final_result['status'] = true;
     return $final_result;
 }
开发者ID:yalive,项目名称:com_api-plugins,代码行数:60,代码来源:report.php

示例8: onPrepareStoryPanel

 public function onPrepareStoryPanel($story)
 {
     if ($story->clusterType != SOCIAL_TYPE_GROUP) {
         return;
     }
     $params = $this->getParams();
     // Determine if we should attach ourselves here.
     if (!$params->get('story_event', true)) {
         return;
     }
     if (!FD::config()->get('events.enabled')) {
         return;
     }
     // Create plugin object
     $plugin = $story->createPlugin('event', 'panel');
     // Get the theme class
     $theme = FD::themes();
     // Get the available event category
     $categories = FD::model('EventCategories')->getCreatableCategories(FD::user()->getProfile()->id);
     $theme->set('categories', $categories);
     $plugin->button->html = $theme->output('apps/user/events/story/panel.button');
     $plugin->content->html = $theme->output('apps/user/events/story/panel.content');
     $script = FD::get('Script');
     $plugin->script = $script->output('apps:/user/events/story');
     return $plugin;
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:26,代码来源:events.php

示例9: 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

示例10: getAjaxTemplate

 public function getAjaxTemplate()
 {
     $templateFiles = JRequest::getVar('names');
     // Ensure the integrity of each items submitted to be an array.
     if (!is_array($templateFiles)) {
         $templateFiles = array($templateFiles);
     }
     $result = array();
     $theme = FD::get('Themes');
     foreach ($templateFiles as $file) {
         // Remove any trailing .ejs in file name if exist.
         $file = str_replace('.ejs', '', $file);
         $template = $theme->getTemplate($file);
         ob_start();
         include $template->ejs;
         $output = ob_get_contents();
         ob_end_clean();
         $obj = new stdClass();
         $obj->name = $file;
         $obj->content = $output;
         $result[] = $obj;
     }
     if (!$result) {
         header('HTTP/1.1 404 Not Found');
         exit;
     }
     header('Content-type: text/x-json; UTF-8');
     $json = FD::json();
     echo $json->encode($result);
     exit;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:31,代码来源:themes.php

示例11: proxy

 /**
  * Does a remote call to the server to fetch contents of a given url.
  *
  * @since	1.0
  * @access	public
  */
 public function proxy()
 {
     $type = JRequest::getWord('type');
     $url = JRequest::getVar('url');
     // Currently we only support serving of images
     if ($type != 'image') {
         $this->blank();
     }
     // dump($url);
     $connector = FD::get('Connector');
     $connector->addUrl($url);
     $connector->connect();
     $contents = $connector->getResult($url, true);
     list($headers, $output) = explode("\r\n\r\n", $contents);
     // Get the content type
     $pattern = '/Content-Type: (.*)/i';
     preg_match($pattern, $headers, $matches);
     if (!$matches || empty($matches) || !isset($matches[1])) {
         $this->blank();
     }
     $contentType = strtolower(trim($matches[1]));
     $allowedTypes = array('image/png', 'image/jpeg', 'image/gif', 'image/bmp');
     // Only allow image types
     if (!in_array($contentType, $allowedTypes)) {
         $this->blank();
     }
     header('Content-Type: ' . $contentType);
     header('Content-Length: ' . strlen($output));
     echo $output;
     exit;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:37,代码来源:view.html.php

示例12: createCover

 /**
  * Some desc
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function createCover($file, $inputName)
 {
     // Load our own image library
     $image = FD::image();
     // Generates a unique name for this image.
     $name = $file['name'];
     // Load up the file.
     $image->load($file['tmp_name'], $name);
     // Ensure that the image is valid.
     if (!$image->isValid()) {
         // @TODO: Add some logging here.
         echo JText::_('PLG_FIELDS_AVATAR_VALIDATION_INVALID_IMAGE');
         exit;
     }
     // Get the storage path
     $storage = SocialFieldsUserCoverHelper::getStoragePath($inputName);
     // Create a new avatar object.
     $photos = FD::get('Photos', $image);
     // Create avatars
     $sizes = $photos->create($storage);
     // We want to format the output to get the full absolute url.
     $base = basename($storage);
     $result = array();
     foreach ($sizes as $size => $value) {
         $row = new stdClass();
         $row->title = $file['name'];
         $row->file = $value;
         $row->path = JPATH_ROOT . '/media/com_easysocial/tmp/' . $base . '/' . $value;
         $row->uri = rtrim(JURI::root(), '/') . '/media/com_easysocial/tmp/' . $base . '/' . $value;
         $result[$size] = $row;
     }
     return $result;
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:41,代码来源:ajax.php

示例13: main

 public function main()
 {
     $db = FD::db();
     $sql = $db->sql();
     $sql->select('#__social_apps');
     $sql->where('type', 'fields');
     $db->setQuery($sql);
     $result = $db->loadObjectList();
     foreach ($result as $row) {
         $file = SOCIAL_FIELDS . '/' . $row->group . '/' . $row->element . '/' . $row->element . '.xml';
         if (!JFile::exists($file)) {
             continue;
         }
         $table = FD::table('App');
         $table->bind($row);
         $parser = FD::get('Parser');
         $parser->load($file);
         $val = $parser->xpath('unique');
         $unique = 0;
         if ($val) {
             $unique = (string) $val[0];
             $unique = $unique == 'true' ? 1 : 0;
         }
         $table->unique = $unique;
         $table->store();
     }
     return true;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:28,代码来源:FixFieldUniqueValue.php

示例14: form

 /**
  * Displays the settings form for the respective page.
  *
  * @since	1.0
  * @access	public
  * @param	null
  * @return	null
  * @author	Mark Lee <mark@stackideas.com>
  */
 public function form()
 {
     // Get the current page.
     $page = JRequest::getVar('page', '');
     // Get info object.
     $info = FD::info();
     if (empty($page)) {
         // @TODO: Log errors here.
         $info->set(JText::_('No page provided'), SOCIAL_MSG_ERROR);
         $this->redirect('index.php?option=com_easysocial');
     }
     // Add Joomla toolbar buttons
     JToolbarHelper::apply();
     JToolbarHelper::custom('export', 'export', '', JText::_('COM_EASYSOCIAL_SETTINGS_EXPORT_SETTINGS'), false);
     JToolbarHelper::custom('import', 'import', '', JText::_('COM_EASYSOCIAL_SETTINGS_IMPORT_SETTINGS'), false);
     JToolbarHelper::custom('reset', 'default', '', JText::_('COM_EASYSOCIAL_RESET_TO_FACTORY'), false);
     // We need to include the theme file's header info.
     $theme = FD::get('Themes');
     $paths = $theme->getTemplate('admin/settings/headers/' . $page);
     if (JFile::exists($paths->file)) {
         include $paths->file;
     }
     // Ensure that page is in proper string format.
     $page = strtolower($page);
     // Set the page to the class for other method to access
     $this->section = $page;
     // Set the page variable.
     $this->set('page', $page);
     // Set settings view variable
     $this->set('settings', $this);
     echo parent::display('admin/settings/form.container');
 }
开发者ID:ppantilla,项目名称:bbninja,代码行数:41,代码来源:view.html.php

示例15: render

 /**
  * Renders the form
  *
  * @since	1.0
  * @access	public
  * @param	null
  *
  */
 public function render($tabs = false, $sidebarTabs = false, $active = '', $prefix = '', $processActiveTab = true)
 {
     // Load our custom theme.
     $theme = FD::get('Themes');
     $type = $tabs ? 'default.tabs' : 'default';
     foreach ($this->form as &$form) {
         foreach ($form->fields as &$field) {
             // Ensure that the default property exists
             if (!isset($field->default)) {
                 $field->default = '';
             }
             // Ensure that the suffix exists
             if (!isset($field->suffix)) {
                 $field->suffix = '';
             }
             $field->inputName = $prefix ? $prefix . '[' . $field->name . ']' : $field->name;
             // Translate suffix if neccessary
             $field->suffix = JText::_($field->suffix);
             // Custom renderer based on type
             // Need to support apps renderer as well
             // apps:/path/to/file or apps:/[group]/[element]/renderer/[nameInCamelCase]
             // class SocialFormRenderer[NameInCamelCase]
             $rendererType = $field->type;
             $file = dirname(__FILE__) . '/renderer/' . strtolower($rendererType) . '.php';
             // Check for :
             if (strpos($field->type, ':') !== false) {
                 list($protocol, $path) = explode(':', $field->type);
                 $segments = explode('/', $path);
                 $rendererType = array_pop($segments);
                 $base = defined('SOCIAL_' . strtoupper($protocol)) ? constant('SOCIAL_' . strtoupper($protocol)) : SOCIAL_ADMIN;
                 $file = $base . $path . '.php';
             }
             if (JFile::exists($file)) {
                 require_once $file;
                 $className = 'SocialFormRenderer' . ucfirst($rendererType);
                 if (class_exists($className)) {
                     $renderer = new $className();
                     $renderer->render($field, $this->params);
                 }
             }
         }
     }
     // Replacements for invalid keys
     $invalidKeys = array(' ', ',', '&', '.', '*');
     // Generate unique id so multiple tabs form on a single page would not conflict
     $uid = uniqid();
     $theme->set('invalidKeys', $invalidKeys);
     $theme->set('uid', $uid);
     $theme->set('processActiveTab', $processActiveTab);
     $theme->set('prefix', $prefix);
     $theme->set('active', $active);
     $theme->set('sidebarTabs', $sidebarTabs);
     $theme->set('tabs', $tabs);
     $theme->set('params', $this->params);
     $theme->set('forms', $this->form);
     $template = 'admin/forms/' . $type;
     $contents = $theme->output($template);
     return $contents;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:67,代码来源:form.php


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