Skip to content
Snippets Groups Projects
Commit 96700c10 authored by efalcy's avatar efalcy
Browse files

Administration : affichage bouton d'activation / desactivation déplacement des boites

parent 71a89fe4
Branches
Tags 6.17
No related merge requests found
......@@ -40,11 +40,21 @@ addButton: aString action: aBlock
with: aString ]
!
moveBoxesButton
toolsBrush appendBlock: [:html| |aMoveBoxes aButton |
aButton := html button.
aMoveBoxes := MoveBoxes new.
aButton onClick:[ aMoveBoxes toggle.
aButton contents: aMoveBoxes libelle. ]
]
!
renderOn: html
toolsBrush := html div style: 'position: fixed; top: 0px; z-index:500'.
self addButton: 'Amber IDE' action: [Browser open].
self addButton: 'ZFDebug' action: ['#ZFDebug' asJQuery toggle].
self moveBoxesButton.
! !
AFIIDETools class instanceVariableNames: 'default'!
......@@ -131,3 +141,34 @@ url: aString
yourself
! !
Object subclass: #MoveBoxes
instanceVariableNames: 'libelle active'
package: 'AFI-Core'!
!MoveBoxes methodsFor: 'not yet classified'!
activate
libelle := 'Désactiver déplacement des boites'.
active := true.
window activateOpacBlocksSorting.
!
deactivate
libelle := 'Activer déplacement des boites'.
active := false.
window deactiveOpacBlocksSorting.
!
initialize
self deactivate.
!
libelle
^libelle.
!
toggle
active ifTrue: [ self activate.]
ifFalse: [ self deactivate.].
! !
......@@ -20,7 +20,8 @@
*/
class ZendAfi_View_Helper_Portail extends ZendAfi_View_Helper_BaseHelper {
public function portail($cfg_accueil,$division_demandee = false) {
$this->activateAdminUI();
$this->loadAdminUI();
$style_boite = array("",
"boite_de_la_division_gauche",
......@@ -49,6 +50,27 @@ class ZendAfi_View_Helper_Portail extends ZendAfi_View_Helper_BaseHelper {
return $ret;
}
public function loadAdminUI() {
$request = Zend_Controller_Front::getInstance()->getRequest();
if (($user = Class_Users::getLoader()->getIdentity())
&& $user->isAdmin()
&& 'index' == $request->getControllerName()
&& 'index' == $request->getActionName()
&& 'opac' == $request->getModuleName()) {
Class_ScriptLoader::getInstance()
->addAdminScript('cfg.accueil')
->addJQueryReady('window.activateOpacBlocksSorting = function() {
opacBlocksSorting("'.
$this->view->url(['module' => 'admin',
'controller' => 'profil',
'action' => 'module-sort'],
null, true) .'","'.
Class_Profil::getCurrentProfil()->getId() .'");}');
}
}
public function activateAdminUI() {
$request = Zend_Controller_Front::getInstance()->getRequest();
......
......@@ -18,6 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
function deactiveOpacBlocksSorting() {
$('div.layout-division>div').sortable("disable");
}
function opacBlocksSorting(moduleSortUrl, currentProfilId) {
opacBlocksSortingInitPositions();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment