Пример #1
0
 public function ajaxGetOlderWalls($groupId, $discussionId, $limitStart)
 {
     $filter = JFilterInput::getInstance();
     $groupId = $filter->clean($groupId, 'int');
     $discussionId = $filter->clean($discussionId, 'int');
     $limitStart = $filter->clean($limitStart, 'int');
     $limitStart = max(0, $limitStart);
     $response = new JAXResponse();
     $app = JFactory::getApplication();
     $my = CFactory::getUser();
     //$jconfig  = JFactory::getConfig();
     $groupModel = CFactory::getModel('groups');
     $isGroupAdmin = $groupModel->isAdmin($my->id, $groupId);
     $html = CWall::getWallContents('discussions', $discussionId, $isGroupAdmin, $app->getCfg('list_limit'), $limitStart, 'wall/content', 'groups,discussion', $groupId);
     // parse the user avatar
     $html = CStringHelper::replaceThumbnails($html);
     $html = CString::str_ireplace(array('{error}', '{warning}', '{info}'), '', $html);
     $config = CFactory::getConfig();
     $order = $config->get('group_discuss_order');
     if ($order == 'ASC') {
         // Append new data at Top.
         $response->addScriptCall('joms.walls.prepend', $html);
     } else {
         // Append new data at bottom.
         $response->addScriptCall('joms.walls.append', $html);
     }
     return $response->sendResponse();
 }
Пример #2
0
 public function ajaxGetOlderWalls($groupId, $discussionId, $limitStart)
 {
     $response = new JAXResponse();
     $my = CFactory::getUser();
     $jconfig = JFactory::getConfig();
     $groupModel = CFactory::getModel('groups');
     $isGroupAdmin = $groupModel->isAdmin($my->id, $groupId);
     CFactory::load('libraries', 'wall');
     $html = CWall::getWallContents('discussions', $discussionId, $isGroupAdmin, $jconfig->get('list_limit'), $limitStart, 'wall.content', 'groups,discussion', $groupId);
     // parse the user avatar
     CFactory::load('helpers', 'string');
     $html = CStringHelper::replaceThumbnails($html);
     $html = JString::str_ireplace(array('{error}', '{warning}', '{info}'), '', $html);
     $config = CFactory::getConfig();
     $order = $config->get('group_discuss_order');
     if ($order == 'ASC') {
         // Append new data at Top.
         $response->addScriptCall('joms.walls.prepend', $html);
     } else {
         // Append new data at bottom.
         $response->addScriptCall('joms.walls.append', $html);
     }
     return $response->sendResponse();
 }