예제 #1
0
 /**
  * Render logins, If $return_array is set to true, then it returns an array instead of a string
  * 
  * @param boolean $return_array Boolean value to whether return an array of string or one string. By default is false
  * @return string 
  */
 public function renderLogins($return_array = false)
 {
     $services = ComConnectHelperApi::getServices();
     $html = array();
     foreach ($services as $name => $service) {
         $html[] = $this->login($name);
     }
     return $return_array ? $html : implode(' ', $html);
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function onSettingDisplay(KEvent $event)
 {
     $actor = $event->actor;
     $tabs = $event->tabs;
     $services = ComConnectHelperApi::getServices();
     if (count($services)) {
         $tabs->insert('connect', array('label' => JText::_('COM-CONNECT-PROFILE-EDIT'), 'controller' => 'com://site/connect.controller.setting'));
     }
 }
예제 #3
0
파일: setting.php 프로젝트: stonyyi/anahita
 /**
  * Get action.
  *
  * Renders the actor setting for connect
  *
  * @param KCommandContext $context Context parameter
  * @param void
  */
 protected function _actionRead(KCommandContext $context)
 {
     $apis = ComConnectHelperApi::getServices();
     $this->getService('repos:connect.session');
     $sessions = $this->actor->sessions;
     foreach ($apis as $key => $api) {
         if (!$api->canAddService($this->actor)) {
             unset($apis[$key]);
         }
     }
     $this->apis = $apis;
     $this->sessions = $sessions;
 }
예제 #4
0
 /**
  * Modify session query to only bring the sessions that are available
  * 
  * @return void
  */
 protected function _beforeRepositoryFetch(KCommandContext $context)
 {
     $query = $context->query;
     $services = array_keys(ComConnectHelperApi::getServices());
     $query->api($services);
 }
예제 #5
0
		</div>
    </div>
	<?php 
}
?>
	
	<div class="clearfix">
		<span class="connect">
    	<?php 
$app = @service('repos://site/components.component')->find(array('component' => 'com_connect'));
?>
		<?php 
if ($app && $app->authorize('echo', array('actor' => $actor))) {
    ?>
            <?php 
    $services = ComConnectHelperApi::getServices();
    @service('repos://site/connect.session');
    $sessions = $actor->sessions->toArray();
    foreach ($sessions as $key => $session) {
        if ($session->getApi()->isReadOnly()) {
            unset($sessions[$key]);
        }
    }
    ?>
    	        
			<?php 
    if (count($sessions) > 0) {
        ?>
				<?php 
        foreach ($sessions as $session) {
            ?>