2008-12-31 04:05:41 +00:00
< ? php defined ( " SYSPATH " ) or die ( " No direct script access. " ) ?>
2008-12-31 09:02:40 +00:00
< script type = " text/javascript " >
2008-12-31 19:59:42 +00:00
var form_url = " <?= url::site( " permissions / form / __ITEM__ " ) ?> " ;
show = function ( id ) {
2008-12-31 09:02:40 +00:00
$ . ajax ({
2008-12-31 19:59:42 +00:00
url : form_url . replace ( " __ITEM__ " , id ),
2008-12-31 09:02:40 +00:00
success : function ( data ) {
$ ( " div.form " ) . slideUp ();
2008-12-31 09:50:25 +00:00
$ ( " div#edit- " + id ) . html ( data ) . slideDown ();
}
});
}
2009-05-21 05:07:12 +00:00
var action_url =
" <?= url::site( " permissions / change / __CMD__ / __GROUP__ / __PERM__ / __ITEM__ ? csrf = $csrf " ) ?> " ;
2008-12-31 09:50:25 +00:00
set = function ( cmd , group_id , perm_id , item_id ) {
$ . ajax ({
url : action_url . replace ( " __CMD__ " , cmd ) . replace ( " __GROUP__ " , group_id ) .
replace ( " __PERM__ " , perm_id ) . replace ( " __ITEM__ " , item_id ),
success : function ( data ) {
$ ( " div#edit- " + item_id ) . load ( form_url . replace ( " __ITEM__ " , item_id ));
2008-12-31 09:02:40 +00:00
}
});
}
</ script >
2008-12-31 04:05:41 +00:00
< div id = " gPermissions " >
2009-05-21 06:06:08 +00:00
< ? if ( ! $htaccess_works ) : ?>
< ul id = " gMessage " >
< li class = " gError " >
2009-06-10 20:22:10 -07:00
< ? = t ( " Oh no! Your server needs a configuration change in order for you to hide photos! Ask your server administrator to enable <a %mod_rewrite_attrs>mod_rewrite</a> and set <a %apache_attrs><i>AllowOverride FileInfo Options</i></a> to fix this. " , array ( " mod_rewrite_attrs " => " href= \" http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html \" target= \" _blank \" " , " apache_attrs " => " href= \" http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride \" target= \" _blank \" " )) ?>
2009-05-21 06:06:08 +00:00
</ li >
</ ul >
< ? endif ?>
2008-12-31 09:02:40 +00:00
< ul >
< ? foreach ( $parents as $parent ) : ?>
< li >
2008-12-31 19:59:42 +00:00
< a href = " javascript:show(<?= $parent->id ?>) " >
2009-05-31 00:11:48 -07:00
< ? = p :: clean ( $parent -> title ) ?>
2008-12-31 09:02:40 +00:00
</ a >
< div class = " form " id = " edit-<?= $parent->id ?> " ></ div >
< ul >
2008-12-31 04:05:41 +00:00
< ? endforeach ?>
2008-12-31 09:02:40 +00:00
< li >
2008-12-31 19:59:42 +00:00
< a href = " javascript:show(<?= $item->id ?>) " >
2009-07-03 21:44:10 -07:00
< ? = p :: purify ( $item -> title ) ?>
2008-12-31 09:02:40 +00:00
</ a >
< div class = " form " id = " edit-<?= $item->id ?> " >
< ? = $form ?>
</ div >
</ li >
< ? foreach ( $parents as $parent ) : ?>
</ ul >
</ li >
</ ul >
< ? endforeach ?>
2008-12-31 04:05:41 +00:00
</ div >