Exemple #1
0
 public function __construct($config = array())
 {
     $mainframe = JFactory::getApplication();
     $jinput = $mainframe->input;
     $this->my = CFactory::getUser();
     parent::__construct($config);
     $view = $jinput->request->get('view', '');
     $this->set('assets', CAssets::getInstance());
 }
Exemple #2
0
 private function setEditor()
 {
     $config = CFactory::getConfig();
     $editors = $config->get('editors');
     $editorsInArray = explode(',', $editors);
     $communityEditor = in_array($this->type, $editorsInArray);
     if ($communityEditor) {
         if ($this->type == 'jomsocial') {
             // Trigger load default library.
             CAssets::getInstance();
         }
     }
 }
Exemple #3
0
 /**
  * The default method that will display the output of this view which is called by
  * Joomla
  *
  * @param   string template Template file name
  **/
 public function display($tpl = null)
 {
     // Trigger load default library.
     CAssets::getInstance();
     if ($this->getLayout() == 'edit') {
         $this->_displayEditLayout($tpl);
         return;
     }
     $document = JFactory::getDocument();
     // Set the titlebar text
     JToolBarHelper::title(JText::_('COM_COMMUNITY_GROUPS'), 'groups');
     // Add the necessary buttons
     JToolBarHelper::addNew('newGroup', JText::_('COM_COMMUNITY_PROFILES_NEW_GROUP'));
     JToolBarHelper::deleteList(JText::_('COM_COMMUNITY_GROUP_DELETION_WARNING'), 'deleteGroup', JText::_('COM_COMMUNITY_DELETE'));
     JToolBarHelper::divider();
     JToolBarHelper::publishList('publish', JText::_('COM_COMMUNITY_PUBLISH'));
     JToolBarHelper::unpublishList('unpublish', JText::_('COM_COMMUNITY_UNPUBLISH'));
     // Get required data's
     $groups = $this->get('Groups');
     $categories = $this->get('Categories');
     $pagination = $this->get('Pagination');
     // We need to assign the users object to the groups listing to get the users name.
     for ($i = 0; $i < count($groups); $i++) {
         $row =& $groups[$i];
         $row->user = CFactory::getUser($row->ownerid);
         $row->description = strip_tags($row->description, '<strong><a>');
         $row->description = CStringHelper::trim($row->description, 200);
         $row->category = $this->_getCatName($categories, $row->categoryid);
     }
     $mainframe = JFactory::getApplication();
     $filter_order = $mainframe->getUserStateFromRequest("com_community.groups.filter_order", 'filter_order', 'a.name', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest("com_community.groups.filter_order_Dir", 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest("com_community.users.search", 'search', '', 'string');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     $catHTML = $this->_getCategoriesHTML($categories);
     $this->assignRef('groups', $groups);
     $this->assignRef('categories', $catHTML);
     $this->assignRef('lists', $lists);
     $this->assignRef('search', $search);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
Exemple #4
0
 /**
  * The default method that will display the output of this view which is called by
  * Joomla
  *
  * @param	string template	Template file name
  **/
 public function display($tpl = null)
 {
     // Trigger load default library.
     CAssets::getInstance();
     $document = JFactory::getDocument();
     $config = CFactory::getConfig();
     // Get required data's
     $events = $this->get('Events');
     $categories = $this->get('Categories');
     $pagination = $this->get('Pagination');
     $mainframe = JFactory::getApplication();
     $filter_order = $mainframe->getUserStateFromRequest("com_community.events.filter_order", 'filter_order', 'a.title', 'cmd');
     $filter_order_Dir = $mainframe->getUserStateFromRequest("com_community.events.filter_order_Dir", 'filter_order_Dir', '', 'word');
     $search = $mainframe->getUserStateFromRequest("com_community.events.search", 'search', '', 'string');
     // table ordering
     $lists['order_Dir'] = $filter_order_Dir;
     $lists['order'] = $filter_order;
     // We need to assign the users object to the groups listing to get the users name.
     for ($i = 0; $i < count($events); $i++) {
         $row =& $events[$i];
         $row->user = JFactory::getUser($row->creator);
         // Truncate the description
         $row->description = str_ireplace('<p>', '', $row->description);
         $row->description = str_ireplace('</p>', '', $row->description);
         $row->description = CStringHelper::trim($row->description, 200);
         $date = new JDate($row->startdate);
         $row->startdate = $date->format('Y-m-d');
         $row->category = $this->_getCatName($categories, $row->catid);
     }
     $catHTML = $this->_getCategoriesHTML($categories);
     $this->assignRef('events', $events);
     $this->assignRef('categories', $catHTML);
     $this->assignRef('search', $search);
     $this->assignRef('lists', $lists);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
Exemple #5
0
<?php

/**
* @copyright (C) 2013 iJoomla, Inc. - All rights reserved.
* @license GNU General Public License, version 2 (http://www.gnu.org/licenses/gpl-2.0.html)
* @author iJoomla.com <*****@*****.**>
* @url https://www.jomsocial.com/license-agreement
* The PHP code portions are distributed under the GPL license. If not otherwise stated, all images, manuals, cascading style sheets, and included JavaScript *are NOT GPL, and are released under the IJOOMLA Proprietary Use License v1.0
* More info at https://www.jomsocial.com/license-agreement
*/
defined('_JEXEC') or die('Restricted access');
// Trigger load default library.
CAssets::getInstance();
?>
<script type="text/javascript">
	function getBirthday(years)
	{
		if(years=="")
		{
			return false;
		}

		var now 		= new Date();
		var birthday	= new Date(now.getTime()-years*365*24*60*60*1000);
		var date 		= birthday.getDate()+"/"+birthday.getMonth()+"/"+birthday.getFullYear();

		return date;
	}

	function submitSearchForm()
	{
Exemple #6
0
 /**
  * Attach assets
  * @param type $path
  * @param type $type
  * @param type $assetPath
  */
 public static function attach($path, $type, $assetPath = '')
 {
     $assets = CAssets::getInstance();
     $assets->attach($path, $type, $assetPath);
 }