Example #1
0
<?php

$key = $_POST['key'];
$result = array('key' => $key, 'description' => Config::getDescription($key), 'type' => Config::getType($key), 'default_value' => Config::getDefault($key), 'value' => Config::get($key));
echo json_encode($result);
Example #2
0
 /**
  * Returns a new template instance
  * 
  * @param string $data_type Data type
  * @param string $type      Input type
  * @return \hypeJunction\Prototyper\UI\Template
  */
 public function getTemplate($data_type, $type)
 {
     $options = (array) $this->config->getType($data_type, $type);
     return new UI\Template($data_type, $type, $options);
 }
 public function saveConfig(Config $config)
 {
     $key = sprintf("%s-%s", $config->getType(), $config->getArea());
     if (!($file = $config->getFile('base'))) {
         throw new KurogoConfigurationException("Unable to load base file for " . $config->getType() . '-' . $config->getArea());
     }
     if (count($config->getFiles()) > 1) {
         KurogoDebug::Debug($config, true);
         throw new KurogoConfigurationException("Safety net. File will not be saved because it was loaded with extra files. The code is probably wrong");
     }
     $data = $config->getSaveData();
     if (!is_writable($file)) {
         throw new KurogoConfigurationException("Cannot save config file: {$file} Check permissions");
     }
     file_put_contents($file, $data);
     unset($this->configs[$key]);
     Kurogo::deleteCache('config-' . $key);
     return true;
 }
Example #4
0
 public function select($relations, $columns, $conditions = null, $group_by = null, $order_by = null, $limit = null, $into = null)
 {
     $database = $this->config->getType();
     return $this->excecute($database->select($relations, $columns, $conditions, $group_by, $order_by, $limit, $into));
 }