本文整理汇总了PHP中FD::explorer方法的典型用法代码示例。如果您正苦于以下问题:PHP FD::explorer方法的具体用法?PHP FD::explorer怎么用?PHP FD::explorer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FD
的用法示例。
在下文中一共展示了FD::explorer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook
/**
* Service Hook for explorer
*
* @since 1.3
* @access public
* @param string
* @return
*/
public function hook()
{
// Check for request forgeries
FD::checkToken();
// Require the user to be logged in
FD::requireLogin();
// Get the event object
$uid = $this->input->get('uid', 0, 'int');
$type = $this->input->get('type', '', 'cmd');
// Load up the explorer library
$explorer = FD::explorer($uid, $type);
// Determine if the viewer can really view items
if (!$explorer->hook('canViewItem')) {
return $this->view->call(__FUNCTION__);
}
// Get the hook
$hook = $this->input->get('hook', '', 'cmd');
// Get the result
$result = $explorer->hook($hook);
$exception = FD::exception('Folder retrieval successful', SOCIAL_MSG_SUCCESS);
return $this->view->call(__FUNCTION__, $exception, $result);
}
示例2: display
public function display($eventId = null, $docType = null)
{
// Load up the event
$event = FD::event($eventId);
// Only allow event members access here.
if (!$event->getGuest()->isGuest()) {
return $this->redirect($event->getPermalink(false));
}
// Load up the explorer library.
$explorer = FD::explorer($event->id, SOCIAL_TYPE_EVENT);
// Get total number of files that are already uploaded in the event
$model = FD::model('Files');
$total = (int) $model->getTotalFiles($event->id, SOCIAL_TYPE_EVENT);
// Get the access object
$access = $event->getAccess();
// Determines if the event exceeded their limits
$allowUpload = $access->get('files.max') == 0 || $total < $access->get('files.max') ? true : false;
$uploadLimit = $access->get('files.maxsize');
$this->set('uploadLimit', $uploadLimit);
$this->set('allowUpload', $allowUpload);
$this->set('explorer', $explorer);
$this->set('event', $event);
echo parent::display('events/default');
}
示例3: browser
/**
* Renders the file browser
*
* @since 1.2
* @access public
* @param string
* @return
*/
public function browser()
{
$ajax = FD::ajax();
$uid = JRequest::getInt('uid');
$type = JRequest::getCmd('type');
$url = JRequest::getVar('url');
// Load up the explorer library
$explorer = FD::explorer($uid, $type);
// We need to determine if the user is allowed to access
if (!$explorer->hook('hasReadAccess')) {
return $ajax->reject();
}
$allowUpload = $explorer->hook('allowUpload');
$maxSize = $explorer->hook('getMaxSize');
$html = $explorer->render($url, array('allowUpload' => $allowUpload, 'uploadLimit' => $maxSize));
return $ajax->resolve($html);
}
示例4: browser
/**
* Renders the file browser
*
* @since 1.2
* @access public
* @param string
* @return
*/
public function browser()
{
$ajax = FD::ajax();
$uid = JRequest::getInt('uid');
$type = JRequest::getCmd('type');
$url = JRequest::getVar('url');
$controllerName = $this->input->getString('controllerName');
// Load up the explorer library
$explorer = FD::explorer($uid, $type);
// We need to determine if the user is allowed to access
if (!$explorer->hook('hasReadAccess')) {
return $ajax->reject();
}
$allowUpload = $explorer->hook('allowUpload');
$maxSize = $explorer->hook('getMaxSize');
$options = array('allowUpload' => $allowUpload, 'uploadLimit' => $maxSize);
if (!empty($controllerName)) {
$options['controllerName'] = $controllerName;
}
$html = $explorer->render($url, $options);
return $ajax->resolve($html);
}