Пример #1
0
 /**
  * Method to display a view.
  *
  * @param    boolean    $cachable     If true, the view output will be cached
  * @param    array      $urlparams    An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return   JController   This object to support chaining.
  * @since    1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     // Load the submenu.
     WebgalleryHelper::addSubmenu(JRequest::getCmd('view', 'items'));
     $view = JRequest::getCmd('view', 'items');
     JRequest::setVar('view', $view);
     parent::display();
     return $this;
 }
Пример #2
0
 /**
  * Method to display a view.
  *
  * @param    boolean    $cachable     If true, the view output will be cached
  * @param    array      $urlparams    An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return    JController   This object to support chaining.
  * @since    1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     // Load the submenu.
     WebgalleryHelper::addSubmenu(JRequest::getCmd('view', 'items'));
     $view = JRequest::getCmd('view', 'items');
     JRequest::setVar('view', $view);
     parent::display();
     // Debug
     $doc = JFactory::getDocument();
     if ((AKDEBUG || JDEBUG) && $doc->getType() == 'html') {
         echo '<hr style="clear:both;" />';
         echo AKHelper::_('system.renderProfiler', 'WindWalker');
     }
     return $this;
 }
Пример #3
0
AKHelper::_('path.setOption', 'com_webgallery');
// Some useful settings
if ($app->isSite()) {
    // Include Admin language as global language.
    $lang->load('', JPATH_ADMINISTRATOR);
    $lang->load('com_webgallery', JPATH_COMPONENT_ADMINISTRATOR);
    WebgalleryHelper::_('lang.loadAll', $lang->getTag());
    // Include Joomla! admin css
    WebgalleryHelper::_('include.sortedStyle', 'includes/css');
    // set Base to fix toolbar anchor bug
    $doc->setBase(JFactory::getURI()->toString());
} else {
    WebgalleryHelper::_('lang.loadAll', $lang->getTag());
    WebgalleryHelper::_('include.sortedStyle', 'includes/css');
}
// Include Fields
JForm::addFieldPath(AKPATH_FORM . '/fields');
// Detect version
WebgalleryHelper::_('plugin.attachPlugins');
// Debug
define('AKDEBUG', WebgalleryHelper::_('system.getConfig', 'system.debug', false, 'com_webgallery'));
define('AKDEV', WebgalleryHelper::_('system.getConfig', 'system.development_mode', true, 'com_webgallery'));
/* API Client init 
AKHelper::_('api.initClient', null , array(
    'username'     => 'username' ,
    'password'     => 'password' ,
    'host'         => '' ,
    'component' => 'com_webgallery'
) );
*/
include_once WEBGALLERY_ADMIN . '/class/thumb.php';
Пример #4
0
$listDirn = $this->state->get('list.direction');
$originalOrders = array();
// For Joomla!3.0
// ================================================================================
if (JVERSION >= 3) {
    JHtml::_('bootstrap.tooltip');
    JHtml::_('dropdown.init');
    JHtml::_('formbehavior.chosen', 'select');
    // For Site
    if ($app->isSite()) {
        WebgalleryHelper::_('include.isis');
    }
} else {
    // For Site
    if ($app->isSite()) {
        WebgalleryHelper::_('include.bluestork');
        // WebgalleryHelper::_('include.fixBootstrapToJoomla');
    }
}
?>

<?php 
if (JVERSION >= 3) {
    ?>
<!-- Sort Table by Filter seletor -->
<script type="text/javascript">
    
    <?php 
    if ($app->isSite()) {
        ?>
    WindWalker.fixToolbar(40, 300) ;
Пример #5
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return   JDatabaseQuery
  * @since    1.6
  */
 protected function getListQuery()
 {
     // Get some data
     // ========================================================================
     // Create a new query object.
     $db = $this->getDbo();
     $q = $db->getQuery(true);
     $order = $this->getState('list.ordering', 'a.id');
     $dir = $this->getState('list.direction', 'asc');
     $prefix = $this->getState('list.orderingPrefix', array());
     $orderCol = $this->getState('list.orderCol', 'a.ordering');
     // Filter and Search
     $filter = $this->getState('filter', array());
     $search = $this->getState('search');
     $wheres = $this->getState('query.where', array());
     $having = $this->getState('query.having', array());
     $layout = JRequest::getVar('layout');
     $nested = $this->getState('items.nested');
     $avoid = JRequest::getVar('avoid');
     $show_root = JRequest::getVar('show_root');
     // Nested
     // ========================================================================
     if ($nested && !$show_root) {
         $q->where("a.id != 1");
     }
     if ($avoid) {
         $table = $this->getTable();
         $table->load($avoid);
         $q->where("a.lft < {$table->lft} OR a.rgt > {$table->rgt}");
         $q->where("a.id != {$avoid}");
     }
     // Search
     // ========================================================================
     $q = $this->searchCondition($search, $q);
     // Filter
     // ========================================================================
     $q = $this->filterCondition($filter, $q);
     // published
     if (empty($filter['a.published'])) {
         $q->where("{$db->qn('a.published')} >= 0");
     }
     // Ordering
     // ========================================================================
     if ($orderCol == $order) {
         $prefix = count($prefix) ? implode(', ', $prefix) . ', ' : '';
     } else {
         $prefix = '';
     }
     $order = $db->qn($order);
     // Custom Where
     // ========================================================================
     foreach ($wheres as $k => $v) {
         $q->where($v);
     }
     // Custom Having
     // ========================================================================
     foreach ($having as $k => $v) {
         $q->having($v);
     }
     // Build query
     // ========================================================================
     // get select columns
     $select = WebgalleryHelper::_('db.getSelectList', $this->config['tables']);
     //build query
     $q->select($select)->from('#__webgallery_items AS a')->leftJoin('#__categories  AS b ON a.catid = b.id')->leftJoin('#__users       AS c ON a.created_by = c.id')->leftJoin('#__viewlevels  AS d ON a.access = d.id')->leftJoin('#__languages   AS e ON a.language = e.lang_code')->order("{$prefix}{$order} {$dir}");
     return $q;
 }
Пример #6
0
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_webgallery
 *
 * @copyright   Copyright (C) 2012 Asikart. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Generated by AKHelper - http://asikart.com
 */
// no direct access
defined('_JEXEC') or die;
if (AKDEBUG) {
    WebgalleryHelper::_('include.quickedit');
}
// Init some API objects
// ================================================================================
$app = JFactory::getApplication();
$date = JFactory::getDate('now', JFactory::getConfig()->get('offset'));
$doc = JFactory::getDocument();
$uri = JFactory::getURI();
$user = JFactory::getUser();
$userId = $user->get('id');
// List Control
// ================================================================================
$nested = $this->state->get('items.nested');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
$orderCol = $this->state->get('list.orderCol', 'a.ordering');
$canOrder = $user->authorise('core.edit.state', 'com_webgallery');
$saveOrder = $listOrder == $orderCol || $listOrder == 'a.lft' && $listDirn == 'asc';
Пример #7
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return    JDatabaseQuery
  * @since    1.6
  */
 protected function getListQuery()
 {
     // Create a new query object.
     $db = $this->getDbo();
     $q = $db->getQuery(true);
     $order = $this->getState('list.ordering', 'a.id');
     $dir = $this->getState('list.direction', 'asc');
     $date = JFactory::getDate('now', JFactory::getConfig()->get('offset'));
     $user = JFactory::getUser();
     // Filter and Search
     $filter = $this->getState('filter', array());
     $search = $this->getState('search', array());
     $wheres = $this->getState('query.where', array());
     $having = $this->getState('query.having', array());
     // Category
     // =====================================================================================
     $category = $this->getCategory();
     if (in_array('b.lft', $this->filter_fields) && in_array('b.rgt', $this->filter_fields)) {
         $q->where("( b.lft >= {$category->lft} AND b.rgt <= {$category->rgt} )");
     }
     // Max Level
     // =====================================================================================
     $maxLevel = $this->getState('filter.max_category_levels', -1);
     if ($maxLevel > 0) {
         $q->where("b.level <= {$maxLevel}");
     }
     // Edit Access
     // =====================================================================================
     if ($this->getState('filter.unpublished')) {
         $q->where('a.published >= 0');
     } else {
         $q->where('a.published > 0');
         $nullDate = $db->Quote($db->getNullDate());
         $nowDate = $db->Quote($date->toSQL(true));
         if (in_array('a.publish_up', $this->filter_fields) && in_array('a.publish_down', $this->filter_fields)) {
             // $q->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')');
             // $q->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')');
         }
     }
     // View Level
     // =====================================================================================
     if ($access = $this->getState('filter.access') && in_array('a.access', $this->filter_fields)) {
         $groups = implode(',', $user->getAuthorisedViewLevels());
         $q->where('a.access IN (' . $groups . ')');
     }
     // Language
     // =====================================================================================
     if ($this->getState('filter.language') && in_array('a.language', $this->filter_fields)) {
         $lang_code = $db->quote(JFactory::getLanguage()->getTag());
         $q->where("a.language IN ('{$lang_code}', '*')");
     }
     // Filter
     // ========================================================================
     foreach ($filter as $k => $v) {
         if ($v !== '' && $v != '*' && in_array($k, $this->filter_fields)) {
             $k = $db->qn($k);
             $q->where("{$k}='{$v}'");
         }
     }
     // Search
     // ========================================================================
     $searc_where = array();
     foreach ($search as $k => $v) {
         if (in_array($k, $this->filter_fields)) {
             $k = $db->qn($k);
             $searc_where[] = "{$k} LIKE '{$v}'";
         }
     }
     if (count($searc_where)) {
         $q->where(' ( ' . implode(' OR ', $searc_where) . ' ) ');
     }
     // Custom Where
     // ========================================================================
     foreach ($wheres as $k => $v) {
         $q->where($v);
     }
     // Custom Having
     // ========================================================================
     foreach ($having as $k => $v) {
         $q->having($v);
     }
     // get select columns
     $select = WebgalleryHelper::_('db.getSelectList', $this->config['tables']);
     //build query
     $q->select($select)->from('#__categories AS a')->leftJoin('#__users         AS c ON a.created_user_id = c.id')->leftJoin('#__viewlevels     AS d ON a.access = d.id')->leftJoin('#__languages     AS e ON a.language = e.lang_code')->where("a.extension = 'com_webgallery'")->order(" {$order} {$dir}");
     return $q;
 }
Пример #8
0
<?php

/**
 * @package     Joomla.Administrator
 * @subpackage  com_webgallery
 *
 * @copyright   Copyright (C) 2012 Asikart. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 * @author      Generated by AKHelper - http://asikart.com
 */
// no direct access
defined('_JEXEC') or die;
JHtml::_('behavior.tooltip');
WebgalleryHelper::_('include.bootstrap', true);
$user = JFactory::getUser();
$userId = $user->get('id');
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
$canOrder = $user->authorise('core.edit.state', 'com_webgallery');
$saveOrder = $listOrder == 'a.ordering';
?>
<form action="<?php 
echo JRoute::_('index.php?option=com_webgallery&view=items');
?>
" method="post" name="adminForm" id="adminForm">
    
    <div id="webgallery-wrap" class="windwalker list container-fluid items<?php 
echo $this->get('pageclass_sfx');
?>
">
        <div id="webgallery-wrap-inner">
Пример #9
0
 /**
  * Display the view
  */
 public function display($tpl = null)
 {
     $app = JFactory::getApplication();
     $user = JFactory::getUser();
     $this->state = $this->get('State');
     $this->params = $this->state->get('params');
     $this->item = $this->get('Item');
     $this->category = $this->get('Category');
     $this->canDo = WebgalleryHelper::getActions();
     // Thumb
     $this->thumbObject = new WebgalleryThumb($this->item->id);
     $files = array();
     if (JFolder::exists($this->thumbObject->getPath())) {
         $files = JFolder::files($this->thumbObject->getPath());
     }
     $imgs = array();
     foreach ($files as $file) {
         $img = new StdClass();
         $img->thumbnail = $file;
         $imgs[$file] = $img;
     }
     $this->imgs = $imgs;
     $layout = $this->getLayout();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     if ($layout == 'edit') {
         $this->form = $this->get('Form');
         $this->fields_group = $this->get('FieldsGroup');
         $this->fields = $this->get('FieldsName');
         parent::displayWithPanel($tpl);
         return true;
     }
     // Prepare setting data
     $this->item = new JObject(get_object_vars($this->item));
     $item = $this->item;
     // Link
     // =====================================================================================
     $item->link = new JURI("index.php?option=com_webgallery&view=item&id={$item->id}");
     $item->link->setVar('alias', $item->get('alias'));
     $item->link->setVar('catid', $item->get('catid'));
     $item->link = JRoute::_((string) $item->link);
     $item->tags = new JHelperTags();
     $item->tags->getItemTags('com_webgallery.item', $item->id);
     // Dsplay Data
     // =====================================================================================
     $item->created_user = JFactory::getUser($item->created_by)->get('name');
     $item->cat_title = isset($this->category) ? $this->category->title : null;
     if ($item->modified == '0000-00-00 00:00:00') {
         $item->modified = '';
     }
     // Can Edit
     // =====================================================================================
     if (!$user->get('guest')) {
         $userId = $user->get('id');
         $asset = 'com_webgallery.item.' . $item->id;
         // Check general edit permission first.
         if ($user->authorise('core.edit', $asset)) {
             $this->params->set('access-edit', true);
         } elseif (!empty($userId) && $user->authorise('core.edit.own', $asset)) {
             // Check for a valid user and that they are the owner.
             if ($userId == $item->created_by) {
                 $this->params->set('access-edit', true);
             }
         }
     }
     // View Level
     // =====================================================================================
     if ($access = $this->state->get('filter.access')) {
         // If the access filter has been set, we already know this user can view.
         $this->params->set('access-view', true);
     } else {
         // If no access filter is set, the layout takes some responsibility for display of limited information.
         $user = JFactory::getUser();
         $groups = $user->getAuthorisedViewLevels();
         if (!$item->get('catid') || empty($this->category->access)) {
             $this->params->set('access-view', in_array($item->get('access'), $groups));
         } else {
             $this->params->set('access-view', in_array($item->access, $groups) && in_array($this->category->access, $groups));
         }
     }
     // Publish Date
     // =====================================================================================
     $pup = JFactory::getDate($item->get('publish_up'), JFactory::getConfig()->get('offset'))->toUnix(true);
     $pdw = JFactory::getDate($item->get('publish_down'), JFactory::getConfig()->get('offset'))->toUnix(true);
     $now = JFactory::getDate('now', JFactory::getConfig()->get('offset'))->toUnix(true);
     $null = JFactory::getDate('0000-00-00 00:00:00', JFactory::getConfig()->get('offset'))->toUnix(true);
     if ($now < $pup && $pup != $null || $now > $pdw && $pdw != $null) {
         $item->published = 0;
     }
     // Plugins
     // =====================================================================================
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('content');
     $item->text = $this->params->get('show_intro', 1) ? $item->introtext : $item->introtext;
     $results = $dispatcher->trigger('onContentPrepare', array('com_webgallery.item', &$item, &$this->params, 0));
     $item->event = new stdClass();
     $results = $dispatcher->trigger('onContentAfterTitle', array('com_webgallery.item', &$item, &$this->params, 0));
     $item->event->afterDisplayTitle = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onContentBeforeDisplay', array('com_webgallery.item', &$item, &$this->params, 0));
     $item->event->beforeDisplayContent = trim(implode("\n", $results));
     $results = $dispatcher->trigger('onContentAfterDisplay', array('com_webgallery.item', &$item, &$this->params, 0));
     $item->event->afterDisplayContent = trim(implode("\n", $results));
     // Params
     // =====================================================================================
     // Merge item params. If this is single-item view, menu params override article params
     // Otherwise, item params override menu item params
     $active = $app->getMenu()->getActive();
     $temp = clone $this->params;
     $item->params = new JRegistry($item->params);
     // Check to see which parameters should take priority
     if ($active) {
         $currentLink = $active->link;
         // If the current view is the active item and an item view for this item,
         // then the menu item params take priority
         if (strpos($currentLink, 'view=item') && strpos($currentLink, '&id=' . (string) $item->id)) {
             // $item->params are the item params, $temp are the menu item params
             // Merge so that the menu item params take priority
             $item->params->merge($temp);
             // Load layout from active query (in case it is an alternative menu item)
             if (isset($active->query['layout'])) {
                 $this->setLayout($active->query['layout']);
             }
         } else {
             // Current view is not a single item, so the item params take priority here
             // Merge the menu item params with the item params so that the item params take priority
             $temp->merge($item->params);
             $this->params = $temp;
             // Check for alternative layouts (since we are not in a single-item menu item)
             // Single-item menu item layout takes priority over alt layout for an item
             if ($layout = $this->params->get('item_layout')) {
                 $this->setLayout($layout);
             }
             // If not Active, set Title
             $this->setTitle($item->get('title'));
         }
     } else {
         // Merge so that article params take priority
         $temp->merge($this->params);
         $this->params = $temp;
         // Check for alternative layouts (since we are not in a single-article menu item)
         // Single-article menu item layout takes priority over alt layout for an article
         if ($layout = $this->params->get('item_layout')) {
             $this->setLayout($layout);
         }
         // If not Active, set Title
         $this->setTitle($item->get('title'));
     }
     $item->params = $this->params;
     parent::display($tpl);
 }
Пример #10
0
?>
<div id="<?php 
echo $anchor_id;
?>
" class="categories-item item">
    <div class="categories-item-inner">
        
        <?php 
if ($canEdit) {
    ?>
        <!-- Edit -->
        <!-- ============================================================================= -->
        <div class="edit-icon btn-toolbar fltrt">
            <div class="btn-group">
                <?php 
    echo JHtml::_('link', JRoute::_('index.php?option=com_webgallery&task=category.edit&id=' . $item->a_id . '&return=' . WebgalleryHelper::_('uri.base64', 'encode', $uri->toString())), JText::_('JTOOLBAR_EDIT'), array('class' => 'btn btn-small'));
    ?>
                <button class="btn btn-small dropdown-toggle" data-toggle="dropdown">
                    <span class="caret"></span>
                </button>
                <ul class="dropdown-menu">
                    <li>
                        <a class="jgrid" href="javascript:void(0);" onclick="return listItemTask('cb<?php 
    echo $item->a_id;
    ?>
','categories.publish')" title="啟用"><?php 
    echo JText::_('JTOOLBAR_ENABLE');
    ?>
</a>
                    </li>
                    <li>
Пример #11
0
function webgalleryLoader($uri)
{
    return WebgalleryHelper::_('loader.import', $uri);
}
Пример #12
0
 /**
  * Build an SQL query to load the list data.
  *
  * @return   JDatabaseQuery
  * @since    1.6
  */
 protected function getListQuery()
 {
     // Get some data
     // ========================================================================
     // Create a new query object.
     $db = $this->getDbo();
     $q = $db->getQuery(true);
     $order = $this->getState('list.ordering', 'a.id');
     $dir = $this->getState('list.direction', 'asc');
     $prefix = $this->getState('list.orderingPrefix', array());
     $orderCol = $this->getState('list.orderCol', 'a.ordering');
     // Filter and Search
     $filter = $this->getState('filter', array());
     $search = $this->getState('search');
     $wheres = $this->getState('query.where', array());
     $having = $this->getState('query.having', array());
     $layout = JRequest::getVar('layout');
     $show_root = JRequest::getVar('show_root');
     // Search
     // ========================================================================
     $q = $this->searchCondition($search, $q);
     // Filter
     // ========================================================================
     $q = $this->filterCondition($filter, $q);
     // Custom Where
     // ========================================================================
     foreach ($wheres as $k => $v) {
         $q->where($v);
     }
     // Custom Having
     // ========================================================================
     foreach ($having as $k => $v) {
         $q->having($v);
     }
     // Build query
     // ========================================================================
     // get select columns
     $select = WebgalleryHelper::_('db.getSelectList', $this->config['tables']);
     //build query
     $q->select($select)->from('#__webgallery_thumbnails AS a')->leftJoin('#__webgallery_items  AS b ON a.item_id = b.id')->order("a.id {$dir}");
     return $q;
 }
Пример #13
0
                </div>
            
            </div>
            
            <div class="clr"></div>
            
            <?php 
    echo $tabs ? WebgalleryHelper::_('panel.endPanel', 'itemTab', $group) : null;
    ?>
            
        <?php 
}
?>
        
        <?php 
echo $tabs ? WebgalleryHelper::_('panel.endTabs') : null;
?>
    
    
    <!-- Hidden Inputs -->
    <div id="hidden-inputs">
        <input type="hidden" name="option" value="com_webgallery" />
        <input type="hidden" name="task" value="" />
        <?php 
echo JHtml::_('form.token');
?>
    </div>
    <div class="clr"></div>
</form>

</div>