Form button class update, fixes to module_method_token, fixes to json

This commit is contained in:
Deon George
2011-08-31 16:54:44 +10:00
parent c55a8fe4cc
commit 52074d239b
19 changed files with 62 additions and 60 deletions

View File

@@ -109,7 +109,6 @@ class Auth_OSB extends Auth_ORM {
// Check and see if we have a token to login and run the method
} elseif ((! empty($_REQUEST['token']) AND $token = $_REQUEST['token']) OR $token=Session::instance()->get('token')) {
if ($user=$this->_get_token_user($token) AND $user !== FALSE)
$status = TRUE;
@@ -149,7 +148,6 @@ class Auth_OSB extends Auth_ORM {
*/
private function _get_token_user($token) {
$mmto = ORM::factory('module_method_token',array('token'=>$token));
$request = Request::current();
$user = FALSE;
if ($mmto->loaded()) {
@@ -164,9 +162,9 @@ class Auth_OSB extends Auth_ORM {
} else {
// Check that the token is for this URI
$mo = ORM::factory('module',array('name'=>$request->controller));
$mo = ORM::factory('module',array('name'=>Request::current()->controller()));
$mmo = ORM::factory('module_method',
array('name'=>$request->directory ? sprintf('%s_%s',$request->directory,$request->action) : $request->action));
array('name'=>Request::current()->directory() ? sprintf('%s_%s',Request::current()->directory(),Request::current()->action()) : Request::current()->action()));
// Ignore the token if this is not the right method.
if ($mmo->id == $mmto->method_id) {

View File

@@ -1,4 +1,5 @@
<!-- @todo NEEDS TO BE TRANSLATED -->
<br/>
<?php echo Form::open(); ?>
<table class="box-center">
<tr>
@@ -10,7 +11,7 @@
<td><input type="password" name="password_confirm" value=""/></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><?php echo Form::submit('update','Update'); ?></td>
<td colspan="2" style="text-align: center;"><?php echo Form::submit('update','Update',array('class'=>'form_button')); ?></td>
</tr>
</table>
<?php echo Form::close(); ?>

View File

@@ -78,7 +78,7 @@
</tr>
<!-- @todo OTHER STATIC VARS -->
<tr>
<td colspan="2" style="text-align: center;"><?php echo Form::submit('update','Update'); ?></td>
<td colspan="2" style="text-align: center;"><?php echo Form::submit('update','Update',array('class'=>'form_button')); ?></td>
</tr>
</table>
<?php echo Form::close(); ?>

View File

@@ -125,7 +125,7 @@
<td><?php echo StaticList_YesNo::form('email_type',true); ?></td>
</tr>
<tr><td colspan="2">&nbsp;</td></tr>
<tr><td colspan="2" style="text-align: center;"><?php echo Form::submit('submit',_('Register'));?></td></tr>
<tr><td colspan="2" style="text-align: center;"><?php echo Form::submit('submit',_('Register'),array('class'=>'form_button'));?></td></tr>
</table>
<?php echo Form::close(); ?>
<!-- @todo The following focus() is not ajax/jscript friendly -->

View File

@@ -88,7 +88,7 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
$output .= Form::open();
$output .= View::factory('email/admin/template/add');
$output .= View::factory('email/admin/template/translate/add');
$output .= '<div>'.Form::submit('submit',_('Add')).'</div>';
$output .= '<div>'.Form::submit('submit',_('Add'),array('class'=>'form_button')).'</div>';
$output .= Form::close();
Editor::add();
@@ -139,7 +139,7 @@ class Controller_Admin_Email extends Controller_TemplateDefault_Admin {
));
}
$output .= '<div>'.Form::submit('submit',_('Update')).'</div>';
$output .= '<div>'.Form::submit('submit',_('Update'),array('class'=>'form_button')).'</div>';
$output .= Form::close();
Editor::add();

View File

@@ -62,7 +62,7 @@ class Controller_Admin_Export extends Controller_TemplateDefault_Admin {
}
$output .= '</table>';
$output .= Form::submit('submit','export');
$output .= Form::submit('submit','export',array('class'=>'form_button'));
$output .= Form::close();
Style::add(array(

View File

@@ -1,6 +1,6 @@
<tr>
<td colspan="3"><?php echo Form::select('plugin',$plugins); ?></td>
<td colspan="2" style="text-align: right;"><?php echo Form::submit('submit','export'); ?></td>
<td colspan="2" style="text-align: right;"><?php echo Form::submit('submit','export',array('class'=>'form_button')); ?></td>
</tr>
<!-- // @todo To translate -->
<tr>

View File

@@ -77,7 +77,7 @@ echo Form::open('cart/add');
</td>
</tr>
<tr>
<td style="text-align: center;"><?php echo Form::submit('submit','Add to Cart'); ?> | <?php echo Form::submit('submit','Add to Cart & Checkout',array('disabled'=>'disabled')); ?></td>
<td style="text-align: center;"><?php echo Form::submit('submit','Add to Cart',array('class'=>'form_button')); ?> | <?php echo Form::submit('submit','Add to Cart & Checkout',array('disabled'=>'disabled'),array('class'=>'form_button')); ?></td>
</tr>
</table>
</td>

View File

@@ -380,7 +380,7 @@ GROUP BY DATE_FORMAT(DATE,"%%Y-%%m"),SID
$output .= Form::open(NULL,array('enctype'=>'multipart/form-data'));
$output .= '<div>';
$output .= Form::file('csv');
$output .= Form::submit('submit','upload');
$output .= Form::submit('submit','upload',array('class'=>'form_button'));
$output .= '</div>';
$output .= Form::close();

View File

@@ -64,5 +64,5 @@
</td>
</tr>
</table>
<?php echo Form::submit('submit',_('Update')); ?>
<?php echo Form::submit('submit',_('Update'),array('class'=>'form_button')); ?>
<?php echo Form::close(); ?>

View File

@@ -61,7 +61,7 @@
<table>
<tr>
<td>View Daily Traffic for Month</td>
<td><?php echo Form::open(); echo Form::select('month',array_merge(array(''),$so->get_traffic_months()),(isset($_POST['month']) ? $_POST['month'] : '')); echo Form::submit('submit',_('Show')); echo Form::close(); ?></td>
<td><?php echo Form::open(); echo Form::select('month',array_merge(array(''),$so->get_traffic_months()),(isset($_POST['month']) ? $_POST['month'] : '')); echo Form::submit('submit',_('Show'),array('class'=>'form_button')); echo Form::close(); ?></td>
</tr>
</table>
</td>