Beispiel #1
0
	function display($cachable = false) {
        // Make sure we have a default view
        if( !JRequest::getVar( 'view' )) {
		    JRequest::setVar('view', 'awdalbumlist' );
        }
		$view=JRequest::getVar('view', 'awdalbumlist' );
		if($view=='awdjomalbum')
		{
			 JRequest::setVar('view', 'awdalbumlist' );
		}
		//require_once(JPATH_SITE . DS . 'components'.DS.'com_awdjomalbum'. DS.'js' . DS . 'include.php');
		
		$mainframe= JFactory::getApplication();
		$app = JFactory::getApplication('site');
		 
		$config =  & $app->getParams('com_awdwall');
		
		$display_jomsocialtoolbar 		= $config->get('display_jomsocialtoolbar', 1);
		$user 	= &JFactory::getUser();
		
		$db		=& JFactory::getDBO();
		$user=&JFactory::getUser();
		$layout = JRequest::getCmd('layout', '');	
 		$toolbarfile = JPATH_SITE . '/components/com_community/community.php';
		if($user->id) // if user is logged in (Register user only)
		{
			if (file_exists($toolbarfile)) // if jomsocial install then only
			{
				// getting the template of jomsocial config
				$query	= 'SELECT  ' . $db->nameQuote( 'params' ) . ' FROM ' . $db->nameQuote( '#__community_config' ) . ' WHERE ' . $db->nameQuote( 'name' ) . ' = ' . $db->quote('config');
				$db->setQuery( $query );
				$row = $db->loadResult();				//echo $row;exit;	
				jimport( 'joomla.html.parameter' );	
				$params	= new JParameter( $row );
				$template = $params->get('template', 'default');
				// calling the function to display toolbar	
				//if($layout!='mywalljomsocial')
				//{	 // jomsocial toolbar restriction on module display
					if($display_jomsocialtoolbar)
					{
						if($view=='awdwallimagelist' || $view=='awdimagelist')
						{
							
						}
						else
						{
							AwdjomalbumController::jomsocialtoolbar($template);
						}
					}	
				//}
			}
		}
		
		$Itemid=AwdwallHelperUser::getComItemId();;
			
		$access_level = $config->get('access_level', 0);
		$display_jomwalllogin = $config->get('display_jomwalllogin', 0);
	
		if($access_level == 1 && empty($user->id)){
			$mainlink=base64_encode(JRoute::_("index.php?option=com_awdwall&view=awdwall&layout=".$layout."&Itemid=".$Itemid,false)); 
				if($display_jomwalllogin==1)
				{ 
					$login=JRoute::_("index.php?option=com_awdwall&task=login&Itemid=".$Itemid,false);
				}
				else
				{
					$login=JRoute::_("index.php?option=com_users&view=login&Itemid=".$Itemid."&return=".$mainlink,false);
				}
			$mainframe->Redirect($login);
		}
		

		parent::display($tpl = null);
	}
Beispiel #2
0
	$filename = 'jquery-1.4.2.min.js';
	$path = JURI::base().'components/com_awdwall/js/';
	//JHTML::script($filename, $path, true);
	//echo '<script type="text/javascript">jQuery.noConflict();<script>';
	$doc =& JFactory::getDocument();
	$style = '#awd-mainarea .wallheadingRight ul li ul {'
	. 'background: none!important;'
	. '}'; 
	$doc->addStyleDeclaration( $style );

	require_once JPATH_COMPONENT.DS.'controller.php';



// Initialize the controller
$controller = new AwdjomalbumController();
$controller->execute(JRequest::getCmd('task'));



// Redirect if set by the controller
$controller->redirect();

}

else

{

$mainframe->redirect(JRoute::_('index.php?option=com_awdwall&Itemid='.$Itemid));