Updates from OSB
This commit is contained in:
parent
932252b620
commit
4b432d2eb4
@ -100,6 +100,8 @@ abstract class lnAuth_Controller_Admin_Module extends Controller_Module {
|
||||
HTTP::redirect(URL::link('admin','module/list'));
|
||||
}
|
||||
|
||||
$this->meta->title = 'A|Module: '.$mo->name();
|
||||
|
||||
$mm = $this->_methods($mo->name);
|
||||
$methods['exist'] = array();
|
||||
foreach ($mo->module_method->find_all() as $mmo) {
|
||||
@ -131,7 +133,7 @@ abstract class lnAuth_Controller_Admin_Module extends Controller_Module {
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf('%s: %s ',_('Defined Module Methods For'),$mo->display('name')))
|
||||
->title_icon('icon-cog')
|
||||
->title_icon('fa fa-cog')
|
||||
->body(Table::factory()
|
||||
->data($methods['exist'])
|
||||
->columns(array(
|
||||
@ -148,7 +150,7 @@ abstract class lnAuth_Controller_Admin_Module extends Controller_Module {
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf('%s: %s ',_('Missing Module Methods For'),$mo->display('name')))
|
||||
->title_icon('icon-exclamation-sign')
|
||||
->title_icon('fa fa-question')
|
||||
->body(Table::factory()
|
||||
->data($methods['missing'])
|
||||
->columns(array(
|
||||
@ -165,9 +167,11 @@ abstract class lnAuth_Controller_Admin_Module extends Controller_Module {
|
||||
* List our installed modules
|
||||
*/
|
||||
public function action_list() {
|
||||
$this->meta->title = 'A|Module List';
|
||||
|
||||
Block::factory()
|
||||
->title('Defined Modules')
|
||||
->title_icon('icon-cog')
|
||||
->title_icon('fa fa-cog')
|
||||
->body(Table::factory()
|
||||
->data(ORM::factory('Module')->where('parent_id','is',NULL)->find_all())
|
||||
->jssort(TRUE)
|
||||
|
@ -23,26 +23,14 @@ abstract class lnAuth_Controller_Admin_Module_Method extends Controller_Admin_Mo
|
||||
if (! $mo->loaded() OR ! in_array($method,$mm['methods']))
|
||||
HTTP::redirect(URL::link('admin','module/list'));
|
||||
|
||||
if ($_POST) {
|
||||
$mmo = $mo->module_method;
|
||||
$mmo->name = $method;
|
||||
$mmo->module_id = $mo->id;
|
||||
$mmo->values($_POST);
|
||||
$mmo = $mo->module_method;
|
||||
$mmo->name = $method;
|
||||
$mmo->module_id = $mo->id;
|
||||
|
||||
if (! $this->save($mmo))
|
||||
throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($_POST)));
|
||||
if (! $this->save($mmo))
|
||||
throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($this->request->post())));
|
||||
|
||||
HTTP::redirect(URL::link('admin','module/edit/'.$mo->id));
|
||||
}
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf(_('Add Method (%s) to Database for (%s)'),strtoupper($method),strtoupper($mo->name)))
|
||||
->title_icon('icon-plus-sign')
|
||||
->type('form-horizontal')
|
||||
->body(View::factory('module/method/admin/add')
|
||||
->set('name',$method)
|
||||
->set('o',$mo)
|
||||
);
|
||||
HTTP::redirect(URL::link('admin','module_method/edit/'.$mmo->id));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -61,15 +49,15 @@ abstract class lnAuth_Controller_Admin_Module_Method extends Controller_Admin_Mo
|
||||
HTTP::redirect(URL::link('admin','module/list'));
|
||||
}
|
||||
|
||||
if ($_POST) {
|
||||
$mmo->values($_POST);
|
||||
if ($this->request->post()) {
|
||||
$mmo->values($this->request->post());
|
||||
|
||||
if (! $this->save($mmo))
|
||||
throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($_POST)));
|
||||
throw HTTP_Exception::factory(501,'Unable to save data :post',array(':post'=>serialize($this->request->post())));
|
||||
|
||||
foreach (ORM::factory('Group')->find_all() as $go) {
|
||||
// If the group was defined and no longer
|
||||
if ($mmo->has('group',$go) AND (! isset($_POST['groups']) OR ! in_array($go->id,$_POST['groups']))) {
|
||||
if ($mmo->has('group',$go) AND (! $this->request->post('groups') OR ! in_array($go->id,$this->request->post('groups')))) {
|
||||
$gmo = ORM::factory('Group_Method',array('method_id'=>$mmo->id,'group_id'=>$go->id));
|
||||
|
||||
if (! $gmo->delete())
|
||||
@ -79,7 +67,7 @@ abstract class lnAuth_Controller_Admin_Module_Method extends Controller_Admin_Mo
|
||||
->body(sprintf(_('Unable to delete Group Method for method %s and group %s'),$mmo->name,$go->name));
|
||||
|
||||
// If the group was not defined and now is
|
||||
} elseif (! $mmo->has('group',$go) AND isset($_POST['groups']) AND in_array($go->id,$_POST['groups'])) {
|
||||
} elseif (! $mmo->has('group',$go) AND $this->request->post('groups') AND in_array($go->id,$this->request->post('groups'))) {
|
||||
$gmo = ORM::factory('Group_Method')
|
||||
->values(array(
|
||||
'method_id'=>$mmo->id,
|
||||
@ -99,7 +87,7 @@ abstract class lnAuth_Controller_Admin_Module_Method extends Controller_Admin_Mo
|
||||
|
||||
Block::factory()
|
||||
->title(sprintf(_('Configure access to method (%s::%s)'),$mmo->controller(),$mmo->method()))
|
||||
->title_icon('icon-plus-sign')
|
||||
->title_icon('fa fa-lock')
|
||||
->type('form-horizontal')
|
||||
->body(View::factory('module/method/admin/edit')->set('o',$mmo));
|
||||
}
|
||||
|
@ -53,13 +53,13 @@ abstract class lnAuth_Controller_TemplateDefault extends lnApp_Controller_Templa
|
||||
if (! $mo->loaded())
|
||||
throw HTTP_Exception::factory(501,'Unknown module :module',array(':module'=>Request::current()->controller()));
|
||||
|
||||
if ($_POST AND isset($_POST['module_config'][$mo->id]))
|
||||
Config::instance()->module_config($mo->name,$_POST['module_config'][$mo->id])->save();
|
||||
if ($this->request->post() AND array_key_exists($mo->id,$this->request->post('module_config')))
|
||||
Config::instance()->module_config($mo->name,$this->request->post('module_config.'.$mo->id))->save();
|
||||
|
||||
if ($config_items) {
|
||||
Block::factory()
|
||||
->title('Update Module Configuration')
|
||||
->title_icon('icon-wrench')
|
||||
->title_icon('fa fa-wrench')
|
||||
->type('form-horizontal')
|
||||
->body(View::factory('setup/admin/module')->set('o',Company::instance()->so())->set('mid',$mo->id));
|
||||
}
|
||||
|
@ -46,10 +46,11 @@ abstract class lnAuth_Menu extends lnApp_Menu {
|
||||
if (! $ao->loaded())
|
||||
return FALSE;
|
||||
|
||||
foreach ($ao->methods() as $mmo)
|
||||
if ($mmo->menu_display AND $type == $mmo->directory())
|
||||
if (empty($result[$mmo->id]))
|
||||
$result[$mmo->id] = $mmo;
|
||||
if (is_object($ao))
|
||||
foreach ($ao->methods() as $mmo)
|
||||
if ($mmo->menu_display AND $type == $mmo->directory())
|
||||
if (empty($result[$mmo->id]))
|
||||
$result[$mmo->id] = $mmo;
|
||||
|
||||
return self::collapse($result);
|
||||
}
|
||||
@ -61,7 +62,7 @@ abstract class lnAuth_Menu extends lnApp_Menu {
|
||||
if (is_array($v))
|
||||
$output .= sprintf('<li class="dropdown-submenu">%s%s',HTML::anchor('#',$k,array('nocg'=>TRUE)),self::ul($type,$v,NULL,TRUE).'</li>');
|
||||
else
|
||||
$output .= '<li>'.HTML::anchor($v->url(),$v->menu_display,array('tabindex'=>-1,'nocg'=>TRUE)).'</li>';
|
||||
$output .= '<li>'.HTML::anchor($v->url(),$v->menu_display(),array('tabindex'=>-1,'nocg'=>TRUE)).'</li>';
|
||||
|
||||
if ($append) {
|
||||
$output .= '<li class="divider"></li>';
|
||||
|
@ -61,7 +61,7 @@ abstract class lnAuth_Model_Account extends lnApp_Model_Account {
|
||||
->method(array($module,$method))
|
||||
->account($this)
|
||||
->uses($uses)
|
||||
->expire(time()+$token_expire)
|
||||
->expire(time()+$token_expire*60)
|
||||
->generate();
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
<div class="col-md-11">
|
||||
<fieldset>
|
||||
<legend>Add Method</legend>
|
||||
|
||||
<?php echo Form::input('name',$name,array('label'=>'Method','disabled','divclass'=>'col-sm-5')); ?>
|
||||
<?php echo Form::input('notes','',array('label'=>'Description','placeholder'=>'Method Description','divclass'=>'col-sm-7')); ?>
|
||||
<?php echo Form::input('menu_display','',array('label'=>'Menu Title','placeholder'=>'Menu Title','divclass'=>'col-sm-7')); ?>
|
||||
</fieldset>
|
||||
|
||||
<div class="row">
|
||||
<div class="offset2">
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="button" class="btn">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /span -->
|
@ -1,22 +1,22 @@
|
||||
<div class="col-md-5">
|
||||
<fieldset>
|
||||
<div class="col-md-12">
|
||||
<fieldset class="col-md-5">
|
||||
<legend>Method Details</legend>
|
||||
|
||||
<?php echo Form::input('notes',$o->notes,array('label'=>'Desc','placeholder'=>'Method Description','divclass'=>'col-md-9')); ?>
|
||||
<?php echo Form::input('menu_display',$o->menu_display,array('label'=>'Title','placeholder'=>'Menu Title','divclass'=>'col-md-9')); ?>
|
||||
<?php
|
||||
echo View::factory('field/text')->set('data',['field'=>'notes','value'=>$o->notes,'text'=>'Description','class'=>'col-md-9','classlabel'=>'col-md-3']);
|
||||
echo View::factory('field/text')->set('data',['field'=>'menu_display','value'=>$o->menu_display,'text'=>'Menu Title','class'=>'col-md-9','classlabel'=>'col-md-3']);
|
||||
?>
|
||||
</fieldset>
|
||||
</div> <!-- /col-md-->
|
||||
|
||||
<div class="col-md-6">
|
||||
<fieldset>
|
||||
<fieldset class="col-md-7">
|
||||
<legend>Method Security</legend>
|
||||
|
||||
<table class="table table-striped table-condensed table-hover" id="list-table">
|
||||
<thead><tr>
|
||||
<th>Method</th>
|
||||
<th>Notes</th>
|
||||
<th>Group Active</th>
|
||||
<th>Method Enable</th>
|
||||
<th>Active</th>
|
||||
<th>Enabled</th>
|
||||
</tr></thead>
|
||||
|
||||
<tbody>
|
||||
@ -24,7 +24,7 @@
|
||||
<tr>
|
||||
<td><?php echo HTML::anchor(URL::link('admin','group/edit/'.$go->id,TRUE),$go->display('name')); ?></td>
|
||||
<td><?php echo $go->display('notes'); ?></td>
|
||||
<td><?php echo $go->display('active'); ?></td>
|
||||
<td><?php echo $go->display('status'); ?></td>
|
||||
<td><?php echo Form::checkbox('groups[]',$go->id,$o->has('group',$go),array('nocg'=>TRUE)); ?></td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
@ -32,10 +32,5 @@
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-offset-2">
|
||||
<button type="submit" class="btn btn-primary">Save changes</button>
|
||||
<button type="button" class="btn">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- /col-md -->
|
||||
<?php echo View::factory('field/submit'); ?>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user