Example #1
0
 /**
  * Display module contents
  *
  * @return     void
  */
 public function display()
 {
     if (!\App::isAdmin()) {
         return;
     }
     // include group page archive model
     require_once Component::path('com_groups') . DS . 'models' . DS . 'page' . DS . 'archive.php';
     // include group module archive model
     require_once Component::path('com_groups') . DS . 'models' . DS . 'module' . DS . 'archive.php';
     // get unapproved pages
     $groupModelPageArchive = new Models\Page\Archive();
     $this->unapprovedPages = $groupModelPageArchive->pages('unapproved', array('state' => array(0, 1)), true);
     // get unapproved modules
     $groupModelModuleArchive = new Models\Module\Archive();
     $this->unapprovedModules = $groupModelModuleArchive->modules('unapproved', array('state' => array(0, 1)), true);
     // Get the view
     parent::display();
 }
Example #2
0
 /**
  * Render Modules to group template or page
  *
  * @param    string
  */
 public function render()
 {
     // get the page id
     $pageid = $this->page ? $this->page->get('id') : 0;
     // get the list of modules
     $groupModuleArchive = Archive::getInstance();
     $modules = $groupModuleArchive->modules('list', array('gidNumber' => $this->group->get('gidNumber'), 'state' => array(1), 'approved' => $this->allMods == 1 ? array(0, 1) : array(1), 'position' => $this->params->position, 'orderby' => 'ordering ASC'));
     // loop through each module to display
     $content = '';
     foreach ($modules as $module) {
         // make sure module can be displayed
         if ($module->displayOnPage($pageid)) {
             $content .= $module->content('parsed');
         }
     }
     //return final output
     return $content;
 }
Example #3
0
 /**
  * Render Module to group template or page
  *
  * @param    string
  */
 public function render()
 {
     // var to hold content
     $content = '';
     // get the page id
     $pageid = $this->page ? $this->page->get('id') : null;
     // get the list of modules
     $groupModuleArchive = Archive::getInstance();
     $modules = $groupModuleArchive->modules('list', array('gidNumber' => $this->group->get('gidNumber'), 'state' => array(1), 'approved' => $this->allMods == 1 ? array(0, 1) : array(1), 'title' => $this->params->title, 'orderby' => 'ordering DESC'));
     // make sure we have a module
     if ($modules->count() < 1) {
         return $content;
     }
     // get first module
     $module = $modules->first();
     // make sure module can be displayed
     if ($module->displayOnPage($pageid)) {
         $content .= $module->content('parsed');
     }
     //return final output
     return $content;
 }
Example #4
0
 /**
  * Display Group Pages
  *
  * @return 	void
  */
 public function displayTask()
 {
     // check in for user
     Helpers\Pages::checkinForUser();
     // get group pages
     $pageArchive = new Page\Archive();
     $this->view->pages = $pageArchive->pages('tree', array('gidNumber' => $this->group->get('gidNumber'), 'state' => array(0, 1), 'orderby' => 'lft ASC'));
     // get page categories
     $categoryArchive = new Page\Category\Archive();
     $this->view->categories = $categoryArchive->categories('list', array('gidNumber' => $this->group->get('gidNumber'), 'orderby' => 'title'));
     // get modules archive
     $moduleArchive = new Module\Archive();
     $this->view->modules = $moduleArchive->modules('list', array('gidNumber' => $this->group->get('gidNumber'), 'state' => array(0, 1), 'orderby' => 'position ASC, ordering ASC'));
     // get request vars
     $this->view->search = Request::getWord('search', '');
     $this->view->filter = Request::getInt('filer', 0);
     //build pathway
     $this->_buildPathway();
     //build title
     $this->_buildTitle();
     //set view vars
     $this->view->title = Lang::txt('COM_GROUPS_PAGES_MANAGE') . ': ' . $this->group->get('description');
     // get view notifications
     $this->view->notifications = $this->getNotifications();
     $this->view->notifications = $this->view->notifications ? $this->view->notifications : array();
     $this->view->group = $this->group;
     $this->view->config = $this->config;
     //display
     $this->view->setLayout('manager');
     $this->view->display();
 }
Example #5
0
 /**
  * Edit Page Module
  *
  * @return void
  */
 public function editTask()
 {
     Request::setVar('hidemainmenu', 1);
     // get request vars
     $id = Request::getVar('id', array(0));
     if (is_array($id) && !empty($id)) {
         $id = $id[0];
     }
     // get the category object
     $this->view->module = new Module($id);
     // get a list of all pages for creating module menu
     $pageArchive = Page\Archive::getInstance();
     $this->view->pages = $pageArchive->pages('list', array('gidNumber' => $this->group->get('gidNumber'), 'state' => array(0, 1, 2), 'orderby' => 'lft'));
     // get a list of all pages for creating module menu
     $moduleArchive = Module\Archive::getInstance();
     $this->view->order = $moduleArchive->modules('list', array('gidNumber' => $this->group->get('gidNumber'), 'position' => $this->view->module->get('position'), 'state' => array(0, 1, 2), 'orderby' => 'ordering'));
     // are we passing a category object
     if ($this->module) {
         $this->view->module = $this->module;
     }
     // pass group to view
     $this->view->group = $this->group;
     // Set any errors
     foreach ($this->getErrors() as $error) {
         $this->view->setError($error);
     }
     // Output the HTML
     $this->view->setLayout('edit')->display();
 }
Example #6
0
 /**
  * Edit Module
  *
  * @return void
  */
 public function editTask()
 {
     //set to edit layout
     $this->view->setLayout('edit');
     // get request vars
     $moduleid = Request::getInt('moduleid', 0);
     // get the category object
     $this->view->module = new Module($moduleid);
     // are we passing a module object
     if ($this->module) {
         $this->view->module = $this->module;
     }
     // get a list of all pages for creating module menu
     $pageArchive = Page\Archive::getInstance();
     $this->view->pages = $pageArchive->pages('list', array('gidNumber' => $this->group->get('gidNumber'), 'state' => array(0, 1), 'orderby' => 'lft asc'));
     // get a list of all pages for creating module menu
     $moduleArchive = Module\Archive::getInstance();
     $this->view->order = $moduleArchive->modules('list', array('gidNumber' => $this->group->get('gidNumber'), 'position' => $this->view->module->get('position'), 'state' => array(0, 1), 'orderby' => 'ordering'));
     // get stylesheets for editor
     $this->view->stylesheets = Helpers\View::getPageCss($this->group);
     // build the title
     $this->_buildTitle();
     // build pathway
     $this->_buildPathway();
     // get view notifications
     $this->view->notifications = $this->getNotifications() ? $this->getNotifications() : array();
     $this->view->group = $this->group;
     //display layout
     $this->view->display();
 }