Ejemplo n.º 1
0
 /**
  * 
  * @return void
  **/
 function _default($tpl = null)
 {
     Mysite::load('DSCTools', 'library.tools');
     // check config
     $row = Mysite::getInstance();
     $this->assign('row', $row);
     // add toolbar buttons
     JToolBarHelper::save('save');
     JToolBarHelper::cancel('close', JText::_('Close'));
     // plugins
     $filtered = array();
     $items = DSCTools::getPlugins();
     for ($i = 0; $i < count($items); $i++) {
         $item =& $items[$i];
         // Check if they have an event
         if ($hasEvent = DSCTools::hasEvent($item, 'onListConfigMysite')) {
             // add item to filtered array
             $filtered[] = $item;
         }
     }
     $items = $filtered;
     $this->assign('items_sliders', $items);
     // Add pane
     jimport('joomla.html.pane');
     $sliders = JPane::getInstance('sliders');
     $this->assign('sliders', $sliders);
     // form
     $validate = JUtility::getToken();
     $form = array();
     $view = strtolower(JRequest::getVar('view'));
     $form['action'] = "index.php?option=com_mysite&controller={$view}&view={$view}";
     $form['validate'] = "<input type='hidden' name='{$validate}' value='1' />";
     $this->assign('form', $form);
     // set the required image
     // TODO Fix this to use defines
     $required = new stdClass();
     $required->text = JText::_('Required');
     $required->image = "<img src='" . JURI::root() . "/media/com_mysite/images/required_16.png' alt='{$required->text}'>";
     $this->assign('required', $required);
 }
Ejemplo n.º 2
0
<?php

/**
 * @version	1.5
 * @package	Mysite
 * @author 	Dioscouri Design
 * @link 	http://www.dioscouri.com
 * @copyright Copyright (C) 2007 Dioscouri Design. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
Mysite::load('MysiteModelBase', 'models.base');
class MysiteModelConfig extends MysiteModelBase
{
}
Ejemplo n.º 3
0
<?php

/**
 * @version	1.5
 * @package	MySite
 * @author 	Dioscouri Design
 * @link 	http://www.dioscouri.com
 * @copyright Copyright (C) 2007 Dioscouri Design. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
Mysite::load('MysiteViewBase', 'views.base');
class MysiteViewMenus extends MysiteViewBase
{
    function _defaultToolbar()
    {
        JToolBarHelper::custom('generateItems', "refresh", "refresh", JText::_('Sync Sitemap Items'), true);
        JToolBarHelper::deleteList(JText::_('VALIDDELETEITEMS'));
    }
    /**
     * 
     * @return void
     **/
    function _form($tpl = null)
    {
        parent::_form($tpl);
        jimport('joomla.html.pane');
        $model = $this->getModel();
        // get the data
        $row = $model->getTable();
Ejemplo n.º 4
0
*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
// Check the registry to see if our Mysite class has been overridden
if (!class_exists('Mysite')) {
    JLoader::register("Mysite", JPATH_ADMINISTRATOR . DS . "components" . DS . "com_mysite" . DS . "defines.php");
}
// before executing any tasks, check the integrity of the installation
Mysite::getClass('MysiteHelperDiagnostics', 'helpers.diagnostics')->checkInstallation();
// set the options array
$options = array('site' => 'site', 'type' => 'components', 'ext' => 'com_mysite');
// Require the base controller
Mysite::load('MysiteController', 'controller', $options);
// Require specific controller if requested
$controller = JRequest::getWord('controller', JRequest::getVar('view'));
if (!Mysite::load('MysiteController' . $controller, "controllers.{$controller}", $options)) {
    $controller = '';
}
// redirect to default?
if (empty($controller)) {
    // redirect to default
    $redirect = "index.php?option=com_mysite&view=dashboard";
    $redirect = JRoute::_($redirect, false);
    JFactory::getApplication()->redirect($redirect);
}
// load the plugins
JPluginHelper::importPlugin('mysite');
// Create the controller
$classname = 'MysiteController' . $controller;
$controller = Mysite::getClass($classname);
// ensure a valid task exists
Ejemplo n.º 5
0
<?php

/**
 * @version	1.5
 * @package	Fingertips
 * @author 	Dioscouri Design
 * @link 	http://www.dioscouri.com
 * @copyright Copyright (C) 2007 Dioscouri Design. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
Mysite::load('MysiteTable', 'tables.base');
class MysiteTableMenus extends MysiteTable
{
    function MysiteTableMenus(&$db)
    {
        $tbl_key = 'menu_id';
        $tbl_suffix = 'menus';
        $this->set('_suffix', $tbl_suffix);
        $name = "mysite";
        parent::__construct("#__{$name}_{$tbl_suffix}", $tbl_key, $db);
    }
    function reorder($where = '')
    {
        $reorder = parent::reorder($where);
        // now, load the parent item for this menutype, and reorder it
        $table = JTable::getInstance('Items', 'MysiteTable');
        $table->load(array('menutype' => $this->menutype, 'parent' => 0));
        if (!empty($table->item_id)) {
            // reorder
Ejemplo n.º 6
0
 /**
  * 
  * @param unknown_type $selected
  * @param unknown_type $name
  * @param unknown_type $attribs
  * @param unknown_type $idtag
  * @param unknown_type $allowAny
  * @param unknown_type $allowNone
  * @param unknown_type $title
  * @param unknown_type $title_none
  * @param unknown_type $enabled
  */
 public static function item($selected, $name = 'filter_parentid', $attribs = array('class' => 'inputbox', 'size' => '1'), $idtag = null, $allowAny = false, $allowNone = false, $title = 'Select Parent', $title_none = 'No Parent', $enabled = null)
 {
     JModel::addIncludePath(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_mysite' . DS . 'models');
     $model = JModel::getInstance('Items', 'MysiteModel');
     $model->setState('order', 'tbl.ordering');
     $model->setState('direction', 'ASC');
     // establish the hierarchy of the menu
     $children = array();
     // get all rows from DB
     $rows = $model->getAll();
     // get children and create new list
     foreach ($rows as $v) {
         $parent = $v->parent;
         $v->parent_id = $v->parent;
         $items = @$children[$parent] ? $children[$parent] : array();
         array_push($items, $v);
         $children[$parent] = $items;
     }
     // set the max level
     $level = strlen($model->getState('filter_levellimit')) ? $model->getState('filter_levellimit') - 1 : 9999;
     // indent the list
     Mysite::load('MysiteMenu', 'library.menu');
     $items = MysiteMenu::treerecurse(0, '', array(), $children, $level, 0, 0, '- ', '--');
     if ($allowAny) {
         $list[] = self::option('', "- " . JText::_($title) . " -", 'item_id', 'title');
     }
     if ($allowNone) {
         $list[] = self::option('0', "- " . JText::_($title_none) . " -", 'item_id', 'title');
     }
     foreach (@$items as $item) {
         $list[] = self::option($item->item_id, $item->treename, 'item_id', 'title');
     }
     return self::genericlist($list, $name, $attribs, 'item_id', 'title', $selected, $idtag);
 }
Ejemplo n.º 7
0
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/
/** ensure this file is being included by a parent file */
defined('_JEXEC') or die('Restricted access');
// Check the registry to see if our Mysite class has been overridden
if (!class_exists('Mysite')) {
    JLoader::register("Mysite", JPATH_ADMINISTRATOR . DS . "components" . DS . "com_mysite" . DS . "defines.php");
}
// before executing any tasks, check the integrity of the installation
//Mysite::getClass( 'MysiteHelperDiagnostics', 'helpers.diagnostics' )->checkInstallation();
// Require the base controller
Mysite::load('MysiteController', 'controller');
// Require the base controller
// Require specific controller if requested
$controller = JRequest::getWord('controller', JRequest::getVar('view'));
if (!Mysite::load('MysiteController' . $controller, "controllers.{$controller}")) {
    $controller = '';
}
if (empty($controller)) {
    // redirect to default
    $default_controller = new MysiteController();
    $redirect = "index.php?option=com_mysite&view=" . $default_controller->default_view;
    $redirect = JRoute::_($redirect, false);
    JFactory::getApplication()->redirect($redirect);
}
JHTML::_('stylesheet', 'admin.css', 'media/com_mysite/css/');
$doc = JFactory::getDocument();
$uri = JURI::getInstance();
$js = "var com_mysite = {};\n";
$js .= "com_mysite.jbase = '" . $uri->root() . "';\n";
$doc->addScriptDeclaration($js);