diff options
| author | michael pereira | 2011-04-26 10:59:01 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-26 10:59:01 +0200 |
| commit | 54d6157376b31691b145ca29ac91a20b435f1456 (patch) | |
| tree | 6d0f390a6297c75d86f6ebcccc8c7d8f1c5040d0 /application/modules | |
| parent | suspended fix (diff) | |
| download | pbs2-54d6157376b31691b145ca29ac91a20b435f1456.tar.gz pbs2-54d6157376b31691b145ca29ac91a20b435f1456.tar.xz pbs2-54d6157376b31691b145ca29ac91a20b435f1456.zip | |
home on usb and draggable bootmenulist
Diffstat (limited to 'application/modules')
| -rw-r--r-- | application/modules/user/controllers/BootmenuController.php | 16 | ||||
| -rw-r--r-- | application/modules/user/views/scripts/bootmenu/index.phtml | 30 |
2 files changed, 44 insertions, 2 deletions
diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index f4b2638..214946c 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -468,6 +468,22 @@ class user_BootmenuController extends Zend_Controller_Action if($this->membership->getGroupID() != $bootmenu->getGroupID() || (!Pbs_Acl::checkRight('booee') && !Pbs_Acl::checkRight('booeem'))) $this->_redirect('/user/bootmenu/index/type/'.$this->type.'/page/'.$this->page.'/modifyresult/forbidden'); } + + $neworder = $this->_request->getParam('neworder'); + if($neworder != ''){ + if($neworder == 'undefined') + $neworder = $maxorder-1; + + $_POST = array( + 'title' => $bootmenuentry->getTitle(), + 'bootosID' => $bootmenuentry->getBootosID(), + 'kcl' => $bootmenuentry->getKcl(), + 'kclappend' => $bootmenuentry->getKclappend(), + 'configID' => $bootmenuentry->getConfigID(), + 'order' => $neworder, + 'editbootmenuentry' => 'Edit Bootmenuentry', + ); + } if (!isset($_POST["editbootmenuentry"])){ if(!isset($_POST['bootosID'])) diff --git a/application/modules/user/views/scripts/bootmenu/index.phtml b/application/modules/user/views/scripts/bootmenu/index.phtml index cf23e1d..7eb783a 100644 --- a/application/modules/user/views/scripts/bootmenu/index.phtml +++ b/application/modules/user/views/scripts/bootmenu/index.phtml @@ -120,8 +120,9 @@ <label>BootmenuID</label> <div class='item'><?php echo $this->escape($bootmenu->getID()); ?></div> <?php endif; ?> + <div id="sortable"> <?php foreach ($this->bootmenuentrylist[$bootmenu->getID()] as $k => $bootmenuentry): ?> - <div class='element'> + <div class='element' id=<?php echo $k?>> <div class='number'> <div class='smallnumber'>BMEntry</div> <?php echo $k+1 ?> @@ -142,7 +143,7 @@ true, false) ?>"><img src='/media/img/play.gif'></a> <?php endif; ?> <?php if(((Pbs_Acl::checkRight('booee') || Pbs_Acl::checkRight('booeem')) && $this->type == 'group') || (Pbs_Acl::checkRight('booeeo') && $this->type == 'own')): ?> - <a href="<?php echo $this->url( + <a class='edit' href="<?php echo $this->url( array( 'module' => 'user', 'controller' => 'bootmenu', @@ -193,6 +194,7 @@ </div> <?php endforeach; ?> </div> + </div> </div> <div class='clear'></div> </div> @@ -201,6 +203,30 @@ <?php echo $this->pagination; ?> + <script> + function getId(el){ + if(el.attr) + return el.attr("id"); + return 0; + } + + $(function() { + $( "#sortable" ).sortable({ + update: function(event, ui){ + var nxt_id = getId(ui.item.next()); + var id = getId(ui.item); + if(id < nxt_id) + nxt_id = (nxt_id-1); + location.href=ui.item.find('.edit').attr('href')+'/neworder/'+(nxt_id); + } + }); + $( "#sortable" ).disableSelection(); + }); + + </script> + + + <script type="text/javascript"> $(document).ready(function(){ $('.actions .play').click(function (){ |
