Beispiel #1
0
 /**
  * Generate macro output
  *
  * @return     string
  */
 public function render()
 {
     // check if we can render
     if (!parent::canRender()) {
         return \Lang::txt('[This macro is designed for Groups only]');
     }
     // get args
     $args = $this->getArgs();
     //array of filters
     $filters = array('limit' => count($args) == 1 && is_numeric($args[0]) ? $args[0] : 12);
     // get members
     $members = $this->getGroupMembers($this->group, $filters);
     //are we a group member
     $isMember = in_array(\User::get('id'), $this->group->get('members')) ? true : false;
     //get the members plugin access for this group
     $memberAccess = \Hubzero\User\Group\Helper::getPluginAccess($this->group, 'members');
     // make sure we can actually display for the current user
     if ($memberAccess == 'anyone' || $memberAccess == 'registered' && !User::isGuest() || $memberAccess == 'members' && $isMember) {
         $html = $this->renderMembers($this->group, $members);
     } else {
         $html = '';
     }
     //return rendered events
     return $html;
 }
Beispiel #2
0
 /**
  * Generate macro output
  *
  * @return     string
  */
 public function render()
 {
     // check if we can render
     if (!parent::canRender()) {
         return \Lang::txt('[This macro is designed for Groups only]');
     }
     // get args
     $args = $this->getArgs();
     // get details
     $type = $this->_getType($args, 'all');
     $limit = $this->_getLimit($args, 5);
     $class = $this->_getClass($args);
     //get resources
     $groupResources = $this->_getResources($type, $limit);
     $html = '<div class="resources ' . $class . '">';
     foreach ($groupResources as $resource) {
         $area = strtolower(preg_replace("/[^a-zA-Z0-9]/", '', $resource->area));
         $resourceLink = \Route::url('index.php?option=com_resources&id=' . $resource->id);
         $resourceTypeLink = \Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&active=resources&area=' . $area);
         $html .= '<a href="' . $resourceLink . '"><strong>' . $resource->title . '</strong></a>';
         $html .= '<p class="category"> in: <a href="' . $resourceTypeLink . '">' . $resource->area . '</a></p>';
         $html .= '<p>' . \Hubzero\Utility\String::truncate($resource->itext) . '</p>';
     }
     $html .= '</div>';
     return $html;
 }
 /**
  * Generate macro output
  *
  * @return     string
  */
 public function render()
 {
     // check if we can render
     if (!parent::canRender()) {
         return \Lang::txt('[This macro is designed for Groups only]');
     }
     // add required helper lib
     require_once PATH_CORE . DS . 'components' . DS . 'com_groups' . DS . 'helpers' . DS . 'pages.php';
     // get default home page
     $html = \Components\Groups\Helpers\Pages::getDefaultHomePage($this->group);
     //return rendered events
     return $html;
 }
Beispiel #4
0
 /**
  * Generate macro output
  *
  * @return  string
  */
 public function render()
 {
     // check if we can render
     if (!parent::canRender()) {
         return \Lang::txt('[This macro is designed for Groups only]');
     }
     // get args
     $arg = strtolower($this->getArgument(0));
     if (!$arg && !$this->open) {
         return;
     }
     if (in_array($arg, array('start', 'open', 'begin'))) {
         $this->open = true;
         return '<public>';
     }
     $this->open = false;
     return '</public>';
 }
Beispiel #5
0
 /**
  * Generate macro output
  *
  * @return     string
  */
 public function render()
 {
     // check if we can render
     if (!parent::canRender()) {
         return \Lang::txt('[This macro is designed for Groups only]');
     }
     // get args
     $args = $this->getArgs();
     //array of filters
     $filters = array('limit' => isset($args[0]) && is_numeric($args[0]) ? $args[0] : 3);
     //get group events
     $events = $this->getGroupEvents($this->group, $filters);
     //create the html container
     $html = '<div class="upcoming_events">';
     //render the events
     $html .= $this->renderEvents($this->group, $events);
     //close the container
     $html .= '</div>';
     //return rendered events
     return $html;
 }
Beispiel #6
0
    /**
     * Generate macro output
     *
     * @return  string
     */
    public function render()
    {
        // Check if we can render
        if (!parent::canRender()) {
            return \Lang::txt('[This macro is designed for Groups only]');
        }
        // Get the arguments
        $args = $this->getArgs();
        // No arguments passed? Can't do anything.
        if (empty($args)) {
            return;
        }
        // Clean up the args
        $args = array_map('trim', $args);
        @(list($url, $delay) = $args);
        $delay = intval($delay);
        // No delay time? Redirect now.
        if (!$delay) {
            return \App::redirect($url);
        }
        // Delayed redirect
        return '<script type="text/javascript">setTimeout(function () { window.location.href = "' . str_replace(array("'", '"'), array('%27', '%22'), $url) . '"; }, ' . $delay * 1000 . ');</script>
				<p class="warning">' . \Lang::txt('This page will redirect in %s seconds', $delay) . '</p>';
    }