kernel
[ class tree: kernel ] [ index: kernel ] [ all elements ]

Source for file module_controls_inc.php

Documentation is available at module_controls_inc.php

  1. <?php
  2. /**
  3.  * @version $Header$
  4.  *
  5.  *  Copyright (c) 2004 bitweaver.org
  6.  *  Copyright (c) 2003 tikwiki.org
  7.  *  Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  *  All Rights Reserved. See below for details and a complete list of authors.
  9.  *  Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
  10.  *
  11.  *  $Id$
  12.  * @package kernel
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * Initialization
  18.  */
  19. include_once'../kernel/setup_inc.php' );
  20.  
  21. if (!$gBitUser->hasPermission'p_tidbits_configure_modules' )) {
  22.     $gBitSmarty->assign('msg'tra("You dont have permission to use this feature"));
  23.     $gBitSystem->display'error.tpl' NULLarray'display_mode' => 'display' ));
  24.     die;
  25. }
  26. /*if (!$gBitSystem->isFeatureActive( 'site_user_assigned_modules' ) && $check_req) {
  27.     $gBitSmarty->assign('msg', tra("This feature is disabled").": site_user_assigned_modules");
  28.     $gBitSystem->display( 'error.tpl' , NULL, array( 'display_mode' => 'display' ));
  29.     die;
  30. }*/
  31. if (!$gBitUser->isRegistered()) {
  32.     $gBitSmarty->assign('msg'tra("You must log in to use this feature"));
  33.     $gBitSystem->display'error.tpl' NULLarray'display_mode' => 'display' ));
  34.     die;
  35. }
  36.  
  37. $url $_SERVER["HTTP_REFERER"];
  38.  
  39. //    global $debugger;
  40. //    $debugger->msg('Module control clicked: '.$check_req);
  41.     // Make defaults if user still ot configure modules for himself
  42. //    if (!$usermoduleslib->user_has_assigned_modules($user))
  43. //        $usermoduleslib->create_user_assigned_modules($user);
  44.  
  45. //$user_id = $gBitUser->getUserId();
  46. $user_id ROOT_USER_ID;
  47.  
  48. // Handle control icon click
  49. ifisset$_REQUEST['fMove'&& isset(  $_REQUEST['fPackage'&& isset(  $_REQUEST['fModule') ) {
  50.     switch$_REQUEST['fMove'{
  51.         case "unassign":
  52.             $gBitThemes->unassignModule$_REQUEST['fModule']$user_id$_REQUEST['fPackage');
  53.             break;
  54.         case "up":
  55.             $gBitThemes->moduleUp$_REQUEST['fModule']$user_id$_REQUEST['fPackage');
  56.             break;
  57.         case "down":
  58.             $gBitThemes->moduleDown$_REQUEST['fModule']$user_id$_REQUEST['fPackage');
  59.             break;
  60.         case "left":
  61.             $gBitThemes->modulePosition$_REQUEST['fModule']$user_id$_REQUEST['fPackage']'r' );
  62.             break;
  63.         case "right":
  64.             $gBitThemes->modulePosition$_REQUEST['fModule']$user_id$_REQUEST['fPackage']'l' );
  65.             break;
  66.     }
  67. }
  68.  
  69. // Remove module movemet paramaters from an URL
  70. // \todo What if 'mc_xxx' arg was not at the end? (if smbd fix URL by hands...)
  71. //       should I handle this very special (hack?) case?
  72. //    $url = preg_replace('/(.*)(\?|&){1}(mc_up|mc_down|mc_move|mc_unassign)=[^&]*/','\1', $url);
  73.  
  74. // Fix locaton if parameter was removed...
  75. header('Location: '.$url);
  76. ?>

Documentation generated on Wed, 29 Jul 2015 13:57:10 +0000 by phpDocumentor 1.5.0-lsces