Exemplo n.º 1
0
 public function initStates()
 {
     // Ordering, direction, search, limit, limitstart is handled by parent::initStates();
     parent::initStates();
     $state = $this->getUserStateFromRequest('state', 'all');
     $this->setState('state', $state);
 }
Exemplo n.º 2
0
 function __construct()
 {
     if (is_null(self::$_cache)) {
         self::$_cache = false;
     }
     parent::__construct('photos');
 }
Exemplo n.º 3
0
 public function getItems($options = array())
 {
     $db = FD::db();
     $sql = $db->sql();
     $sql->select('#__social_clusters_nodes', 'a');
     $sql->column('a.*');
     $sql->leftjoin('#__users', 'b');
     $sql->on('a.uid', 'b.id');
     if (FD::config()->get('users.blocking.enabled') && !JFactory::getUser()->guest) {
         $sql->leftjoin('#__social_block_users', 'bus');
         $sql->on('b.id', 'bus.user_id');
         $sql->on('bus.target_id', JFactory::getUser()->id);
         $sql->isnull('bus.id');
     }
     $sql->where('b.block', 0);
     if (!empty($options['groupid'])) {
         $sql->where('cluster_id', $options['groupid']);
     }
     if (isset($options['state'])) {
         $sql->where('state', $state);
     }
     if (isset($options['admin'])) {
         $sql->where('admin', $options['admin']);
     }
     $ordering = $this->getState('ordering');
     if (!empty($ordering)) {
         $direction = $this->getState('direction');
         if ($ordering == 'username') {
             $sql->order('b.username', $direction);
         } elseif ($ordering == 'name') {
             $sql->order('b.name', $direction);
         } else {
             $sql->order($ordering, $direction);
         }
     }
     $limit = $this->getState('limit');
     if ($limit > 0) {
         $this->setState('limit', $limit);
         // Get the limitstart.
         $limitstart = $this->getUserStateFromRequest('limitstart', 0);
         $limitstart = $limit != 0 ? floor($limitstart / $limit) * $limit : 0;
         $this->setState('limitstart', $limitstart);
         // Set the total number of items.
         $this->setTotal($sql->getTotalSql());
         // Get the list of users
         $result = parent::getData($sql->getSql());
     } else {
         $db->setQuery($sql);
         $result = $db->loadObjectList();
     }
     $members = array();
     foreach ($result as $row) {
         $member = FD::table('GroupMember');
         $member->bind($row);
         $members[] = $member;
     }
     return $members;
 }
Exemplo n.º 4
0
 /**
  * Populates the state
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function initStates()
 {
     $profile = $this->getUserStateFromRequest('profile');
     $group = $this->getUserStateFromRequest('group');
     $published = $this->getUserStateFromRequest('published', 'all');
     $this->setState('published', $published);
     $this->setState('group', $group);
     $this->setState('profile', $profile);
     parent::initStates();
 }
Exemplo n.º 5
0
 /**
  * Initializes all the generic states from the form
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function initStates()
 {
     $callback = JRequest::getVar('jscallback', '');
     $defaultFilter = $callback ? SOCIAL_STATE_PUBLISHED : 'all';
     $filter = $this->getUserStateFromRequest('state', $defaultFilter);
     $extension = $this->getUserStateFromRequest('extension', 'all');
     $this->setState('state', $filter);
     $this->setState('extension', $extension);
     parent::initStates();
 }
Exemplo n.º 6
0
 public function initStates()
 {
     $published = $this->getUserStateFromRequest('published', 'all');
     $ordering = $this->getUserStateFromRequest('ordering', 'published');
     $direction = $this->getUserStateFromRequest('direction', 'DESC');
     $this->setState('published', $published);
     $this->setState('ordering', $ordering);
     $this->setState('direction', $direction);
     parent::initStates();
 }
Exemplo n.º 7
0
 /**
  * Initializes all the generic states from the form
  *
  * @since	1.2
  * @access	public
  * @param	string
  * @return
  */
 public function initStates()
 {
     $filter = $this->getUserStateFromRequest('state', 'all');
     $ordering = $this->getUserStateFromRequest('ordering', 'ordering');
     $direction = $this->getUserStateFromRequest('direction', 'ASC');
     $this->setState('state', $filter);
     parent::initStates();
     // Override the ordering behavior
     $this->setState('ordering', $ordering);
     $this->setState('direction', $direction);
 }
Exemplo n.º 8
0
 public function initStates()
 {
     $config = FD::config();
     $mainframe = JFactory::getApplication();
     parent::initStates();
     // override the limit behavior
     $limit = $config->get('activity.pagination.limit');
     if ($mainframe->isAdmin()) {
         $limit = $config->get('activity.pagination.max');
     }
     $this->setState('limit', $limit);
 }
Exemplo n.º 9
0
 public function initStates()
 {
     $ordering = $this->getUserStateFromRequest('ordering', 'version');
     $direction = $this->getUserStateFromRequest('direction', 'asc');
     $version = $this->getUserStateFromRequest('version', 'all');
     $search = $this->getUserStateFromRequest('search', '');
     $this->setState('ordering', $ordering);
     $this->setState('direction', $direction);
     $this->setState('version', $version);
     $this->setState('search', $search);
     parent::initStates();
 }
Exemplo n.º 10
0
 public function initStates()
 {
     // Direction, search, limit, limitstart is handled by parent::initStates();
     parent::initStates();
     // Override ordering default value
     $ordering = $this->getUserStateFromRequest('ordering', 'a.id');
     $this->setState('ordering', $ordering);
     // Init other parameters
     $type = $this->getUserStateFromRequest('type', 'all');
     $state = $this->getUserStateFromRequest('state', 'all');
     $this->setState('type', $type);
     $this->setState('state', $state);
 }
Exemplo n.º 11
0
 public function initStates()
 {
     $state = $this->getUserStateFromRequest('published', 'all');
     $filter = $this->getUserStateFromRequest('extension', 'all');
     $group = $this->getUserStateFromRequest('group', 'all');
     $ordering = $this->getUserStateFromRequest('ordering', 'id');
     $direction = $this->getUserStateFromRequest('direction', 'asc');
     $this->setState('filter', $filter);
     $this->setState('published', $state);
     $this->setState('group', $group);
     $this->setState('ordering', $ordering);
     $this->setState('direction', $direction);
     parent::initStates();
 }
Exemplo n.º 12
0
 public function initStates()
 {
     // Direction, search, limit, limitstart, ordering is handled by parent::initStates();
     parent::initStates();
     $currentLayout = JFactory::getApplication()->input->getString('layout');
     if (empty($currentLayout)) {
         $currentLayout = 'country';
     }
     $previousLayout = $this->getUserState('layout');
     if ($currentLayout !== $previousLayout) {
         $this->setUserState('search', '');
     }
     $this->setUserState('layout', $currentLayout);
     // Init other parameters
     $state = $this->getUserStateFromRequest('state', 'all');
     $this->setState('state', $state);
 }
Exemplo n.º 13
0
 /**
  * Retrieves list of albums for admin area
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function getDataWithState()
 {
     $db = FD::db();
     // Get the query object
     $sql = $db->sql();
     $sql->select('#__social_albums', 'a');
     $sql->column('a.*');
     $sql->column('COUNT(b.id)', 'totalphotos');
     $sql->join('#__social_photos', 'b');
     $sql->on('a.id', 'b.album_id');
     $sql->group('a.id');
     // Determines if we should search for the title
     $search = $this->getState('search');
     if ($search) {
         $sql->where('a.title', '%' . $search . '%', 'LIKE', 'OR');
         $sql->where('a.caption', '%' . $search . '%', 'LIKE', 'OR');
     }
     // Determine the ordering
     $ordering = $this->getState('ordering');
     if ($ordering) {
         $direction = $this->getState('direction');
         $sql->order($ordering, $direction);
     }
     // We should only be picking up photos which are valid
     $sql->where('b.state', SOCIAL_STATE_PUBLISHED);
     // Determine the pagination limit
     $limit = $this->getState('limit');
     if ($limit) {
         // Set the total number of items.
         $this->setTotal($sql->getSql(), true);
         // Get the list of users
         $result = parent::getData($sql->getSql(), true);
     } else {
         $db->setQuery($sql);
         $result = $db->loadObjectList();
     }
     $albums = array();
     foreach ($result as $row) {
         $album = FD::table('Album');
         $album->bind($row);
         // Set custom attributes
         $album->totalphotos = $row->totalphotos;
         $albums[] = $album;
     }
     return $albums;
 }
Exemplo n.º 14
0
 public function getItemsWithState($options = array())
 {
     $db = FD::db();
     $sql = $db->sql();
     // Determines if user is filtering the items
     $state = $this->getState('state');
     $sql->column('a.*');
     $sql->column('b.name', 'actorName');
     $sql->column('c.title', 'clusterName');
     if ($state == '3') {
         $sql->select('#__social_stream_history', 'a');
     } else {
         $sql->select('#__social_stream', 'a');
     }
     $sql->join('#__users', 'b', 'INNER');
     $sql->on('a.actor_id', 'b.id');
     $sql->join('#__social_clusters', 'c', 'LEFT');
     $sql->on('a.cluster_id', 'c.id');
     if (!is_null($state) && $state != '3') {
         if ($state == 'all') {
             $sql->where('(', '', '', 'AND');
             $sql->where('a.state', '1', '=', 'OR');
             $sql->where('a.state', '2', '=', 'OR');
             $sql->where(')');
         } else {
             $sql->where('a.state', $state);
         }
     }
     // Ordering
     $ordering = $this->getState('ordering', 'created');
     if ($ordering) {
         $direction = $this->getState('direction') ? $this->getState('direction') : 'DESC';
         $sql->order($ordering, $direction);
     }
     // Set the total
     $this->setTotal($sql->getTotalSql());
     $result = parent::getData($sql->getSql());
     $this->pagination = parent::getPagination();
     return $result;
 }
Exemplo n.º 15
0
 public function initStates()
 {
     parent::initStates();
 }
Exemplo n.º 16
0
 public function __construct($config = array())
 {
     parent::__construct('tasks', $config);
 }
Exemplo n.º 17
0
 function __construct()
 {
     parent::__construct('steps');
 }
Exemplo n.º 18
0
 public function __construct($config = array())
 {
     parent::__construct('broadcast', $config);
 }
Exemplo n.º 19
0
 /**
  * method used in backend to list down all the privacy items.
  *
  */
 public function getList()
 {
     $db = FD::db();
     $sql = $db->sql();
     $sql->select('#__social_privacy');
     // Determines if user wants to search for something
     $search = $this->getState('search');
     if ($search) {
         $sql->where('type', $search, 'LIKE', 'OR');
         $sql->where('rule', $search, 'LIKE', 'OR');
         $sql->where('description', $search, 'LIKE', 'OR');
     }
     $ordering = $this->getState('ordering');
     if ($ordering) {
         $direction = $this->getState('direction');
         $sql->order($ordering, $direction);
     }
     $this->setTotal($sql->getTotalSql());
     $rows = parent::getData($sql->getSql());
     if (!$rows) {
         return false;
     }
     // We want to pass back a list of PointsTable object.
     $data = array();
     // Load the admin language file whenever there's points.
     JFactory::getLanguage()->load('com_easysocial', JPATH_ROOT . '/administrator');
     foreach ($rows as $row) {
         $privacy = FD::table('Privacy');
         $privacy->bind($row);
         $data[] = $privacy;
     }
     return $data;
 }
Exemplo n.º 20
0
 public function __construct($config = array())
 {
     parent::__construct('clustercategory', $config);
 }
Exemplo n.º 21
0
 function __construct()
 {
     parent::__construct('people');
 }
Exemplo n.º 22
0
 /**
  * Retrieves the list of reports
  *
  * @since	1.0
  * @access	public
  * @param	string
  * @return
  */
 public function getReports()
 {
     $db = FD::db();
     $sql = $db->sql();
     $sql->select('#__social_reports');
     $sql->column('*');
     $sql->column('COUNT(1)', 'total');
     // We need to group up the items to ensure the unique-ness
     $sql->group('extension', 'uid', 'type');
     // Determines if we need to search for something
     $search = $this->getState('search');
     if ($search) {
         $sql->where('title', '%' . $search . '%', 'LIKE', 'OR');
         $sql->where('message', '%' . $search . '%', 'LIKE', 'OR');
     }
     // Set the total objects
     $this->setTotal($sql->getTotalSql());
     // Set the ordering
     $ordering = $this->getState('ordering');
     if ($ordering) {
         $direction = $this->getState('direction');
         $sql->order($ordering, $direction);
     }
     // Get the real data now
     $result = parent::getData($sql->getSql());
     if (!$result) {
         return false;
     }
     $reports = array();
     foreach ($result as $item) {
         $report = FD::table('Report');
         $report->bind($item);
         // Inject the total reports
         $report->total = $item->total;
         $reports[] = $report;
     }
     return $reports;
 }
Exemplo n.º 23
0
 function __construct()
 {
     parent::__construct('uploader');
 }
Exemplo n.º 24
0
 function __construct()
 {
     parent::__construct('followers');
 }
Exemplo n.º 25
0
 function __construct()
 {
     parent::__construct('avatars');
 }
Exemplo n.º 26
0
 function __construct()
 {
     parent::__construct('comments');
 }
Exemplo n.º 27
0
 function __construct()
 {
     parent::__construct('story');
 }
Exemplo n.º 28
0
 public function __construct()
 {
     parent::__construct('fields');
 }
Exemplo n.º 29
0
 function __construct()
 {
     parent::__construct('conversations');
     parent::initStates();
 }
Exemplo n.º 30
0
 public function __construct()
 {
     parent::__construct('friends');
 }