Exemple #1
0
 /**
  * Return data on a publication view (this will be some form of HTML)
  *
  * @param   object   $publication
  * @param   string   $option
  * @param   array    $areas
  * @param   string   $rtrn
  * @param   string   $version
  * @param   boolean  $extended
  * @return  array
  */
 public function onPublication($publication, $option, $areas, $rtrn = 'all', $version = 'default', $extended = true)
 {
     $arr = array('html' => '', 'metadata' => '', 'name' => 'share');
     // Hide if version not published
     if (!$extended || in_array($publication->state, array(4, 5, 6))) {
         return $arr;
     }
     $sef = Route::url('index.php?option=' . $option . '&id=' . $publication->id);
     $sef = rtrim($sef, '/') . '/?v=' . $publication->version_number;
     $url = Request::base() . ltrim($sef, '/');
     $mediaUrl = Request::base() . trim($sef, '/') . '/' . $publication->version_id . '/Image:master';
     // Incoming action
     $sharewith = Request::getVar('sharewith', '');
     if ($sharewith) {
         if (!User::isGuest()) {
             // Log the activity
             Event::trigger('system.logActivity', ['activity' => ['action' => 'shared', 'scope' => 'publication', 'scope_id' => $publication->id, 'description' => Lang::txt('PLG_PUBLICATIONS_SHARE_ENTRY_SHARED', '<a href="' . $sef . '">' . $publication->title . '</a>', $sharewith), 'details' => array('with' => $sharewith, 'title' => $publication->title, 'url' => $sef, 'version' => $publication->version_number)], 'recipients' => [['publication', $publication->id], ['user', $publication->created_by], ['user', User::get('id')]]]);
         }
         return $this->share($sharewith, $url, $mediaUrl, $publication, $version);
     }
     // Build the HTML meant for the "about" tab's metadata overview
     if ($rtrn == 'all' || $rtrn == 'metadata') {
         // Instantiate a view
         $view = $this->view('default', 'options')->set('option', $option)->set('publication', $publication)->set('version', $version)->set('_params', $this->params)->set('url', $url)->setErrors($this->getErrors());
         // Return the output
         $arr['metadata'] = $view->loadTemplate();
     }
     return $arr;
 }
Exemple #2
0
 /**
  * Method to get the field input markup for a generic list.
  * Use the multiple attribute to enable multiselect.
  *
  * @return  string  The field input markup.
  */
 protected function getInput()
 {
     // Initialize variables.
     $attributes = array('type' => 'text', 'value' => htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8'), 'name' => $this->name, 'id' => $this->id, 'size' => $this->element['size'] ? (int) $this->element['size'] : '', 'maxlength' => $this->element['maxlength'] ? (int) $this->element['maxlength'] : '', 'class' => 'orcid' . ($this->element['class'] ? (string) $this->element['class'] : ''), 'autocomplete' => (string) $this->element['autocomplete'] == 'off' ? 'off' : '', 'readonly' => (string) $this->element['readonly'] == 'true' ? 'readonly' : '', 'disabled' => (string) $this->element['disabled'] == 'true' ? 'disabled' : '', 'onchange' => $this->element['onchange'] ? (string) $this->element['onchange'] : '');
     $attr = array();
     foreach ($attributes as $key => $value) {
         if ($key != 'value' && !$value) {
             continue;
         }
         $attr[] = $key . '="' . $value . '"';
     }
     $attr = implode(' ', $attr);
     $html = array();
     $html[] = '<div class="grid">';
     $html[] = '	<div class="col span9">';
     $html[] = '		<input ' . $attr . ' placeholder="####-####-####-####" />';
     $html[] = '		<input type="hidden" name="base_uri" id="base_uri" value="' . rtrim(Request::base(true), '/') . '" />';
     $html[] = '	</div>';
     $html[] = '	<div class="col span3 omega">';
     $html[] = '		<a class="btn button icon-search orcid-fetch" data-base="' . rtrim(Request::base(true), '/') . '" data-id="' . $this->id . '" href="' . Request::base() . '/' . Route::url('index.php?option=com_members&controller=orcid') . '">' . Lang::txt('COM_MEMBERS_PROFILE_ORCID_FIND') . '</a>';
     $html[] = '	</div>';
     $html[] = '</div>';
     $html[] = '<p><img src="' . Request::root() . '/core/components/com_members/site/assets/img/orcid-logo.png" width="80" alt="ORCID" /> ' . Lang::txt('COM_MEMBERS_PROFILE_ORCID_ABOUT') . '</p>';
     Behavior::framework(true);
     Behavior::modal();
     if (file_exists(PATH_ROOT . '/core/components/com_members/site/assets/js/orcid.js')) {
         Document::addScript('/core/components/com_members/site/assets/js/orcid.js?t=' . filemtime(PATH_ROOT . '/core/components/com_members/site/assets/js/orcid.js'));
     }
     return implode($html);
 }
Exemple #3
0
 /**
  * Return data on a resource view (this will be some form of HTML)
  *
  * @param   object  $resource  Current resource
  * @param   string  $option    Name of the component
  * @param   array   $areas     Active area(s)
  * @param   string  $rtrn      Data to be returned
  * @return  array
  */
 public function onResources($model, $option, $areas, $rtrn = 'all')
 {
     if (!$model->type->params->get('plg_share')) {
         return;
     }
     $arr = array('area' => $this->_name, 'html' => '', 'metadata' => '');
     $resource = $model->resource;
     $sef = Route::url('index.php?option=com_resources&' . ($resource->alias ? 'alias=' . $resource->alias : 'id=' . $resource->id));
     $url = Request::base() . ltrim($sef, '/');
     // Incoming action
     $sharewith = Request::getVar('sharewith', '');
     if ($sharewith) {
         // Log the activity
         if (!User::isGuest()) {
             Event::trigger('system.logActivity', ['activity' => ['action' => 'shared', 'scope' => 'resource', 'scope_id' => $resource->id, 'description' => Lang::txt('PLG_RESOURCES_SHARE_ENTRY_SHARED', '<a href="' . $sef . '">' . $resource->title . '</a>', $sharewith), 'details' => array('with' => $sharewith, 'title' => $resource->title, 'url' => $sef)], 'recipients' => [['resource', $resource->id], ['user', $resource->created_by], ['user', User::get('id')]]]);
         }
         // Email form
         if ($sharewith == 'email') {
             // Instantiate a view
             $view = $this->view('email', 'options')->set('option', $option)->set('resource', $resource)->set('_params', $this->params)->set('url', $url)->setErrors($this->getErrors());
             // Return the output
             $view->display();
             exit;
         }
         return $this->share($sharewith, $url, $resource);
     }
     // Build the HTML meant for the "about" tab's metadata overview
     if ($rtrn == 'all' || $rtrn == 'metadata') {
         // Instantiate a view
         $view = $this->view('default', 'options')->set('option', $option)->set('resource', $resource)->set('_params', $this->params)->set('url', $url)->setErrors($this->getErrors());
         // Return the output
         $arr['metadata'] = $view->loadTemplate();
     }
     return $arr;
 }
 /**
  * Set transaction details
  *
  */
 public function setTransactionDetails($transactionDetails)
 {
     $this->transactionDetails = array();
     $this->transactionDetails['EXT_TRANS_ID'] = $transactionDetails->info->tId;
     $this->transactionDetails['EXT_TRANS_ID_LABEL'] = $this->options->transactionName;
     $this->transactionDetails['AMT'] = $transactionDetails->info->tiTotal;
     $this->transactionDetails['VALIDATION_KEY'] = $this->generateValidationKey();
     $this->transactionDetails['SUCCESS_LINK'] = Request::base() . 'cart' . DS . 'order' . DS . 'complete?tId=' . $transactionDetails->token . '-' . $transactionDetails->info->tId;
 }
Exemple #5
0
 /**
  * Pull records and build the XML
  *
  * @return  void
  */
 public function displayTask()
 {
     // Incoming
     $metadata = Request::getVar('metadataPrefix', 'oai_dc');
     $from = Request::getVar('from');
     if ($from) {
         $from = Date::of($from)->toSql();
     }
     $until = Request::getVar('until');
     if ($until) {
         $until = Date::of($until)->toSql();
     }
     $set = Request::getVar('set');
     $resumption = Request::getVar('resumptionToken');
     $igran = "YYYY-MM-DD";
     $igran .= $this->config->get('gran', 'c') == 'c' ? "Thh:mm:ssZ" : '';
     $hubname = rtrim($this->config->get('base_url', str_replace('https', 'http', \Request::base())), '/');
     $edate = $this->config->get('edate');
     $edate = $edate ? strtotime($edate) : time();
     $service = new Service($metadata, rtrim(Request::getSchemeAndHttpHost(), '/') . Route::url('index.php?option=' . $this->_option . '&task=stylesheet&metadataPrefix=' . $metadata));
     $service->set('metadataPrefix', $metadata)->set('repositoryName', $this->config->get('repository_name', \Config::get('sitename')))->set('baseURL', $hubname)->set('protocolVersion', '2.0')->set('adminEmail', $this->config->get('email', \Config::get('mailfrom')))->set('earliestDatestamp', gmdate('Y-m-d\\Th:i:s\\Z', $edate))->set('deletedRecord', $this->config->get('del'))->set('granularity', $igran)->set('max', $this->config->get('max', 500))->set('limit', $this->config->get('limig', 50))->set('allow_ore', $this->config->get('allow_ore', 0))->set('gran', $this->config->get('gran', 'c'))->set('resumption', $resumption);
     $verb = Request::getVar('verb');
     switch ($verb) {
         case 'GetRecord':
             $service->record(Request::getVar('identifier'));
             break;
         case 'Identify':
             $service->identify();
             break;
         case 'ListMetadataFormats':
             $service->formats();
             break;
         case 'ListIdentifiers':
             $service->identifiers($from, $until, $set);
             break;
         case 'ListRecords':
             $sessionTokenResumptionTemp = Session::get($resumption);
             if (!empty($resumption) && empty($sessionTokenResumptionTemp)) {
                 $service->error($service::ERROR_BAD_RESUMPTION_TOKEN);
             }
             $service->records($from, $until, $set);
             break;
         case 'ListSets':
             $sessionTokenResumptionTemp = Session::get($resumption);
             if (!empty($resumption) && empty($sessionTokenResumptionTemp)) {
                 $service->error($service::ERROR_BAD_RESUMPTION_TOKEN);
             }
             $service->sets();
             break;
         default:
             $service->error($service::ERROR_BAD_VERB, Lang::txt('COM_OAIPMH_ILLEGAL_VERB'));
             break;
     }
     Document::setType('xml');
     echo $service;
 }
Exemple #6
0
    /**
     * Returns the code for a link.
     *
     * @param string $url The URL.
     * @param string $label The label.
     * @param array $options Options for the URL code (class, title, etc).
     *
     * @return string
     */
    public static function link($label, $url = null, array $attributes = array())
    {
        if ($label === null) {
            $label = $url;
        }

        $url = Request::base(ltrim($url, '/'));
        $attributes['href'] = str_replace('&', '&amp;', $url);
        $options = static::build_attributes($attributes);

        return "<a {$options}>{$label}</a>";
    }
 /**
  * Generate macro output
  *
  * @return     string
  */
 public function render()
 {
     $et = $this->args;
     $live_site = rtrim(Request::base(), '/');
     // What pages are we getting?
     if ($et) {
         $et = strip_tags($et);
         // Get pages with a prefix
         $sql = "SELECT * FROM `#__wiki_attachments` WHERE LOWER(filename) LIKE '" . strtolower($et) . "%' AND pageid='" . $this->pageid . "' ORDER BY created ASC";
     } else {
         // Get all pages
         $sql = "SELECT * FROM `#__wiki_attachments` WHERE pageid='" . $this->pageid . "' ORDER BY created ASC";
     }
     // Perform query
     $this->_db->setQuery($sql);
     $rows = $this->_db->loadObjectList();
     // Did we get a result from the database?
     if ($rows) {
         $config = Component::params('com_wiki');
         if ($this->filepath != '') {
             $config->set('filepath', $this->filepath);
         }
         $page = new \Components\Wiki\Models\Page($this->pageid);
         if ($page->get('namespace') == 'help') {
             $page->set('scope', $page->get('scope') ? rtrim($this->scope, '/') . '/' . ltrim($page->get('scope'), '/') : $this->scope);
             $page->set('group_cn', $this->domain);
         }
         // Build and return the link
         $html = '<ul>';
         foreach ($rows as $row) {
             $page->set('pagename', $page->get('pagename') . '/' . 'File:' . $row->filename);
             $link = $page->link();
             //$live_site . substr(PATH_APP, strlen(PATH_ROOT)) . DS . trim($config->get('filepath', '/site/wiki'), DS) . DS . $this->pageid . DS . $row->filename;
             $fpath = PATH_APP . DS . trim($config->get('filepath', '/site/wiki'), DS) . DS . $this->pageid . DS . $row->filename;
             $html .= '<li><a href="' . Route::url($link) . '">' . $row->filename . '</a> (' . (file_exists($fpath) ? \Hubzero\Utility\Number::formatBytes(filesize($fpath)) : '-- file not found --') . ') ';
             $huser = User::getInstance($row->created_by);
             if ($huser->get('id')) {
                 $html .= '- added by <a href="' . Route::url('index.php?option=com_members&id=' . $huser->get('id')) . '">' . stripslashes($huser->get('name')) . '</a> ';
             }
             if ($row->created && $row->created != '0000-00-00 00:00:00') {
                 $html .= Date::of($row->created)->relative() . '. ';
             }
             $html .= $row->description ? '<span>"' . stripslashes($row->description) . '"</span>' : '';
             $html .= '</li>' . "\n";
         }
         $html .= '</ul>';
         return $html;
     } else {
         // Return error message
         //return '(TitleIndex('.$et.') failed)';
         return '(No ' . $et . ' files to display)';
     }
 }
 /**
  * This method is called when the Quick Icons module is constructing its set
  * of icons. You can return an array which defines a single icon and it will
  * be rendered right after the stock Quick Icons.
  *
  * @param   $context  The calling context
  * @return  array     A list of icon definition associative arrays, consisting of the
  *                    keys link, image, text and access.
  */
 public function onGetIcons($context)
 {
     if ($context != $this->params->get('context', 'mod_quickicon') || !User::authorise('core.manage', 'com_installer')) {
         return;
     }
     $cur_template = App::get('template')->template;
     $ajax_url = Request::base() . 'index.php?option=com_installer&view=update&task=update.ajax';
     $script = "\n\t\t\tvar plg_quickicon_joomlaupdate_ajax_url = '{$ajax_url}';\n\t\t\tvar plg_quickicon_jupdatecheck_jversion = '" . JVERSION . "';\n\t\t\tvar plg_quickicon_joomlaupdate_text = {\n\t\t\t\t'UPTODATE' : '" . Lang::txt('PLG_QUICKICON_JOOMLAUPDATE_UPTODATE', true) . "',\n\t\t\t\t'UPDATEFOUND' : '" . Lang::txt('PLG_QUICKICON_JOOMLAUPDATE_UPDATEFOUND', true) . "',\n\t\t\t\t'ERROR' : '" . Lang::txt('PLG_QUICKICON_JOOMLAUPDATE_ERROR', true) . "'\n\t\t\t};\n\t\t\tvar plg_quickicon_joomlaupdate_img = {\n\t\t\t\t'UPTODATE' : '" . Request::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-uptodate.png' . "',\n\t\t\t\t'ERROR': '" . Request::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-deny.png' . "',\n\t\t\t\t'UPDATEFOUND': '" . Request::base(true) . '/templates/' . $cur_template . '/images/header/icon-48-jupdate-updatefound.png' . "'\n\t\t\t};";
     $this->js($script);
     $this->js('jupdatecheck.js');
     return array(array('link' => 'index.php?option=com_joomlaupdate', 'image' => 'header/icon-48-download.png', 'text' => Lang::txt('PLG_QUICKICON_JOOMLAUPDATE_CHECKING'), 'id' => 'plg_quickicon_joomlaupdate'));
 }
Exemple #9
0
 /**
  * Constructor
  *
  * @param   object  $db
  * @return  void
  * @throws  Exception
  */
 public function __construct($db = null)
 {
     if (!$db) {
         $db = \App::get('db');
     }
     if (!$db instanceof \Hubzero\Database\Driver && !$db instanceof \JDatabase) {
         throw new \Exception(\Lang::txt('Database must be of type JDatabase'), 500);
     }
     $this->database = $db;
     if (is_null(self::$base)) {
         self::$base = rtrim(\Request::base(), '/');
     }
 }
 /**
  * Returns an icon definition for an icon which looks for extensions updates
  * via AJAX and displays a notification when such updates are found.
  *
  * @param  $context  The calling context
  *
  * @return array A list of icon definition associative arrays, consisting of the
  *				 keys link, image, text and access.
  *
  * @since       2.5
  */
 public function onGetIcons($context)
 {
     if ($context != $this->params->get('context', 'mod_quickicon') || !User::authorise('core.manage', 'com_installer')) {
         return;
     }
     $cur_template = App::get('template')->template;
     $ajax_url = Request::base() . 'index.php?option=com_installer&view=update&task=update.ajax';
     $script = "var plg_quickicon_extensionupdate_ajax_url = '{$ajax_url}';\n";
     $script .= 'var plg_quickicon_extensionupdate_text = {"UPTODATE" : "' . Lang::txt('PLG_QUICKICON_EXTENSIONUPDATE_UPTODATE', true) . '", "UPDATEFOUND": "' . Lang::txt('PLG_QUICKICON_EXTENSIONUPDATE_UPDATEFOUND', true) . '", "ERROR": "' . Lang::txt('PLG_QUICKICON_EXTENSIONUPDATE_ERROR', true) . "\"};\n";
     $this->js($script);
     $this->js('extensionupdatecheck.js');
     return array(array('link' => 'index.php?option=com_installer&view=update', 'image' => 'header/icon-48-extension.png', 'text' => Lang::txt('PLG_QUICKICON_EXTENSIONUPDATE_CHECKING'), 'id' => 'plg_quickicon_extensionupdate'));
 }
 /**
  * Check if the current URL is one of the set rules
  *
  * @return  boolean  True if the current page is a rule
  */
 private function _checkRules()
 {
     if (!$this->_path) {
         $this->_path = $this->_parseQueryString(str_replace(\Request::base(), '', \Request::current()));
     }
     $defs = str_replace("\r", '', $this->params->def('definitions', ''));
     $defs = explode("\n", $defs);
     foreach ($defs as $def) {
         $result = $this->_parseQueryString($def);
         if ($result == $this->_path) {
             return true;
         }
     }
     return false;
 }
 /**
  * Return data on a resource view (this will be some form of HTML)
  *
  * @param   object  $resource  Current resource
  * @param   string  $option    Name of the component
  * @param   array   $areas     Active area(s)
  * @param   string  $rtrn      Data to be returned
  * @return  array
  */
 public function onResources($model, $option, $areas, $rtrn = 'all')
 {
     $arr = array('area' => $this->_name, 'html' => '', 'metadata' => '');
     // Check if our area is in the array of areas we want to return results for
     if (is_array($areas)) {
         if (!array_intersect($areas, $this->onResourcesAreas($model)) && !array_intersect($areas, array_keys($this->onResourcesAreas($model)))) {
             // do nothing
             return $arr;
         }
     }
     // Instantiate a view
     $view = $this->view('default', 'browse')->set('option', $option)->set('model', $model)->set('live_site', rtrim(Request::base(), '/'));
     // Return the output
     $arr['html'] = $view->loadTemplate();
     return $arr;
 }
Exemple #13
0
 /**
  * Set DOI service configs
  *
  * @param      mixed $idx Index value
  * @return     array
  */
 public function configs()
 {
     if (empty($this->_configs)) {
         $params = Component::params('com_publications');
         $configs = new stdClass();
         $configs->shoulder = $params->get('doi_shoulder');
         $configs->service = trim($params->get('doi_service'), DS);
         $configs->prefix = $params->get('doi_prefix');
         $configs->userpw = $params->get('doi_userpw');
         $configs->publisher = $params->get('doi_publisher', Config::get('sitename'));
         $configs->livesite = trim(Request::base(), DS);
         $configs->xmlSchema = trim($params->get('doi_xmlschema', 'http://schema.datacite.org/meta/kernel-2.1/metadata.xsd'), DS);
         $this->_configs = $configs;
     }
     return $this->_configs;
 }
Exemple #14
0
 /**
  * Return data on a resource view (this will be some form of HTML)
  *
  * @param      object  $resource Current resource
  * @param      string  $option    Name of the component
  * @param      array   $areas     Active area(s)
  * @param      string  $rtrn      Data to be returned
  * @return     array
  */
 public function onResources($model, $option, $areas, $rtrn = 'all')
 {
     if (!$model->type->params->get('plg_share')) {
         return;
     }
     $arr = array('area' => $this->_name, 'html' => '', 'metadata' => '');
     $sef = Route::url('index.php?option=' . $option . '&id=' . $model->resource->id);
     $url = Request::base() . ltrim($sef, '/');
     // Incoming action
     $sharewith = Request::getVar('sharewith', '');
     if ($sharewith && $sharewith != 'email') {
         $this->share($sharewith, $url, $model->resource);
         return;
     }
     // Email form
     if ($sharewith == 'email') {
         // Instantiate a view
         $view = new \Hubzero\Plugin\View(array('folder' => $this->_type, 'element' => $this->_name, 'name' => 'options', 'layout' => 'email'));
         // Pass the view some info
         $view->option = $option;
         $view->resource = $model->resource;
         $view->_params = $this->params;
         $view->url = $url;
         foreach ($this->getErrors() as $error) {
             $view->setError($error);
         }
         // Return the output
         $view->display();
         exit;
     }
     // Build the HTML meant for the "about" tab's metadata overview
     if ($rtrn == 'all' || $rtrn == 'metadata') {
         // Instantiate a view
         $view = new \Hubzero\Plugin\View(array('folder' => $this->_type, 'element' => $this->_name, 'name' => 'options'));
         // Pass the view some info
         $view->option = $option;
         $view->resource = $model->resource;
         $view->_params = $this->params;
         $view->url = $url;
         foreach ($this->getErrors() as $error) {
             $view->setError($error);
         }
         // Return the output
         $arr['metadata'] = $view->loadTemplate();
     }
     return $arr;
 }
Exemple #15
0
 /**
  * Generate macro output
  *
  * @return  string
  */
 public function render()
 {
     $et = $this->args;
     $live_site = rtrim(Request::base(), '/');
     // Get resource by ID
     $attach = \Components\Wiki\Models\Attachment::all()->whereEquals('page_id', $this->pageid);
     if ($et) {
         $et = strip_tags($et);
         $attach->whereLike('filename', strtolower($et) . '%');
     }
     $rows = $attach->rows();
     // Did we get a result from the database?
     if ($rows) {
         $config = Component::params('com_wiki');
         if ($this->filepath != '') {
             $config->set('filepath', $this->filepath);
         }
         $page = \Components\Wiki\Models\Page::oneOrFail($this->pageid);
         if ($page->get('namespace') == 'help') {
             $page->set('path', $page->get('path') ? rtrim($this->scope, '/') . '/' . ltrim($page->get('path'), '/') : $this->scope);
         }
         // Build and return the link
         $html = '<ul>';
         foreach ($rows as $row) {
             $page->set('pagename', $page->get('pagename') . '/' . 'File:' . $row->get('filename'));
             $link = $page->link();
             $fpath = $row->filespace() . DS . $this->pageid . DS . $row->get('filename');
             $html .= '<li><a href="' . Route::url($link) . '">' . $row->get('filename') . '</a> (' . (file_exists($fpath) ? \Hubzero\Utility\Number::formatBytes(filesize($fpath)) : '-- file not found --') . ') ';
             $huser = $row->creator();
             if ($huser->get('id')) {
                 $html .= '- added by <a href="' . Route::url('index.php?option=com_members&id=' . $huser->get('id')) . '">' . stripslashes($huser->get('name')) . '</a> ';
             }
             if ($row->get('created') && $row->get('created') != '0000-00-00 00:00:00') {
                 $html .= Date::of($row->get('created'))->relative() . '. ';
             }
             $html .= $row->get('description') ? '<span>"' . stripslashes($row->get('description')) . '"</span>' : '';
             $html .= '</li>' . "\n";
         }
         $html .= '</ul>';
         return $html;
     }
     // Return error message
     return '(No ' . $et . ' files to display)';
 }
Exemple #16
0
 /**
  * Converting the site URL to fit to the HTTP request
  *
  * @return  bool
  */
 public function onAfterRender()
 {
     if (!App::isSite() || !Config::get('sef')) {
         return true;
     }
     // Replace src links
     $base = Request::base(true) . '/';
     $buffer = App::get('response')->getContent();
     $regex = '#href="index.php\\?([^"]*)#m';
     $buffer = preg_replace_callback($regex, array('plgSystemSef', 'route'), $buffer);
     $this->checkBuffer($buffer);
     $protocols = '[a-zA-Z0-9]+:';
     //To check for all unknown protocals (a protocol must contain at least one alpahnumeric fillowed by :
     $regex = '#(src|href|poster)="(?!/|' . $protocols . '|\\#|\')([^"]*)"#m';
     $buffer = preg_replace($regex, "\$1=\"{$base}\$2\"", $buffer);
     $this->checkBuffer($buffer);
     // Onclick
     $regex = '#(onclick="window.open\\(\')(?!/|' . $protocols . '|\\#)([^/]+[^\']*?\')#m';
     $buffer = preg_replace($regex, '$1' . $base . '$2', $buffer);
     $this->checkBuffer($buffer);
     // ONMOUSEOVER / ONMOUSEOUT
     $regex = '#(onmouseover|onmouseout)="this.src=([\']+)(?!/|' . $protocols . '|\\#|\')([^"]+)"#m';
     $buffer = preg_replace($regex, '$1="this.src=$2' . $base . '$3$4"', $buffer);
     $this->checkBuffer($buffer);
     // Background image
     $regex = '#style\\s*=\\s*[\'\\"](.*):\\s*url\\s*\\([\'\\"]?(?!/|' . $protocols . '|\\#)([^\\)\'\\"]+)[\'\\"]?\\)#m';
     $buffer = preg_replace($regex, 'style="$1: url(\'' . $base . '$2$3\')', $buffer);
     $this->checkBuffer($buffer);
     // OBJECT <param name="xx", value="yy"> -- fix it only inside the <param> tag
     $regex = '#(<param\\s+)name\\s*=\\s*"(movie|src|url)"[^>]\\s*value\\s*=\\s*"(?!/|' . $protocols . '|\\#|\')([^"]*)"#m';
     $buffer = preg_replace($regex, '$1name="$2" value="' . $base . '$3"', $buffer);
     $this->checkBuffer($buffer);
     // OBJECT <param value="xx", name="yy"> -- fix it only inside the <param> tag
     $regex = '#(<param\\s+[^>]*)value\\s*=\\s*"(?!/|' . $protocols . '|\\#|\')([^"]*)"\\s*name\\s*=\\s*"(movie|src|url)"#m';
     $buffer = preg_replace($regex, '<param value="' . $base . '$2" name="$3"', $buffer);
     $this->checkBuffer($buffer);
     // OBJECT data="xx" attribute -- fix it only in the object tag
     $regex = '#(<object\\s+[^>]*)data\\s*=\\s*"(?!/|' . $protocols . '|\\#|\')([^"]*)"#m';
     $buffer = preg_replace($regex, '$1data="' . $base . '$2"$3', $buffer);
     $this->checkBuffer($buffer);
     App::get('response')->setContent($buffer);
     return true;
 }
Exemple #17
0
 /**
  * Actions to perform when logging out a user session
  *
  * @return  void
  */
 public function logout()
 {
     if (Config::get('debug')) {
         $debug_location = $this->params->get('debug_location', '/var/log/apache2/php/phpCAS.log');
         phpCAS::setDebug($debug_location);
     }
     $this->initialize();
     $service = rtrim(Request::base(), '/');
     if (empty($service)) {
         $service = $_SERVER['HTTP_HOST'];
     }
     $return = '';
     if ($return = Request::getVar('return', '', 'method', 'base64')) {
         $return = base64_decode($return);
         if (!JURI::isInternal($return)) {
             $return = '';
         }
         $return = '/' . ltrim($return, '/');
     }
     phpCAS::logout(array('service' => $service . $return, 'url' => $service . $return));
 }
Exemple #18
0
 public function __construct($base_path)
 {
     $this->_base_path = rtrim($base_path, '/');
     $this->_url_base = Request::base();
     $this->_url_path = Request::path();
     $path_arr = explode('/', strtolower($this->_url_path));
     if (!empty($path_arr[0])) {
         $this->_controller = $path_arr[0];
     }
     // foo-bar -> FooBarController
     $controller_name = str_replace('-', '', ucwords($this->_controller, '-')) . 'Controller';
     // new controller instance
     $controller_file = $this->_base_path . '/' . $controller_name . '.php';
     if (!is_file($controller_file)) {
         throw new \Exception("Invalid controller {$controller_name}");
     }
     require $controller_file;
     $controller = new $controller_name($this);
     // find action
     $args = [];
     if (!empty($path_arr[1])) {
         $route = $controller->setRoute($path_arr, $args);
         $this->_action = $route ?: $path_arr[1];
     }
     $action = str_replace('-', '', ucwords($this->_action, '-'));
     // call action
     // GET or POST or Both
     $action = (Request::isPost() ? 'post' : 'get') . $action;
     if (!method_exists($controller, $action)) {
         throw new \Exception("{$action} not exists in {$controller_name}");
     }
     if (empty($args)) {
         $controller->{$action}();
     } else {
         call_user_func_array([$controller, $action], $args);
     }
 }
Exemple #19
0
 /**
  * Set configuration to connect with outside services
  *
  * @return	   void
  */
 public function setConfigs()
 {
     // Make up redirection URL for Google service
     $redirectUri = trim(Request::base(), DS) . DS . 'projects' . DS . 'auth';
     // Scope for Google service
     $scope = array('https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/userinfo.profile', 'https://www.googleapis.com/auth/userinfo.email');
     // We will use files plugin params
     $filesParams = Plugin::params('projects', 'files');
     // Get project params
     $pparams = $this->model->params;
     $connect = array('google' => array('servicename' => 'Google Drive', 'on' => $filesParams->get('enable_google', 0), 'clientId' => $filesParams->get('google_clientId', 0), 'clientSecret' => $filesParams->get('google_clientSecret', 0), 'appKey' => $filesParams->get('google_appKey', 0), 'redirectUri' => $redirectUri, 'scope' => $scope, 'approvalPrompt' => 'force', 'accessType' => 'offline', 'local_dir' => $pparams->get('google_local_dir', '#home'), 'remote_dir' => $pparams->get('google_dir', 'Project :: ' . $this->model->get('alias')), 'remote_dir_id' => $pparams->get('google_dir_id', 1), 'active' => $pparams->get('google_token', 0)), 'dropbox' => array('servicename' => 'Dropbox', 'on' => $filesParams->get('enable_dropbox', 0), 'key' => $filesParams->get('dropbox_key', 0), 'secret' => $filesParams->get('dropbox_secret', 0), 'local_dir' => $pparams->get('dropbox_local_dir', '#home'), 'remote_dir' => $pparams->get('dropbox_dir', 'project_' . $this->model->get('alias')), 'remote_dir_id' => $pparams->get('dropbox_dir_id', 1), 'active' => $pparams->get('dropbox_service', 0)));
     $this->_connect = $connect;
 }
Exemple #20
0
 /**
  * Static method for formatting results
  *
  * @param      object $row Database row
  * @return     string HTML
  */
 public static function out($row)
 {
     $row->href = Route::url($row->href);
     $month = Date::of($row->publish_up)->toLocal('M');
     $day = Date::of($row->publish_up)->toLocal('d');
     $year = Date::of($row->publish_up)->toLocal('Y');
     // Start building the HTML
     $html = "\t" . '<li class="event">' . "\n";
     $html .= "\t\t" . '<p class="event-date"><span class="month">' . $month . '</span> <span class="day">' . $day . '</span> <span class="year">' . $year . '</span></p>' . "\n";
     $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
     if ($row->ftext) {
         $row->ftext = str_replace('[[BR]]', '', $row->ftext);
         // Remove tags to prevent tables from being displayed within a table.
         $row->ftext = strip_tags($row->ftext);
         $html .= "\t\t" . \Hubzero\Utility\String::truncate(\Hubzero\Utility\Sanitize::stripAll(stripslashes($row->ftext)), 200) . "\n";
     }
     $html .= "\t\t" . '<p class="href">' . Request::base() . trim($row->href, '/') . '</p>' . "\n";
     $html .= "\t" . '</li>' . "\n";
     // Return output
     return $html;
 }
Exemple #21
0
 public function formatted($config = array('format' => 'apa'), $highlight = NULL)
 {
     //get hub specific details
     $hub_name = \Config::get('sitename');
     $hub_url = rtrim(\Request::base(), '/');
     //get scope specific details
     $coins_only = isset($config['coins_only']) ? $config['coins_only'] : "no";
     $include_coins = isset($config['include_coins']) ? $config['include_coins'] : "no";
     $c_type = 'journal';
     $type = $this->relatedType->type;
     switch (strtolower($type)) {
         case 'book':
         case 'inbook':
         case 'conference':
         case 'proceedings':
         case 'inproceedings':
             $c_type = "book";
             break;
         case 'journal':
         case 'article':
         case 'journal article':
             $c_type = "journal";
             break;
         default:
             break;
     }
     //var to hold COinS data
     $coins_data = array("ctx_ver=Z39.88-2004", "rft_val_fmt=info:ofi/fmt:kev:mtx:{$c_type}", "rfr_id=info:sid/{$hub_url}:{$hub_name}");
     //array to hold replace vals
     $replace_values = array();
     // get the template
     // default to IEEE
     try {
         $format = \Components\Citations\Models\Format::oneOrFail($config['citationFormat']);
     } catch (\Exception $e) {
         $format = \Components\Citations\Models\Format::all()->where('style', 'LIKE', '%IEEE%')->row()->toObject();
     }
     //get the template keys
     $template_keys = array("type" => "{TYPE}", "cite" => "{CITE KEY}", "ref_type" => "{REF TYPE}", "date_submit" => "{DATE SUBMITTED}", "date_accept" => "{DATE ACCEPTED}", "date_publish" => "{DATE PUBLISHED}", "author" => "{AUTHORS}", "editor" => "{EDITORS}", "title" => "{TITLE/CHAPTER}", "booktitle" => "{BOOK TITLE}", "chapter" => "{CHAPTER}", "journal" => "{JOURNAL}", "journaltitle" => "{JOURNAL TITLE}", "volume" => "{VOLUME}", "number" => "{ISSUE/NUMBER}", "pages" => "{PAGES}", "isbn" => "{ISBN/ISSN}", "issn" => "{ISSN}", "doi" => "{DOI}", "series" => "{SERIES}", "edition" => "{EDITION}", "school" => "{SCHOOL}", "publisher" => "{PUBLISHER}", "institution" => "{INSTITUTION}", "address" => "{ADDRESS}", "location" => "{LOCATION}", "howpublished" => "{HOW PUBLISHED}", "url" => "{URL}", "eprint" => "{E-PRINT}", "note" => "{TEXT SNIPPET/NOTES}", "organization" => "{ORGANIZATION}", "abstract" => "{ABSTRACT}", "year" => "{YEAR}", "month" => "{MONTH}", "search_string" => "{SECONDARY LINK}", "sec_cnt" => "{SECONDARY COUNT}");
     /**
      * Values used by COINs
      *
      * @var  array
      */
     $coins_keys = array('title' => 'rft.atitle', 'journaltitle' => 'rft.jtitle', 'date_publish' => 'rft.date', 'volume' => 'rft.volume', 'number' => 'rft.issue', 'pages' => 'rft.pages', 'issn' => 'rft.issn', 'isbn' => 'rft.isbn', 'type' => 'rft.genre', 'author' => 'rft.au', 'url' => 'rft_id', 'doi' => 'rft_id=info:doi/', 'author' => 'rft.au');
     // form the formatted citation
     foreach ($template_keys as $k => $v) {
         if (!$this->keyExistsOrIsNotEmpty($k, $this) && $k != 'author') {
             $replace_values[$v] = '';
         } else {
             $replace_values[$v] = $this->{$k};
             //add to coins data if we can but not authors as that will get processed below
             if (in_array($k, array_keys($coins_keys)) && $k != 'author') {
                 //key specific
                 switch ($k) {
                     case 'title':
                         break;
                     case 'doi':
                         $coins_data[] = $this->_coins_keys[$k] . $this->{$k};
                         break;
                     case 'url':
                         $coins_data[] = $this->_coins_keys[$k] . '=' . htmlentities($this->{$k});
                         break;
                     case 'journaltitle':
                         $jt = html_entity_decode($this->{$k});
                         $jt = !preg_match('!\\S!u', $jt) ? utf8_encode($jt) : $jt;
                         $coins_data[] = $this->_coins_keys[$k] . '=' . $jt;
                         break;
                     default:
                         $coins_data[] = $this->_coins_keys[$k] . '=' . $this->{$k};
                 }
             }
             if ($k == 'author') {
                 $a = array();
                 $auth = html_entity_decode($this->{$k});
                 $auth = !preg_match('!\\S!u', $auth) ? utf8_encode($auth) : $auth;
                 // prefer the use of the relational table
                 if ($this->relatedAuthors->count() > 0) {
                     $authors = $this->relatedAuthors;
                     $authorCount = $this->relatedAuthors->count();
                 } elseif ($auth != '' && $this->relatedAuthors->count() == 0) {
                     $author_string = $auth;
                     $authors = explode(';', $author_string);
                     $authorCount = count($authors);
                 } else {
                     $authorCount = 0;
                     $replace_values[$v] = '';
                 }
                 if ($authorCount > 0) {
                     foreach ($authors as $author) {
                         // for legacy profile handling
                         if (is_string($author)) {
                             preg_match('/{{(.*?)}}/s', $author, $matches);
                             if (!empty($matches)) {
                                 $id = trim($matches[1]);
                                 if (is_numeric($id)) {
                                     $user = \User::getInstance($id);
                                     if (is_object($user)) {
                                         $a[] = '<a rel="external" href="' . \Route::url('index.php?option=com_members&id=' . $matches[1]) . '">' . str_replace($matches[0], '', $author) . '</a>';
                                     } else {
                                         $a[] = $author;
                                     }
                                 }
                             } else {
                                 $a[] = $author;
                             }
                             // add author coins
                             $coins_data[] = 'rft.au=' . trim(preg_replace('/\\{\\{\\d+\\}\\}/', '', trim($author)));
                         } elseif (is_object($author)) {
                             if ($author->uidNumber > 0) {
                                 $a[] = '<a rel="external" href="' . \Route::url('index.php?option=com_members&id=' . $author->uidNumber) . '">' . $author->author . '</a>';
                             } else {
                                 $a[] = $author->author;
                             }
                         } else {
                             $a[] = $author;
                         }
                     }
                     $replace_values[$v] = implode(", ", $a);
                 }
             }
             if ($k == 'title') {
                 $url_format = isset($config['citation_url']) ? $config['citation_url'] : 'url';
                 $custom_url = isset($config['citation_custom_url']) ? $config['citation_custom_url'] : '';
                 $url = $this->url;
                 if ($url_format == 'custom' && $custom_url != '') {
                     //parse custom url to make sure we are not using any vars
                     preg_match_all('/\\{(\\w+)\\}/', $custom_url, $matches, PREG_SET_ORDER);
                     if ($matches) {
                         foreach ($matches as $match) {
                             $field = strtolower($match[1]);
                             $replace = $match[0];
                             $replaceWith = '';
                             if (property_exists($this, $field)) {
                                 if (strstr($this->{$field}, 'http')) {
                                     $custom_url = $this->{$field};
                                 } else {
                                     $replaceWith = urlencode($this->{$field});
                                     $custom_url = str_replace($replace, $replaceWith, $custom_url);
                                 }
                             }
                         }
                         //set the citation url to be the new custom url parsed
                         $url = $custom_url;
                     }
                 }
                 //prepare url
                 if (strstr($url, "\r\n")) {
                     $url = array_filter(array_values(explode("\r\n", $url)));
                     $url = $url[0];
                 } elseif (strstr($url, " ")) {
                     $url = array_filter(array_values(explode(" ", $url)));
                     $url = $url[0];
                 }
                 $t = html_entity_decode($this->{$k});
                 $t = !preg_match('!\\S!u', $t) ? utf8_encode($t) : $t;
                 $title = $url != '' && preg_match('/http:|https:/', $url) ? '<a rel="external" class="citation-title" href="' . $url . '">' . $t . '</a>' : '<span class="citation-title">' . $t . '</span>';
                 //do we want to display single citation
                 //$singleCitationView = $config('citation_single_view', 0);
                 $singleCitationView = isset($config['citation_single_view']) ? $config['citation_single_view'] : 0;
                 if ($singleCitationView && isset($this->id)) {
                     $title = '<a href="' . \Route::url('index.php?option=com_citations&task=view&id=' . $this->id) . '">' . $t . '</a>';
                 }
                 //send back title to replace title placeholder ({TITLE})
                 $replace_values[$v] = '"' . $title . '"';
                 //add title to coin data but fixing bad chars first
                 $coins_data[] = 'rft.atitle=' . $t;
             }
             if ($k == 'pages') {
                 $replace_values[$v] = "pg: " . $this->{$k};
             }
         }
     }
     // Add more to coins
     $template = $format->format;
     $tmpl = isset($template) ? $template : $default_template;
     $cite = strtr($tmpl, $replace_values);
     // Strip empty tags
     $pattern = "/<[^\\/>]*>([\\s]?)*<\\/[^>]*>/";
     $cite = preg_replace($pattern, '', $cite);
     //reformat dates
     $pattern = "/(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})/";
     $cite = preg_replace($pattern, "\$2-\$3-\$1", $cite);
     // Reduce multiple spaces to one
     $pattern = "/\\s/s";
     $cite = preg_replace($pattern, ' ', $cite);
     // Strip empty punctuation inside
     $b = array("''" => '', '""' => '', '()' => '', '{}' => '', '[]' => '', '??' => '', '!!' => '', '..' => '.', ',,' => ',', ' ,' => '', ' .' => '', ',.' => '.', '","' => '', 'doi:.' => '', '(DOI:).' => '');
     foreach ($b as $k => $i) {
         $cite = str_replace($k, $i, $cite);
     }
     // Strip empty punctuation from the start
     $c = array("' ", '" ', '(', ') ', ', ', '. ', '? ', '! ', ': ', '; ');
     foreach ($c as $k) {
         if (substr($cite, 0, 2) == $k) {
             $cite = substr($cite, 2);
         }
     }
     // remove trailing commas
     $cite = trim($cite);
     if (substr($cite, -1) == ',') {
         $cite = substr($cite, 0, strlen($cite) - 1);
     }
     // percent encode chars
     $chars = array('%', ' ', '/', ':', '"', '\'', '&amp;');
     $replace = array("%20", "%20", "%2F", "%3A", "%22", "%27", "%26");
     $coins_data = str_replace($chars, $replace, implode('&', $coins_data));
     $cite = preg_replace('/, :/', ':', $cite);
     // highlight citation data
     // do before appendnind coins as we dont want that data accidentily highlighted (causes style issues)
     $cite = $highlight ? String::highlight($cite, $highlight) : $cite;
     // if we want coins add them
     if ($include_coins == "yes" || $coins_only == "yes") {
         $coins = '<span class="Z3988" title="' . $coins_data . '"></span>';
         if ($coins_only == "yes") {
             return $coins;
         }
         $cite .= $coins;
     }
     // output the citation
     return $cite;
 }
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Shawn Rice <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access
defined('_HZEXEC_') or die;
?>

<div class="group-page group-page-notice notice-info">
	<h4><?php 
echo Lang::txt('COM_GROUPS_PAGES_PAGE_NOT_PUBLISHED');
?>
</h4>
	<p><?php 
echo Lang::txt('COM_GROUPS_PAGES_PAGE_NOT_PUBLISHED_DESC');
?>
</p>
	<?php 
$link = Route::url('index.php?option=com_groups&cn=' . $this->group->get('cn') . '&controller=pages&task=publish&pageid=' . $this->page->get('id'));
?>
	<p><a href="<?php 
echo $link . '&return=' . base64_encode(Request::current(true));
?>
"><?php 
echo rtrim(Request::base(), '/') . $link;
?>
</a></p>
</div>
			</tr>
		</tbody>
	</table>
	<!-- End Spacer -->

	<!-- Start Footer -->
	<table class="tbl-footer" width="100%" cellpadding="0" cellspacing="0" border="0">
		<tbody>
			<tr>
				<td align="left" valign="bottom">
					<span><?php 
echo Config::get('sitename');
?>
 sent this email because you were added to the list of recipients on <a href="<?php 
echo $link;
?>
">question #<?php 
echo $this->question->get('id');
?>
</a>. Visit our <a href="<?php 
echo Request::base();
?>
/legal/privacy">Privacy Policy</a> and <a href="<?php 
echo Request::base();
?>
/support">Support Center</a> if you have any questions.</span>
				</td>
			</tr>
		</tbody>
	</table>
	<!-- End Footer -->
Exemple #24
0
 /**
  * On after approve/kickback
  *
  * @return  void
  */
 public function onAfterStatusChange()
 {
     if ($this->getError()) {
         return;
     }
     $pub = $this->_pub;
     $status = $this->_pub->version->state;
     $activity = $status == 1 ? Lang::txt('COM_PUBLICATIONS_CURATION_ACTIVITY_PUBLISHED') : Lang::txt('COM_PUBLICATIONS_CURATION_ACTIVITY_KICKBACK');
     $pubtitle = \Hubzero\Utility\String::truncate($pub->title, 100);
     // Log activity in curation history
     $pub->_curationModel->saveHistory(User::get('id'), $pub->state, $status, 1);
     // Add activity
     $activity .= ' ' . strtolower(Lang::txt('version')) . ' ' . $pub->version_label . ' ' . Lang::txt('COM_PUBLICATIONS_OF') . ' ' . strtolower(Lang::txt('publication')) . ' "' . $pubtitle . '" ';
     // Record activity
     $aid = $pub->project()->recordActivity($activity, $pub->id, $pubtitle, $pub->link('version'), 'publication', 0, $admin = 1);
     // Start message
     $sef = 'publications' . DS . $pub->id . DS . $pub->version_number;
     $link = rtrim(Request::base(), DS) . DS . trim($pub->link('version'), DS);
     $manage = rtrim(Request::base(), DS) . DS . trim($pub->link('editversion'), DS);
     $message = $status == 1 ? Lang::txt('COM_PUBLICATIONS_CURATION_EMAIL_CURATOR_APPROVED') : Lang::txt('COM_PUBLICATIONS_CURATION_EMAIL_CURATOR_KICKED_BACK');
     if ($status != 1) {
         $message .= "\n" . "\n";
         $message .= Lang::txt('COM_PUBLICATIONS_CURATION_TAKE_ACTION') . ' ' . $manage;
     } else {
         $message .= ' ' . $link;
     }
     $pubtitle = \Hubzero\Utility\String::truncate($pub->title, 100);
     $subject = ucfirst(Lang::txt('COM_PUBLICATIONS_CURATION_VERSION')) . ' ' . $pub->version_label . ' ' . Lang::txt('COM_PUBLICATIONS_OF') . ' ' . strtolower(Lang::txt('COM_PUBLICATIONS_PUBLICATION')) . ' "' . $pubtitle . '" ';
     $subject .= $status == 1 ? Lang::txt('COM_PUBLICATIONS_MSG_ADMIN_PUBLISHED') : Lang::txt('COM_PUBLICATIONS_MSG_ADMIN_KICKED_BACK');
     // Get authors
     $authors = $pub->table('Author')->getAuthors($pub->version_id, 1, 1, 1);
     // No authors – send to publication creator
     if (count($authors) == 0) {
         $authors = array($pub->created_by);
     }
     // New version released?
     if ($status == 1 && $pub->get('version_number') > 1) {
         // Notify subsrcibers
         Event::trigger('publications.onWatch', array($pub));
     }
     // Make sure there are no duplicates
     $authors = array_unique($authors);
     // Notify authors
     Helpers\Html::notify($pub, $authors, $subject, $message, true);
     return;
 }
Exemple #25
0
		<aside class="aside">
			<div class="container blog-entries-years">
				<h4><?php 
    echo Lang::txt('COM_BLOG_COMMENTS_FEED');
    ?>
</h4>
				<p>
					<?php 
    echo Lang::txt('COM_BLOG_COMMENTS_FEED_EXPLANATION');
    ?>
				</p>
				<p>
					<?php 
    $feed = Route::url($this->row->link() . '/comments.rss');
    if (substr($feed, 0, 4) != 'http') {
        $live_site = rtrim(Request::base(), '/');
        $feed = rtrim($live_site, '/') . '/' . ltrim($feed, '/');
    }
    $feed = str_replace('https:://', 'http://', $feed);
    ?>
					<a class="icon-feed feed btn" href="<?php 
    echo $feed;
    ?>
"><?php 
    echo Lang::txt('COM_BLOG_FEED');
    ?>
</a>
				</p>
			</div>
		</aside><!-- / .aside -->
	</div><!-- / .section-inner -->
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 */
// No direct access
defined('_HZEXEC_') or die;
$base = rtrim(Request::base(), '/');
$base = rtrim(str_replace('/administrator', '', $base), '/');
$sef = Route::url('index.php?option=' . $this->option . '&alias=' . $this->project->get('alias'));
$link = rtrim($base, DS) . DS . trim($sef, DS);
$message = Lang::txt('COM_PROJECTS_EMAIL_ADMIN_NEW_PUB_STATUS') . "\n";
$message .= '-------------------------------' . "\n";
$message .= Lang::txt('COM_PROJECTS_PROJECT') . ': ' . $this->project->get('title') . ' (' . $this->project->get('alias');
if ($this->project->isProvisioned()) {
    $message .= ' - ' . Lang::txt('COM_PROJECTS_PROVISIONED');
}
$message .= ')' . "\n";
if (!$this->project->isProvisioned()) {
    $message .= ucfirst(Lang::txt('COM_PROJECTS_CREATED')) . ' ' . Date::of($this->project->get('created'))->toLocal('M d, Y') . ' ' . Lang::txt('COM_PROJECTS_BY') . ' ';
    $message .= $this->project->groupOwner() ? $this->project->groupOwner('cn') . ' ' . Lang::txt('COM_PROJECTS_GROUP') : $this->project->owner('name');
}
$message .= "\n";
Exemple #27
0
        ?>
						<img src="<?php 
        echo Request::base(true);
        ?>
/core/plugins/groups/calendar/assets/img/swatch-<?php 
        echo $calendar->get('color');
        ?>
.png" alt="<?php 
        echo $calendar->get('color');
        ?>
" />
					<?php 
    } else {
        ?>
						<img src="<?php 
        echo Request::base(true);
        ?>
/core/plugins/groups/calendar/assets/img/swatch-gray.png" alt="gray" />
					<?php 
    }
    ?>
					<?php 
    echo $calendar->get('title');
    ?>
					<?php 
    if (!$enabled) {
        echo Lang::txt('(Calendar is not publishing events.)');
    }
    ?>
				</label>
			<?php 
Exemple #28
0
 /**
  * Special formatting for results
  *
  * @param      object $row    Database row
  * @param      string $period Time period
  * @return     string
  */
 public static function out($row, $period)
 {
     $database = App::get('db');
     $helper = new \Components\Resources\Helpers\Helper($row->id, $database);
     // Instantiate a helper object
     if (!isset($row->authors)) {
         $helper->getContributors();
         $row->authors = $helper->contributors;
     }
     // Get the component params and merge with resource params
     $config = Component::params('com_resources');
     $rparams = new \Hubzero\Config\Registry($row->params);
     // Set the display date
     switch ($rparams->get('show_date', $config->get('show_date'))) {
         case 0:
             $thedate = '';
             break;
         case 1:
             $thedate = Date::of($row->created)->toLocal(Lang::txt('DATE_FORMAT_HZ1'));
             break;
         case 2:
             $thedate = Date::of($row->modified)->toLocal(Lang::txt('DATE_FORMAT_HZ1'));
             break;
         case 3:
             $thedate = Date::of($row->publish_up)->toLocal(Lang::txt('DATE_FORMAT_HZ1'));
             break;
     }
     // Start building HTML
     $html = "\t" . '<li class="resource">' . "\n";
     $html .= "\t\t" . '<p class="title"><a href="' . $row->href . '">' . stripslashes($row->title) . '</a></p>' . "\n";
     if ($rparams->get('show_ranking', $config->get('show_ranking'))) {
         $helper->getCitationsCount();
         $helper->getLastCitationDate();
         if ($row->area == 'Tools') {
             $stats = new \Components\Resources\Helpers\Usage\Stats($database, $row->id, $row->category, $row->rating, $helper->citationsCount, $helper->lastCitationDate);
         } else {
             $stats = new \Components\Resources\Helpers\Usage\Andmore($database, $row->id, $row->category, $row->rating, $helper->citationsCount, $helper->lastCitationDate);
         }
         $statshtml = $stats->display();
         $row->ranking = round($row->ranking, 1);
         $html .= "\t\t" . '<div class="metadata">' . "\n";
         $r = 10 * $row->ranking;
         if (intval($r) < 10) {
             $r = '0' . $r;
         }
         $html .= "\t\t\t" . '<dl class="rankinfo">' . "\n";
         $html .= "\t\t\t\t" . '<dt class="ranking"><span class="rank-' . $r . '">' . Lang::txt('PLG_WHATSNEW_RESOURCES_THIS_HAS') . '</span> ' . number_format($row->ranking, 1) . ' ' . Lang::txt('PLG_WHATSNEW_RESOURCES_RANKING') . '</dt>' . "\n";
         $html .= "\t\t\t\t" . '<dd>' . "\n";
         $html .= "\t\t\t\t\t" . '<p>' . Lang::txt('PLG_WHATSNEW_RESOURCES_RANKING_EXPLANATION') . '</p>' . "\n";
         $html .= "\t\t\t\t\t" . '<div>' . "\n";
         $html .= $statshtml;
         $html .= "\t\t\t\t\t" . '</div>' . "\n";
         $html .= "\t\t\t\t" . '</dd>' . "\n";
         $html .= "\t\t\t" . '</dl>' . "\n";
         $html .= "\t\t" . '</div>' . "\n";
     } elseif ($rparams->get('show_rating', $config->get('show_rating'))) {
         switch ($row->rating) {
             case 0.5:
                 $class = ' half-stars';
                 break;
             case 1:
                 $class = ' one-stars';
                 break;
             case 1.5:
                 $class = ' onehalf-stars';
                 break;
             case 2:
                 $class = ' two-stars';
                 break;
             case 2.5:
                 $class = ' twohalf-stars';
                 break;
             case 3:
                 $class = ' three-stars';
                 break;
             case 3.5:
                 $class = ' threehalf-stars';
                 break;
             case 4:
                 $class = ' four-stars';
                 break;
             case 4.5:
                 $class = ' fourhalf-stars';
                 break;
             case 5:
                 $class = ' five-stars';
                 break;
             case 0:
             default:
                 $class = ' no-stars';
                 break;
         }
         $html .= "\t\t" . '<div class="metadata">' . "\n";
         $html .= "\t\t\t" . '<p class="rating"><span class="avgrating' . $class . '"><span>' . Lang::txt('PLG_WHATSNEW_RESOURCES_OUT_OF_5_STARS', $row->rating) . '</span>&nbsp;</span></p>' . "\n";
         $html .= "\t\t" . '</div>' . "\n";
     }
     $html .= "\t\t" . '<p class="details">' . $thedate . ' <span>|</span> ' . $row->area;
     if ($row->authors) {
         $html .= ' <span>|</span> ' . Lang::txt('PLG_WHATSNEW_RESOURCES_CONTRIBUTORS') . ' ' . $row->authors;
     }
     $html .= '</p>' . "\n";
     if ($row->itext) {
         $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(strip_tags(stripslashes($row->itext)), 200) . '</p>' . "\n";
     } else {
         if ($row->ftext) {
             $html .= "\t\t" . '<p>' . \Hubzero\Utility\String::truncate(strip_tags(stripslashes($row->ftext)), 200) . '</p>' . "\n";
         }
     }
     $html .= "\t\t" . '<p class="href">' . Request::base() . trim($row->href, '/') . '</p>' . "\n";
     $html .= "\t" . '</li>' . "\n";
     // Return output
     return $html;
 }
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    Nicholas J. Kisseberth <*****@*****.**>
 * @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
 * @license   http://opensource.org/licenses/MIT MIT
 */
// No direct access
defined('_HZEXEC_') or die;
$sef = ltrim(Route::url('index.php?option=' . $this->option . '&cn=' . $this->group->get('cn') . '&active=members'), '/');
$message = Lang::txt('COM_GROUPS_EMAIL_MEMBERSHIP_CANCELLED_DETAILS', $this->sitename) . "\n\n";
$message .= "\t" . ' ' . Lang::txt('COM_GROUPS_GROUP') . ': ' . $this->group->get('description') . ' (' . $this->group->get('cn') . ')' . "\n";
$message .= "\t" . ' ' . Lang::txt('COM_GROUPS_EMAIL_MEMBERSHIP_CANCELLED') . ':' . "\n";
$message .= "\t\t" . $this->user->get('name') . "\n";
$message .= "\t\t" . $this->user->get('username') . ' (' . $this->user->get('email') . ')' . "\n\n";
$message .= Lang::txt('COM_GROUPS_EMAIL_MEMBERSHIP_CANCELLED_LINK') . "\n";
$message .= rtrim(Request::base(), '/') . '/' . $sef . "\n";
echo $message;
Exemple #30
0
?>
					</li>
				</ol>
			</div>
		</div>

		<!--  Generate Feed -->
		<div class="postpreview-container">
			<div class="postpreview" id="feedbox">
				<h2><?php 
echo Lang::txt('COM_FEEDAGGREGATOR_GENERATE_HEADER');
?>
</h2>
				<p><?php 
echo Lang::txt('COM_FEEDAGGREGATOR_GENERATE_INSTRUCTIONS');
?>
</p>
				<p>
					<a href="<?php 
echo rtrim(Request::base(), '/') . Route::url('index.php?option=com_feedaggregator&task=generateFeed&no_html=1');
?>
">
						<?php 
echo rtrim(Request::base(), '/') . Route::url('index.php?option=com_feedaggregator&task=generateFeed&no_html=1');
?>
					</a>
				</p>
			</div>
		</div>
	</div> <!--  main page -->
</section><!-- /.main section -->