Skip to content

Commit

Permalink
Fixed issue: Can not update token in token table
Browse files Browse the repository at this point in the history
Dev: added jqueryui-timepicker in third_party
Dev: added YII_CSRF_TOKEN:csrfToken  in extraparam
Dev: don't found a way to put extraparam : {YII_CSRF_TOKEN:csrfToken} to ALL jqgrid
Dev: if someone know how to do please ....
  • Loading branch information
Shnoulle committed Sep 26, 2013
1 parent b780f0c commit be22397
Show file tree
Hide file tree
Showing 4 changed files with 2,149 additions and 33 deletions.
11 changes: 10 additions & 1 deletion application/config/third_party.php
Expand Up @@ -178,5 +178,14 @@
'depends' => array(
'jqueryui'
)
)
),
'jqueryui-timepicker' => array(
'baseUrl' => 'third_party/jquery-ui-timepicker-addon/',
'js' => array(
'jquery-ui-timepicker-addon.js'
),
'depends' => array(
'jqueryui'
)
)
);
32 changes: 3 additions & 29 deletions application/views/admin/token/tokenbar.php
@@ -1,4 +1,6 @@
<div id='tokenbar' class='menubar'>
<?php
App()->getClientScript()->registerPackage('jqueryui-timepicker');
?><div id='tokenbar' class='menubar'>
<div class='menubar-title ui-widget-header'>
<strong><?php $clang->eT("Token control"); ?> </strong> <?php echo htmlspecialchars($thissurvey['surveyls_title']); ?>
</div>
Expand Down Expand Up @@ -81,31 +83,3 @@
</div>
</div>
</div>
<script type="text/javascript">
<!--

function addHiddenElement(theform,thename,thevalue)
{
var myel = document.createElement('input');
myel.type = 'hidden';
myel.name = thename;
theform.appendChild(myel);
myel.value = thevalue;
return myel;
}

function sendPost(myaction,checkcode,arrayparam,arrayval)
{
var myform = document.createElement('form');
document.body.appendChild(myform);
myform.action =myaction;
myform.method = 'POST';
for (i=0;i<arrayparam.length;i++)
{
addHiddenElement(myform,arrayparam[i],arrayval[i])
}
myform.submit();
}

//-->
</script>
5 changes: 2 additions & 3 deletions scripts/admin/tokens.js
Expand Up @@ -174,7 +174,6 @@ $(document).ready(function() {
jQuery('#displaytokens').editRow(row.attr('id'), true, null, null, null, null, func);
row.find('.inputbuttons').hide();
window.editing = true;

var validfrom = row.find('[aria-describedby="displaytokens_validfrom"]');
validfrom.find('input').css('width', '119px').datetimepicker({
showOn: 'button',
Expand All @@ -193,7 +192,7 @@ $(document).ready(function() {
.appendTo(jQuery(this).parent().parent())
.click(function()
{
jQuery('#displaytokens').saveRow(row.attr('id'));
jQuery('#displaytokens').saveRow(row.attr('id'),{extraparam : {YII_CSRF_TOKEN:csrfToken}});

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Sep 26, 2013

Author Collaborator

If someone know how to set this globally , please :).

I trye : jQuery.jgrid.extraparam = {YII_CSRF_TOKEN:csrfToken}; in endScripts_view but not sended

Trying default{ {YII_CSRF_TOKEN:csrfToken}} too

func();
});
});
Expand Down Expand Up @@ -389,4 +388,4 @@ $(document).ready(function() {
closeOnEspace:true
});
});
//ui-icon-newwin
//ui-icon-newwin

0 comments on commit be22397

Please sign in to comment.