/** * Displays the view * * @param string $tpl The name of the template file to parse * @return void */ public function display($tpl = null) { Html::behavior('framework'); \Hubzero\Document\Assets::addComponentStylesheet('com_languages', 'overrider.css'); \Hubzero\Document\Assets::addComponentScript('com_languages', 'overrider.js'); //Document::addStyleSheet(Request::root().'media/overrider/css/overrider.css'); //Document::addScript(Request::root().'media/overrider/js/overrider.js'); $this->form = $this->get('Form'); $this->item = $this->get('Item'); $this->state = $this->get('State'); // Check for errors if (count($errors = $this->get('Errors'))) { throw new Exception(implode("\n", $errors)); return; } // Check whether the cache has to be refreshed $cached_time = User::getState('com_languages.overrides.cachedtime.' . $this->state->get('filter.client') . '.' . $this->state->get('filter.language'), 0); if (time() - $cached_time > 60 * 5) { $this->state->set('cache_expired', true); } // Add strings for translations in Javascript JText::script('COM_LANGUAGES_VIEW_OVERRIDE_NO_RESULTS'); JText::script('COM_LANGUAGES_VIEW_OVERRIDE_REQUEST_ERROR'); $this->addToolbar(); parent::display($tpl); }
function display($tpl = null) { $user = User::getRoot(); // If this is an auth_link account update, carry on, otherwise raise an error if (!is_object($user) || !array_key_exists('auth_link_id', $user) || !is_numeric($user->get('username')) || !$user->get('username') < 0) { App::abort('405', 'Method not allowed'); return; } // Get and add the js and extra css to the page \Hubzero\Document\Assets::addComponentStylesheet('com_users', 'link.css'); \Hubzero\Document\Assets::addComponentStylesheet('com_users', 'providers.css'); \Hubzero\Document\Assets::addComponentScript('com_users', 'link'); // Import a few things jimport('joomla.user.helper'); // Look up a few things $hzal = \Hubzero\Auth\Link::find_by_id($user->get("auth_link_id")); $hzad = \Hubzero\Auth\Domain::find_by_id($hzal->auth_domain_id); $plugins = Plugin::byType('authentication'); // Get the display name for the current plugin being used Plugin::import('authentication', $hzad->authenticator); $plugin = Plugin::byType('authentication', $hzad->authenticator); $pparams = new \Hubzero\Config\Registry($plugin->params); $refl = new ReflectionClass("plgAuthentication{$plugin->name}"); $display_name = $pparams->get('display_name', $refl->hasMethod('onGetLinkDescription') ? $refl->getMethod('onGetLinkDescription')->invoke(NULL) : ucfirst($plugin->name)); // Look for conflicts - first check in the hub accounts $profile_conflicts = \Hubzero\User\Profile\Helper::find_by_email($hzal->email); // Now check the auth_link table $link_conflicts = \Hubzero\Auth\Link::find_by_email($hzal->email, array($hzad->id)); $conflict = array(); if ($profile_conflicts) { foreach ($profile_conflicts as $p) { $user_id = JUserHelper::getUserId($p); $juser = User::getInstance($user_id); $auth_link = \Hubzero\Auth\Link::find_by_user_id($juser->id); $dname = is_object($auth_link) && $auth_link->auth_domain_name ? $auth_link->auth_domain_name : 'hubzero'; $conflict[] = array("auth_domain_name" => $dname, "name" => $juser->name, "email" => $juser->email); } } if ($link_conflicts) { foreach ($link_conflicts as $l) { $juser = User::getInstance($l['user_id']); $conflict[] = array("auth_domain_name" => $l['auth_domain_name'], "name" => $juser->name, "email" => $l['email']); } } // Make sure we don't somehow have any duplicate conflicts $conflict = array_map("unserialize", array_unique(array_map("serialize", $conflict))); // @TODO: Could also check for high probability of name matches??? // Get the site name $sitename = Config::get('sitename'); // Assign variables to the view $this->assign('hzal', $hzal); $this->assign('hzad', $hzad); $this->assign('plugins', $plugins); $this->assign('display_name', $display_name); $this->assign('conflict', $conflict); $this->assign('sitename', $sitename); $this->assignref('juser', $user); parent::display($tpl); }
function display($tpl = null) { Html::behavior('framework', true); \Hubzero\Document\Assets::addComponentScript('com_media', 'popup-imagemanager.js'); \Hubzero\Document\Assets::addComponentStylesheet('com_media', 'popup-imagemanager.css'); // Display form for FTP credentials? // Don't set them here, as there are other functions called before this one if there is any file write operation $ftp = !JClientHelper::hasCredentials('ftp'); $this->session = App::get('session'); $this->config = Component::params('com_media'); $this->state = $this->get('state'); $this->folderList = $this->get('folderList'); $this->require_ftp = $ftp; parent::display($tpl); }
function display($tpl = null) { $config = Component::params('com_media'); $style = Request::getState('media.list.layout', 'layout', 'thumbs', 'word'); Document::setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu'); Html::behavior('framework', true); \Hubzero\Document\Assets::addComponentScript('com_media', 'mediamanager.js'); \Hubzero\Document\Assets::addComponentStylesheet('com_media', 'mediamanager.css'); Html::behavior('modal'); Document::addScriptDeclaration("\n\t\tjQuery(document).ready(function(\$){\n\t\t\tdocument.preview = \$.fancybox;\n\t\t});"); Html::asset('script', 'system/jquery.treeview.js', true, true, false, false); Html::asset('stylesheet', 'system/jquery.treeview.css', array(), true); if (Lang::isRTL()) { Html::asset('stylesheet', 'media/jquery.treeview_rtl.css', array(), true); } if (DIRECTORY_SEPARATOR == '\\') { $base = str_replace(DIRECTORY_SEPARATOR, "\\\\", COM_MEDIA_BASE); } else { $base = COM_MEDIA_BASE; } $js = "\n\t\t\tvar basepath = '" . $base . "';\n\t\t\tvar viewstyle = '" . $style . "';\n\t\t"; Document::addScriptDeclaration($js); // Display form for FTP credentials? // Don't set them here, as there are other functions called before this one if there is any file write operation $ftp = !JClientHelper::hasCredentials('ftp'); $session = App::get('session'); $state = $this->get('state'); $this->assignRef('session', $session); $this->assignRef('config', $config); $this->assignRef('state', $state); $this->require_ftp = $ftp; $this->folders_id = ' id="media-tree"'; $this->folders = $this->get('folderTree'); // Set the toolbar $this->addToolbar(); parent::display($tpl); echo Html::behavior('keepalive'); }
/** * Push styles and scripts to the document * * @return void */ public static function documents() { \Hubzero\Document\Assets::addComponentStylesheet('com_resources'); \Hubzero\Document\Assets::addComponentScript('com_resources'); include_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'helpers' . DS . 'helper.php'; include_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'helpers' . DS . 'usage.php'; }
* 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 Sam Wilson <*****@*****.**> * @copyright Copyright 2005-2015 HUBzero Foundation, LLC. * @license http://opensource.org/licenses/MIT MIT */ // No direct access. defined('_HZEXEC_') or die; // Get and add the js and extra css to the page \Hubzero\Document\Assets::addComponentStylesheet('com_users', 'login.css'); \Hubzero\Document\Assets::addComponentStylesheet('com_users', 'providers.css'); \Hubzero\Document\Assets::addComponentScript('com_users', 'login'); \Hubzero\Document\Assets::addSystemStylesheet('uniform.css'); \Hubzero\Document\Assets::addSystemScript('jquery.uniform'); \Hubzero\Document\Assets::addSystemScript('jquery.hoverIntent'); \Hubzero\Document\Assets::addSystemScript('placeholder'); $hash = App::hash(App::get('client')->name . ':authenticator'); if (($cookie = \Hubzero\Utility\Cookie::eat('authenticator')) && !Request::getInt('reset', false)) { $primary = $cookie->authenticator; // Make sure primary is still enabled if (array_key_exists($primary, $this->authenticators) || isset($this->local) && $this->local && $primary == 'hubzero') { if (isset($cookie->user_id)) { $user = User::getInstance($cookie->user_id); $user_img = $cookie->user_img; Request::setVar('primary', $primary); } }
<?php // no direct access defined('_HZEXEC_') or die; $this->css()->css('jquery.fancybox.css', 'system')->js(); // Add projects stylesheet \Hubzero\Document\Assets::addComponentStylesheet('com_projects'); \Hubzero\Document\Assets::addComponentScript('com_projects'); \Hubzero\Document\Assets::addPluginStylesheet('projects', 'files', 'uploader'); \Hubzero\Document\Assets::addPluginScript('projects', 'files', 'jquery.fileuploader.js'); \Hubzero\Document\Assets::addPluginScript('projects', 'files', 'jquery.queueuploader.js'); ?> <header id="content-header"> <h2><?php echo $this->title; ?> </h2> </header><!-- / #content-header --> <?php if ($this->pid && !empty($this->project) && $this->project->get('created_by_user') == User::get('id')) { ?> <p class="contrib-options"> <?php echo Lang::txt('PLG_PROJECTS_PUBLICATIONS_NEED_A_PROJECT'); ?> <a href="<?php echo Route::url('index.php?option=com_projects&alias=' . $this->project->get('alias') . '&action=activate'); ?> "> <?php