Ejemplo n.º 1
0
 function display($tpl = null)
 {
     JHTML::_('behavior.mootools');
     JHTML::_('behavior.keepalive');
     $app =& JFactory::getApplication();
     $document =& JFactory::getDocument();
     $id = (int) JRequest::getVar('id');
     $force_fixed_size = JRequest::getVar('fixed', 0);
     $name = JRequest::getVar('name');
     $galleries = RokGallery_Model_GalleryTable::getAll();
     $current_gallery = false;
     if (null != $id) {
         $current_gallery = RokGallery_Model_GalleryTable::getSingle($id);
     }
     if (null != $name) {
         $default_name = $name . rc__('ROKGALLERY_GALLERY_CREATE_DEFAULT_EXTENSION');
     }
     $this->assign('default_name', $default_name);
     $this->assign('current_gallery_id', $id);
     $this->assign('force_fixed_size', $force_fixed_size);
     $this->assignRef('galleries', $galleries);
     $this->assignRef('current_gallery', $current_gallery);
     $this->assign('context', 'com_rokgallery.gallerymanager');
     $this->setLayout('default');
     parent::display($tpl);
 }
Ejemplo n.º 2
0
    function display($tpl = null)
    {
        JHTML::_('behavior.mootools');
        JHTML::_('behavior.keepalive');
        $option = JRequest::getCmd('option');
        $document =& JFactory::getDocument();
        $session =& JFactory::getSession();
        $model = new RokGallery_Admin_MainPage();
        $current_page = 1;
        $items_per_page = RokGallery_Config::getOption(RokGallery_Config::OPTION_ADMIN_ITEMS_PER_PAGE, 6);
        $items_per_row = RokGallery_Config::getOption(RokGallery_Config::OPTION_ADMIN_ITEMS_PER_ROW, 3);
        $files = $model->getFiles($current_page, $items_per_page * 2);
        $pager = $model->getPager($current_page, $items_per_page * 2);
        $next_page = $current_page == 1 ? 3 : $current_page + 1;
        $next_page = $current_page == $pager->getLastPage() ? false : $next_page;
        $more_pages = $next_page == false ? "false" : "true";
        $application = JURI::root(true) . '/administrator/components/' . $option . '/assets/application/';
        $images = JURI::root(true) . '/administrator/components/' . $option . '/assets/images/';
        $url = JURI::root(true) . '/administrator/index.php?option=com_rokgallery&task=ajax&format=raw';
        // debug: &XDEBUG_SESSION_START=default
        $document->addScriptDeclaration('var RokGallerySettings = {
			application: "' . $application . '", 
			images: "' . $images . '", 
			next_page: "' . $next_page . '",
            last_page: "' . $pager->getLastPage() . '",
			more_pages: ' . $more_pages . ', 
			items_per_page: "' . $items_per_page . '",
            total_items: ' . $pager->getNumResults() . ',
			url: "' . $url . '", 
			token: "' . JUtility::getToken() . '", 
			session: {
				name: "' . $session->getName() . '", 
				id: "' . $session->getId() . '"
			},
			order: ["order-created_at", "order-desc"]
		};');
        $document->addStyleSheet('components/' . $option . '/assets/styles/master.css');
        if (RokCommon_Browser::getShortName() == 'ie8') {
            $document->addStyleSheet('components/' . $option . '/assets/styles/internet-explorer-8.css');
        }
        $document->addScript('components/' . $option . '/assets/application/Common.js');
        $document->addScript('components/' . $option . '/assets/application/RokGallery.js');
        $document->addScript('components/' . $option . '/assets/application/RokGallery.Filters.js');
        $document->addScript('components/' . $option . '/assets/application/RokGallery.Blocks.js');
        $document->addScript('components/' . $option . '/assets/application/RokGallery.FileSettings.js');
        $document->addScript('components/' . $option . '/assets/application/RokGallery.Edit.js');
        $document->addScript('components/' . $option . '/assets/application/MainPage.js');
        $document->addScript('components/' . $option . '/assets/application/Tags.js');
        $document->addScript('components/' . $option . '/assets/application/Tags.Slice.js');
        $document->addScript('components/' . $option . '/assets/application/Tags.Ajax.js');
        $document->addScript('components/' . $option . '/assets/application/Scrollbar.js');
        $document->addScript('components/' . $option . '/assets/application/Popup.js');
        $document->addScript('components/' . $option . '/assets/application/Progress.js');
        $document->addScript('components/' . $option . '/assets/application/Job.js');
        $document->addScript('components/' . $option . '/assets/application/JobsManager.js');
        $document->addScript('components/' . $option . '/assets/application/MassTags.js');
        $document->addScript('components/' . $option . '/assets/application/GalleriesManager.js');
        $document->addScript('components/' . $option . '/assets/application/Swiff.Uploader.js');
        $document->addScript('components/' . $option . '/assets/application/Uploader.js');
        $document->addScript('components/' . $option . '/assets/application/Rubberband.js');
        $document->addScript('components/' . $option . '/assets/application/Marquee.js');
        $document->addScript('components/' . $option . '/assets/application/Marquee.Crop.js');
        $galleries = RokGallery_Model_GalleryTable::getAll();
        if ($galleries === false) {
            $galleries = array();
        }
        $this->assign('total_items_in_filter', $pager->getNumResults());
        $this->assign('items_to_be_rendered', $pager->getResultsInPage());
        $this->assign('next_page', $next_page);
        $this->assign('items_per_page', $items_per_page);
        $this->assign('items_per_row', $items_per_row);
        $this->assign('currently_shown_items', $pager->getLastIndice());
        $this->assign('totalFilesCount', $pager->getNumResults());
        $this->assignRef('files', $files);
        $this->assignRef('galleries', $galleries);
        parent::display($tpl);
    }