예제 #1
0
<?php

/**
 * @version   $Id$
 * @author    RocketTheme http://www.rockettheme.com
 * @copyright Copyright (C) 2007 - 2011 RocketTheme, LLC
 * @license   http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only
 */
if (RokCommon_Browser::getShortName() == 'ie7') {
    RokCommon_Header::addStyle(RokCommon_Composite::get($that->context)->getUrl('rokgallery-ie7.css'));
}
RokCommon_Header::addScript(RokCommon_Composite::get($that->context)->getUrl('loves' . RokGallery_Helper::getJSVersion() . '.js'));
예제 #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);
    }