Beispiel #1
0
 public function ajaxGetTotalNotifications()
 {
     $my = CFactory::getUser();
     $myParams = $my->getParams();
     $config = CFactory::getConfig();
     $toolbar = CToolbarLibrary::getInstance();
     $notifModel = CFactory::getModel('notification');
     $response = array('newEventInviteCount' => $toolbar->getTotalNotifications('events'), 'newFriendInviteCount' => $toolbar->getTotalNotifications('friends'), 'newGroupInviteCount' => $toolbar->getTotalNotifications('groups'), 'newNotificationCount' => $notifModel->getNotificationCount($my->id, '0', $myParams->get('lastnotificationlist', '')), 'newMessageCount' => $toolbar->getTotalNotifications('inbox'));
     $response['newNotificationCount'] += $response['newGroupInviteCount'];
     $response['newNotificationCount'] += $response['newEventInviteCount'];
     $response['nextPingDelay'] = 0;
     if ($my->id && $config->get('notifications_ajax_enable_refresh')) {
         $response['nextPingDelay'] = $config->get('notifications_ajax_refresh_interval');
     }
     die(json_encode($response));
 }
Beispiel #2
0
	techjoomla.jQuery('#'+rId+pre +"  .clerfix").remove();
	techjoomla.jQuery('#'+rId+pre).append(removeButton);
	techjoomla.jQuery('#'+rId+pre).after(newElem);

}

       function removeClone(rId,rClass){
               jQuery('#'+rId).remove();
       }
</script>
<?php 
//newly added for JS toolbar inclusion
if (file_exists(JPATH_SITE . DS . 'components' . DS . 'com_community') and $socialads_config['show_js_toolbar'] == 1) {
    require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'toolbar.php';
    $toolbar = CFactory::getToolbar();
    $tool = CToolbarLibrary::getInstance();
    ?>
<style>
   <!--
      div#proimport-wrap #community-wrap { margin: 0;padding: 0; }
      div#proimport-wrap #community-wrap { min-height: 45px !important; }
      -->
</style>
<script src="<?php 
    echo JUri::root() . 'components/com_community/assets/bootstrap/bootstrap.min.js';
    ?>
" type="text/javascript"></script>
<div id="proimport-wrap">
   <div id="community-wrap">
      <?php 
    echo $tool->getHTML();
Beispiel #3
0
 /**
  * Function used to remove toolbar menu item
  * param - groupKey : string - the key of the group
  *       - itemKey : string - the unique key of the menu item
  */
 public function removeItem($groupKey, $itemKey)
 {
     if (array_key_exists($groupKey, $this->_toolbar)) {
         $tbGroup =& $this->_toolbar[strtoupper($groupKey)];
         $childItem =& $tbGroup->child;
         if (is_array($itemKey)) {
             if (array_key_exists($itemKey, $childItem['prepend'])) {
                 unset($childItem['prepend'][$itemKey]);
             }
             if (array_key_exists($itemKey, $childItem['append'])) {
                 unset($childItem['append'][$itemKey]);
             }
         }
     } else {
         //this is for new toolbar system
         $toolbar = CToolbarLibrary::getInstance();
         $toolbar->removeItem($groupKey, $itemKey);
     }
 }
Beispiel #4
0
	function jomsocialtoolbar($template)

	{

		//Load Language file.
		
		$toolbarstyling = 'components/com_community/templates/'.$template.'/css/style.css';

		$lang =& JFactory::getLanguage();

		$lang->load( 'com_community' );

		require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'core.php');
		$my 	= CFactory::getUser();
		// initiate toolbar

		$customToolbar	=& CFactory::getToolbar();

		// get Jomsocial configuration

		$config	=& CFactory::getConfig();

		// Include CAppPlugins library

		require_once( JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'apps.php');

		$appsLib	=& CAppPlugins::getInstance();

		$appsLib->loadApplications();

		// Only trigger applications and set active URI when needed

		$args = array();

		$appsLib->triggerEvent( 'onSystemStart' , $args );

		// Set active URI

		CFactory::setCurrentURI();

		// Include templates

		require_once (JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries'.DS.'template.php');

		// Include templates

		require_once (JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries'.DS.'miniheader.php');

		require_once(JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'tooltip.php');

		require_once(JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'toolbar.php');

		// Script needs to be here if they are 

		CFactory::load( 'libraries' , 'facebook' );

		CFactory::load( 'models' , 'connect' );

		// Once they reach here, we assume that they are already logged into facebook.

		// Since CFacebook library handles the security we don't need to worry about any intercepts here.

		$facebook		= new CFacebook();
		$connectTable	=& JTable::getInstance( 'Connect' , 'CTable' );
		$fbUser			= $facebook->getUser();
		$connectTable->load( $fbUser );
		$isFacebookUser	= ( $connectTable->userid == $my->id );

		$logoutLink	= CRoute::_( 'index.php?option=com_community&view=frontpage' , false );

		$logoutLink	= base64_encode( $logoutLink );



		$document	= & JFactory::getDocument();

		if($toolbarstyling !== ""){$document->addStyleSheet( JURI::base() . $toolbarstyling );}			
		$document->addStyleSheet( JURI::base() . 'components/com_community/assets/autocomplete.css' );
		$document->addStyleSheet( JURI::base() . 'components/com_community/assets/window.css' );
		$document->addStyleSheet( JURI::base() . 'components/com_community/templates/default/css/style.green.css' );
		//$document->addScript( JURI::base() . 'components/com_community/assets/jquery-1.3.2.pack.js' );
		$document->addScript( JURI::base() . 'components/com_community/assets/joms.jquery.js' );
		$document->addScript( JURI::base() . 'components/com_community/assets/joms.ajax.js' );

		$document->addScript( JURI::base() . 'components/com_community/assets/window-1.0.pack.js' );	

		$document->addScript( JURI::base() . 'components/com_community/assets/script-1.2.pack.js' );

		//$document->addScript( JURI::base() . 'components/com_community/assets/jquery.qtip-1.0.0-rc3.min.js' );			


?>

		<div id="community-wrap" style="display:inline"> 

		<?php 
		$db =& JFactory::getDBO();
		$query	= 'SELECT  ' . $db->nameQuote( 'params' ) . ' FROM ' . $db->nameQuote( '#__community_config' ) . ' WHERE ' . $db->nameQuote( 'name' ) . ' = ' . $db->quote('config');
		$db->setQuery( $query );
		$row = $db->loadResult();		
		$params	= new JParameter( $row );
		$showToolbar = $params->get('showToolbar', '1');

		$xml=simplexml_load_file(JPATH_SITE . '/administrator/components/com_community/community.xml');
		$version=$xml->version;
		$version=str_replace('.','',$version);
 
 		if($version >= 224)
		{
			CFactory::load( 'libraries' , 'toolbar' );
			$toolbar_lib = CToolbarLibrary::getInstance();
			echo $toolbar_lib->getHTML(  );
		}
		else
		{
			CFactory::load( 'libraries' , 'toolbar' );
			echo CToolbarLibrary::getHTML(  );
		}
		
		$menus	= CToolbarLibrary::getItems();
		CToolbarLibrary::addLegacyToolbars( $menus );
		//$showToolbar=1;
		//print_r($menus);
		if(file_exists(JPATH_SITE . '/components/com_community/templates/'.$template.'/toolbar.index.php'))

		{

			require_once (JPATH_ROOT .'/components/com_community/templates/'.$template.'/toolbar.index.php');

		}

		else

		{

			require_once (JPATH_ROOT .'/components/com_community/templates/default/toolbar.index.php');

		}

		?>

		 </div>

	<?php }
Beispiel #5
0
 /**
  * Deprecated since 2.2
  * Should use CToolbarLibrary::getHTML instead
  **/
 public function showToolbar($data = null)
 {
     CFactory::load('libraries', 'toolbar');
     $toolbar_lib = CToolbarLibrary::getInstance();
     echo $toolbar_lib->getHTML($this->_showMiniHeaderUser);
 }
Beispiel #6
0
 /**
  * Deprecated since 2.2
  * Should use CToolbarLibrary::getHTML instead
  * */
 public function showToolbar($data = null)
 {
     $toolbar_lib = CToolbarLibrary::getInstance();
     echo $toolbar_lib->getHTML($this->_showMiniHeaderUser);
 }
Beispiel #7
0
 /**
  * Displays the toolbar of JomSocial
  *
  * @since   5.0
  * @access  public
  * @param   string
  * @return
  */
 public function getToolbar()
 {
     if (!$this->config->get('integrations_jomsocial_toolbar')) {
         return;
     }
     // Allow third party to control the toolbar
     $displayToolbar = $this->input->get('showJomsocialToolbar', true);
     $format = $this->input->get('format', '', 'word');
     $tmpl = $this->input->get('tmpl', '', 'word');
     if ($format == 'pdf' || $format == 'phocapdf' || $tmpl == 'component' || !$displayToolbar) {
         return;
     }
     // Ensure that JomSocial exists
     if (!$this->exists()) {
         return;
     }
     // Ensure the library really exists on the site.
     if (!class_exists('CToolbarLibrary') || !method_exists('CToolbarLibrary', 'getInstance')) {
         return;
     }
     $svg = '';
     if (method_exists('CFactory', 'getPath')) {
         $svg = CFactory::getPath('template://assets/icon/joms-icon.svg');
     }
     // Load up the apps
     $appsLib = CAppPlugins::getInstance();
     $appsLib->loadApplications();
     $appsLib->triggerEvent('onSystemStart', array());
     // Get the toolbar library
     $toolbar = CToolbarLibrary::getInstance();
     $theme = EB::template();
     $theme->set('svg', $svg);
     $theme->set('toolbar', $toolbar);
     $contents = $theme->output('site/toolbar/toolbar.jomsocial');
     return $contents;
 }