Ejemplo n.º 1
0
 /**
  * Process labels form data depending on $action.
  *
  * @access public
  * @return void
  */
 public function process()
 {
     $action = returnGlobal('action');
     Yii::app()->loadHelper('admin/label');
     $lid = returnGlobal('lid');
     if ($action == "updateset" && Permission::model()->hasGlobalPermission('labelsets', 'update')) {
         updateset($lid);
         Yii::app()->setFlashMessage(gT("Label set properties sucessfully updated."), 'success');
     }
     if ($action == "insertlabelset" && Permission::model()->hasGlobalPermission('labelsets', 'create')) {
         $lid = insertlabelset();
     }
     if (($action == "modlabelsetanswers" || $action == "ajaxmodlabelsetanswers") && Permission::model()->hasGlobalPermission('labelsets', 'update')) {
         modlabelsetanswers($lid);
     }
     if ($action == "deletelabelset" && Permission::model()->hasGlobalPermission('labelsets', 'delete')) {
         if (deletelabelset($lid)) {
             Yii::app()->setFlashMessage(gT("Label set sucessfully deleted."), 'success');
             $lid = 0;
         }
     }
     if ($lid) {
         $this->getController()->redirect(array("admin/labels/sa/view/lid/" . $lid));
     } else {
         $this->getController()->redirect(array("admin/labels/sa/view"));
     }
 }
Ejemplo n.º 2
0
$labelsoutput='';
if($_SESSION['USER_RIGHT_SUPERADMIN'] == 1 || $_SESSION['USER_RIGHT_MANAGE_LABEL'] == 1)
{

    $js_admin_includes[]='scripts/labels.js';
    if (isset($_POST['sortorder'])) {$postsortorder=sanitize_int($_POST['sortorder']);}

    if (!isset($action)) {$action=returnglobal('action');}
    if (!isset($lid)) {$lid=returnglobal('lid');}

    //DO DATABASE UPDATESTUFF
    if ($action == "updateset") {updateset($lid);}
    if ($action == "insertlabelset") {$lid=insertlabelset();}
    if ($action == "modlabelsetanswers") {modlabelsetanswers($lid);}
    if ($action == "deletelabelset") {if (deletelabelset($lid)) {$lid=0;}}
    if ($action == "importlabels")
    {
        include("importlabel.php");
    }
    if ($action == "importlabelresources")
    {
        include("import_resources_zip.php");
        if (isset($importlabelresourcesoutput)) {$labelsoutput.= $importlabelresourcesoutput;}
        return;
    }


    $labelsoutput= "<div class='menubar'>\n"
    ."\t\t<div class='menubar-title ui-widget-header'>\n"
    ."\t\t<strong>".$clang->gT("Label Sets Administration")."</strong>\n"
Ejemplo n.º 3
0
 /**
  * Process labels form data depending on $action.
  *
  * @access public
  * @return void
  */
 public function process()
 {
     if (Yii::app()->session['USER_RIGHT_SUPERADMIN'] == 1 || Yii::app()->session['USER_RIGHT_MANAGE_LABEL'] == 1) {
         if (isset($_POST['method']) && get_magic_quotes_gpc()) {
             $_POST['method'] = stripslashes($_POST['method']);
         }
         $action = returnGlobal('action');
         Yii::app()->loadHelper('admin/label');
         $lid = returnGlobal('lid');
         if ($action == "updateset") {
             updateset($lid);
             Yii::app()->session['flashmessage'] = Yii::app()->lang->gT("Label set properties sucessfully updated.");
         }
         if ($action == "insertlabelset") {
             $lid = insertlabelset();
         }
         if ($action == "modlabelsetanswers" || $action == "ajaxmodlabelsetanswers") {
             modlabelsetanswers($lid);
         }
         if ($action == "deletelabelset") {
             if (deletelabelset($lid)) {
                 Yii::app()->session['flashmessage'] = Yii::app()->lang->gT("Label set sucessfully deleted.");
                 $lid = 0;
             }
         }
         if ($lid) {
             $this->getController()->redirect($this->getController()->createUrl("admin/labels/sa/view/lid/" . $lid));
         } else {
             $this->getController()->redirect($this->getController()->createUrl("admin/labels/sa/view"));
         }
     }
 }
Ejemplo n.º 4
0
 }
 if (!isset($lid)) {
     $lid = returnglobal('lid');
 }
 //DO DATABASE UPDATESTUFF
 if ($action == "updateset") {
     updateset($lid);
 }
 if ($action == "insertlabelset") {
     $lid = insertlabelset();
 }
 if ($action == "modlabelsetanswers" || $action == "ajaxmodlabelsetanswers") {
     modlabelsetanswers($lid);
 }
 if ($action == "deletelabelset") {
     if (deletelabelset($lid)) {
         $lid = 0;
     }
 }
 if ($action == "importlabels") {
     include "importlabel.php";
 }
 if ($action == "importlabelresources") {
     include "import_resources_zip.php";
     if (isset($importlabelresourcesoutput)) {
         $labelsoutput .= $importlabelresourcesoutput;
     }
     return;
 }
 $labelsoutput = "<div class='menubar'>\n" . "\t\t<div class='menubar-title ui-widget-header'>\n" . "\t\t<strong>" . $clang->gT("Label Sets Administration") . "</strong>\n" . "\t\t</div>\n" . "\t<div class='menubar-main'>\n" . "\t<div class='menubar-left'>\n" . "\t<a href='{$scriptname}' title=\"" . $clang->gTview("Return to survey administration") . "\" >" . "<img name='Administration' src='{$imageurl}/home.png' align='left' alt='" . $clang->gT("Return to survey administration") . "' /></a>" . "\t<img src='{$imageurl}/blank.gif' width='11' height='20' align='left' alt='' />\n" . "\t<img src='{$imageurl}/seperator.gif' align='left' alt='' />\n" . "\t<img src='{$imageurl}/blank.gif' width='76' align='left' height='20' alt='' />\n" . "\t<img src='{$imageurl}/seperator.gif' border='0' hspace='0' align='left' alt='' />\n" . "\t<a href='admin.php?action=labels&amp;subaction=exportmulti' title=\"" . $clang->gTview("Export Label Set") . "\" >" . "<img src='{$imageurl}/dumplabelmulti.png' alt='" . $clang->gT("Export multiple label sets") . "' align='left' /></a>" . "\t</div>\n" . "\t<div class='menubar-right'>\n" . "\t<img src='{$imageurl}/blank.gif' width='5' height='20' alt='' />\n" . "\t<font class='boxcaption'>" . $clang->gT("Label sets") . ": </font>" . "\t<select onchange=\"window.open(this.options[this.selectedIndex].value,'_top')\">\n";
 $labelsoutput .= "<option value=''";
Ejemplo n.º 5
0
 /**
  * Process labels form data depending on $action.
  *
  * @access public
  * @return void
  */
 public function process()
 {
     if (Permission::model()->hasGlobalPermission('labelsets', 'update')) {
         if (isset($_POST['method']) && get_magic_quotes_gpc()) {
             $_POST['method'] = stripslashes($_POST['method']);
         }
         $action = returnGlobal('action');
         Yii::app()->loadHelper('admin/label');
         $lid = returnGlobal('lid');
         if ($action == "updateset") {
             updateset($lid);
             Yii::app()->setFlashMessage(Yii::app()->lang->gT("Label set properties sucessfully updated."), 'success');
         }
         if ($action == "insertlabelset") {
             $lid = insertlabelset();
         }
         if ($action == "modlabelsetanswers" || $action == "ajaxmodlabelsetanswers") {
             modlabelsetanswers($lid);
         }
         if ($action == "deletelabelset") {
             if (deletelabelset($lid)) {
                 Yii::app()->setFlashMessage(Yii::app()->lang->gT("Label set sucessfully deleted."), 'success');
                 $lid = 0;
             }
         }
         if ($lid) {
             $this->getController()->redirect(array("admin/labels/sa/view/lid/" . $lid));
         } else {
             $this->getController()->redirect(array("admin/labels/sa/view"));
         }
     }
 }
Ejemplo n.º 6
0
 /**
  * Delete a label set
  *
  * @access public
  * @return void
  */
 public function delete()
 {
     $lid = returnGlobal('lid');
     if (Permission::model()->hasGlobalPermission('labelsets', 'delete')) {
         Yii::app()->loadHelper('admin/label');
         if (deletelabelset($lid)) {
             Yii::app()->setFlashMessage(gT("Label set sucessfully deleted."));
         }
     } else {
         Yii::app()->setFlashMessage(gT("You are not authorized to delete label sets."));
     }
     $this->getController()->redirect(array("admin/labels/sa/view"));
 }