mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-04-03 21:52:04 -04:00
Merge pull request #2101 from connortechnology/include_fs_config_in_api_config
Munge the config in the global configvals into the configs array
This commit is contained in:
@@ -21,15 +21,18 @@ class ConfigsController extends AppController {
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function index() {
|
||||
$this->Config->recursive = 0;
|
||||
$configs = $this->Config->find('all');
|
||||
$this->set(array(
|
||||
'configs' => $configs,
|
||||
'_serialize' => array('configs')
|
||||
));
|
||||
}
|
||||
|
||||
public function index() {
|
||||
global $configvals;
|
||||
$this->Config->recursive = 0;
|
||||
$configs = $this->Config->find('all');
|
||||
foreach ( $configvals as $k=>$v ) {
|
||||
$configs[] = array( 'Config'=>array('Name'=>$k, 'Value'=>$v ) );
|
||||
}
|
||||
$this->set(array(
|
||||
'configs' => $configs,
|
||||
'_serialize' => array('configs')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* view method
|
||||
@@ -53,8 +56,14 @@ class ConfigsController extends AppController {
|
||||
public function viewByName($name = null) {
|
||||
$config = $this->Config->findByName($name, array('fields' => 'Value'));
|
||||
|
||||
if (!$config) {
|
||||
throw new NotFoundException(__('Invalid config'));
|
||||
if ( !$config ) {
|
||||
global $configvals;
|
||||
if ( $configvals[$name] ) {
|
||||
$config = array( 'Config'=>array('Value'=>$configvals[$name]) );
|
||||
} else {
|
||||
throw new NotFoundException(__('Invalid config'));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
$this->set(array(
|
||||
|
||||
Reference in New Issue
Block a user