public function __construct() { parent::__construct(); if (!mod_enabled('twitter')) { throw new Exception("Twitter module not enabled in your global config."); } $this->consumer_key = $this->config->item('twitter_consumer_key'); $this->consumer_secret = $this->config->item('twitter_consumer_secret'); $this->oauth_access_token = $this->config->item('twitter_oauth_access_token'); $this->oauth_access_secret = $this->config->item('twitter_oauth_access_secret'); if (!$this->consumer_key || !$this->oauth_access_token) { throw new Exception("You must first configure your global config variables for the Twitter API!"); } if (!$this->input->is_cli_request() && !$this->user->hasFunction('REGISTRY_SUPERUSER')) { throw new Exception("Access denied"); } }
</li> <?php } ?> <?php } ?> </ul> </li> <?php } ?> <?php if ($this->user->hasFunction('REGISTRY_USER') && mod_enabled('registry')) { ?> <form class="navbar-search pull-left hide" id="navbar-search-form"> <input type="text" class="search-query" placeholder="Search"> </form> <li class="btn btn-inverse"> <a href="javascript:;" id="main-nav-search"><i class="icon-search icon-white"></i></a> </li> <?php } ?> <?php if ($this->user->hasFunction('PUBLIC')) { ?>
public function dashboard() { $data['title'] = 'ANDS Online Services Home'; $data['js_lib'] = array('core'); $data['scripts'] = array(); $data['available_organisations'] = array(); $data['group_vocabs'] = array(); if ($this->user->loggedIn()) { if (sizeof($this->user->affiliations()) > 0) { $data['hasAffiliation'] = true; } else { $data['hasAffiliation'] = false; } if (mod_enabled('vocab_service')) { $this->load->model('apps/vocab_service/vocab_services', 'vocab'); $data['group_vocabs'] = $this->vocab->getGroupVocabs(); //$data['owned_vocabs']=$this->vocab->getOwnedVocabs(false); $this->load->model($this->config->item('authentication_class'), 'auth'); $data['available_organisations'] = $this->auth->getAllOrganisationalRoles(); asort($data['available_organisations']); } if (mod_enabled('registry')) { $db = $this->load->database('registry', TRUE); $this->db = $db; $this->load->model('data_source/data_sources', 'ds'); $data['data_sources'] = $this->ds->getOwnedDataSources(false, true); } $this->load->view('dashboard', $data); } else { redirect('auth/login'); } }
<div class="control-group"> <label class="control-label" for="title">Organisation Name:</label> <div class="controls"> <input type="text" class="input-large orgName" localIdentifier="<?php echo $this->user->localIdentifier(); ?> " required maxLength="255"/> </div> </div> <button class="btn" id="confirmAddOrganisation">Add</button> </form> </div> <?php if (mod_enabled('registry')) { ?> <div class="box"> <div class="box-header clearfix"> <h1>My Data Sources</h1> </div> <div class="box-content"> <?php if (!$this->user->hasFunction('REGISTRY_USER')) { echo '<p>You are not registered as a Data Source Administrator.</p>'; if ($this->user->affiliations()) { echo '<small><span class="label label-warning"> ! </span> You are already registered as an affiliate with an organisation.</small><br/>'; echo '<small><span class="label label-important"> ! </span> Please contact <a href="mailto:services@ands.org.au">services@ands.org.au</a> to register for a new Data Source.</small>'; } else { echo '<br/><small><span class="label label-success"> ! </span> <strong> New Data Publishers </strong> <br/>