Example #1
0
	/**
	 * Custom Constructor
	 */
	function __construct( $default = array() )
	{
		$default['default_task'] = 'showConfig';
		parent::__construct( $default );

		$this->registerTask( 'apply', 'save' );
	}
 static function addRoutes($app, $authenticateForRole)
 {
     //* /config/ routes - admin users only
     $app->group('/config', $authenticateForRole('admin'), function () use($app) {
         /*
          * id
          */
         $app->map("/get/:variableId/", function ($variableId) use($app) {
             ConfigController::getVariable($app, $variableId);
         })->via(['GET', 'POST']);
         /*
          *  name
          */
         $app->post("/get/", function () use($app) {
             ConfigController::getVariableByName($app);
         });
         /*
          *  name, value
          */
         $app->post("/insert/", function () use($app) {
             ConfigController::addVariable($app);
         });
         /*
          * id, indestructible, locked
          */
         $app->post("/update/permissions/:variableId/", function ($variableId) use($app) {
             ConfigController::saveVariablePermissions($app, $variableId);
         });
         /*
          *  id, name, value, disabled
          */
         $app->post("/update/:variableId/", function ($variableId) use($app) {
             ConfigController::saveVariable($app, $variableId);
         });
         /*
          * id
          */
         $app->map("/delete/:variableId/", function ($variableId) use($app) {
             ConfigController::deleteVariable($app, $variableId);
         })->via(['DELETE', 'POST']);
     });
 }
Example #3
0
<?php
/**
* @version		$Id: config.php 103 2009-06-21 19:21:18Z happynoodleboy $
* @package		JCE
* @copyright	Copyright (C) 2009 Ryan Demmer. All rights reserved.
* @license		GNU/GPL
* This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/

// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

// Controller
require_once( JPATH_COMPONENT .DS. 'config' .DS. 'controller.php' );

// Create the controller
$controller	= new ConfigController( array(
	'base_path' =>  JPATH_COMPONENT .DS. 'config' 
) );

$controller->execute( JRequest::getCmd( 'task' ) );
$controller->redirect();
?>
Example #4
0
 public function init()
 {
     ConfigController::$dataTableUrl = adminAppUrl('system/config/dataTable');
     ConfigController::$modUrl = adminAppUrl('system/config/mod');
 }
 private function _initConfigsForm($section, $namespace, $configs = array(), $posts = null)
 {
     if (self::$configForm === null) {
         self::$configForm = new Application_Form_AutoConfigs($configs);
         self::$configForm->setAction($this->_helper->url->url(array('action' => 'save', 'controller' => 'config'), 'default', false));
         if ($posts !== null && is_array($posts)) {
             self::$configForm->setDefaults($posts);
         }
         foreach (self::$configForm->getElements() as $key => $element) {
             // plugins prepare known elements
             X_VlcShares_Plugins::broker()->prepareConfigElement($section, $namespace, $key, $element, self::$configForm, $this);
         }
         if ($posts !== null && is_array($posts)) {
             // reset errors
             //self::$configForm->setErrors(array());
             self::$configForm->isValid($posts);
         }
     }
     /*
     if ( $posts !== null && is_array($posts)  ) {
     	$this->configForm->isValid($posts);
     }
     */
     return self::$configForm;
 }
Example #6
0
include_once 'model/config.model.php';
include_once 'model/product.model.php';
include_once 'model/image.model.php';
include_once 'model/user.model.php';
include_once 'model/order.model.php';
include_once 'model/bank.model.php';
// Controller ///////////////////////
include_once 'controller/config.controller.php';
include_once 'controller/product.controller.php';
include_once 'controller/image.controller.php';
include_once 'controller/user.controller.php';
include_once 'controller/api.controller.php';
include_once 'controller/order.controller.php';
include_once 'controller/bank.controller.php';
// Object of Controller
$config = new ConfigController();
$detect = new Mobile_Detect();
$product = new ProductController();
$image = new ImageController();
$user = new UserController();
$api = new APIController();
$order = new OrderController();
$bank = new BankController();
// Set Config data
$config->GetConfig();
// Metatag setup
$metadata = array('title' => $config->meta_title, 'description' => $config->meta_description, 'image' => '/image/logo.jpg', 'type' => 'website', 'site_name' => $config->meta_sitename, 'fb_app_id' => '218590748331719', 'fb_admins' => '1818320188', 'author' => $config->meta_author, 'generator' => 'iGenGoods 1.0', 'keywords' => $config->meta_keyword, 'domain' => 'http://' . $_SERVER['SERVER_NAME']);
// Photo Upload config ///////////////////////
// Photo desctination folder /////////////////
$destination_folder = array('thumbnail' => 'image/upload/thumbnail/', 'mini' => 'image/upload/mini/', 'square' => 'image/upload/square/', 'normal' => 'image/upload/normal/', 'large' => 'image/upload/large/');
// Photo upload resize ///////////////////////
 /**
  * @PublicPage
  *
  * Returns a list of supported features
  *
  * @inheritDoc
  *
  * @param bool $extramediatypes
  */
 public function get($extramediatypes = false)
 {
     return parent::get($extramediatypes);
 }
 /**
  * @PublicPage
  *
  * Returns a list of supported features
  *
  * @inheritDoc
  *
  * @param bool $slideshow
  */
 public function getConfig($slideshow = false)
 {
     return parent::getConfig($slideshow);
 }