Show
Ignore:
Timestamp:
10/02/09 16:21:40 (3 years ago)
Author:
gbastien
Message:

* Email address format now corresponds to newer standard RFC2822 (#624)
* Corrected typos and tab alignment

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/admin/generic_object_admin.php

    r1421 r1424  
    324324        break; 
    325325 
    326             case "new_ui" : 
    327                 switch ($_REQUEST['object_class']) { 
    328                     case "Node" : 
    329                     case "Server" : 
    330                     case "Content" : 
    331                     case "ContentTypeFilter" : 
    332                     case "ProfileTemplate" : 
    333                         $newText = $addText; 
    334                         break; 
    335  
    336                     default : 
    337                         break; 
    338                 } 
    339  
    340                 $html .= "<form action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' method='post'>"; 
    341                 $html .= "<input type='hidden' name='object_class' value='$class'>"; 
    342                 $html .= call_user_func(array ( 
    343                 $class, 
    344                 'getCreateNewObjectUI' 
    345                 )); 
    346                 $html .= "<input type='hidden' name='action' value='process_new_ui'>"; 
    347                 $html .= "<input type=submit name='new_ui_submit' value='$newText'>"; 
    348                 $html .= '</form>'; 
    349                 break; 
    350  
    351                     case "edit" : 
    352                         // Process preview abilities 
    353                         switch ($_REQUEST['object_class']) { 
    354                             case "Network" : 
    355                             case "Server" : 
    356                             case "User" : 
    357                             case "ContentTypeFilter" : 
    358                             case "ProfileTemplate" : 
    359                                 $supportsPreview = false; 
    360                                 break; 
    361  
    362                             default : 
    363                                 break; 
    364                         } 
    365  
    366                         // Process deletion abilities 
    367                         switch ($_REQUEST['object_class']) { 
    368                             case "User" : 
    369                                 $supportsDeletion = false; 
    370                                 break; 
    371                             case "Network" : 
    372                             case "Node" : 
    373                             case "Server" : 
    374                             case "ProfileTemplate" : 
    375                             case "ContentTypeFilter" : 
    376                                 break; 
    377  
    378                             default : 
    379                                 break; 
    380                         } 
    381  
    382                         if (!$object) { 
    383                             echo "<div class='errormsg'>" . _("Sorry, the 'object_id' parameter must be specified") . "</div>"; 
    384                             exit; 
    385                         } 
    386  
    387                         if (!empty ($_REQUEST['debug'])) { 
    388                             $common_input .= "<input type='hidden' name='debug' value='true'>"; 
    389                         } 
    390  
    391                         $common_input .= "<input type='hidden' name='object_id' value='" . $object->getId() . "'>"; 
    392                         $common_input .= "<input type='hidden' name='object_class' value='" . get_class($object) . "'>"; 
    393  
    394                         $html .= "<form name='generic_object_form' enctype='multipart/form-data' action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' method='post'>"; 
    395                         $html .= $common_input; 
    396                         $html .= $object->getAdminUI(); 
    397                         $html .= "<div class='generic_object_admin_edit'>"; 
    398                         $html .= "<input type='hidden' name='action' value='save'>"; 
    399                         $html .= "<input type='submit' class='submit' name='save_submit' value='" . _("Save") . " " . get_class($object) . "'>"; 
    400  
    401                         if ($supportsDeletion) { 
    402                             $html .= "<script type='text/javascript'>"; 
    403                             $html .= "document.write(\"<input type='hidden' name='action_delete' value='no' id='form_action_delete' />\");"; 
    404                             $html .= "document.write(\"<input type='submit' class='submit' name='action_delete_submit' onmouseup='document.getElementById(\\\"form_action_delete\\\").value = \\\"delete\\\"' onkeyup='document.getElementById(\\\"form_action_delete\\\").value = \\\"delete\\\"' value='" . _("Delete") . " " . get_class($object) . "' />\");"; 
    405                             $html .= "</script>"; 
    406                         } 
    407  
    408                         $html .= '</form>'; 
    409  
    410                         if ($supportsPreview) { 
    411                             $html .= "<form action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' target='_blank' method='post'>"; 
    412                             $html .= $common_input; 
    413                             $html .= "<input type='hidden' name='action' value='preview'>"; 
    414                             $html .= "<input type='submit' class='submit' name='preview_submit' value='" . _("Preview") . " " . get_class($object) . "'>"; 
    415                             $html .= '</form>'; 
    416                         } 
    417  
    418                         // Display delete button (without check for unchecked persitant switch) only if JavaScript has been disabled 
    419                         if ($supportsDeletion) { 
    420                             $html .= "<noscript>"; 
    421                             $html .= "<form action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' method='post'>"; 
    422                             $html .= $common_input; 
    423                             $html .= "<input type='hidden' name='action' value='delete'>"; 
    424                             $html .= "<input type='submit' class='submit'  name='delete_submit' value='" . _("Delete") . " " . get_class($object) . "'>"; 
    425                             $html .= '</form>'; 
    426                             $html .= "</noscript>"; 
    427                         } 
    428  
    429                         $html .= "<div class='clearbr'></div>"; 
    430                         $html .= "</div>"; 
    431                         break; 
    432  
    433                             default : 
    434                                 // Do nothing 
    435                                 break; 
     326    case "new_ui" : 
     327        switch ($_REQUEST['object_class']) { 
     328            case "Node" : 
     329            case "Server" : 
     330            case "Content" : 
     331            case "ContentTypeFilter" : 
     332            case "ProfileTemplate" : 
     333                $newText = $addText; 
     334                break; 
     335 
     336            default : 
     337                break; 
     338        } 
     339 
     340        $html .= "<form action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' method='post'>"; 
     341        $html .= "<input type='hidden' name='object_class' value='$class'>"; 
     342        $html .= call_user_func(array ( 
     343            $class, 
     344            'getCreateNewObjectUI' 
     345            )); 
     346        $html .= "<input type='hidden' name='action' value='process_new_ui'>"; 
     347        $html .= "<input type=submit name='new_ui_submit' value='$newText'>"; 
     348        $html .= '</form>'; 
     349        break; 
     350 
     351    case "edit" : 
     352        // Process preview abilities 
     353        switch ($_REQUEST['object_class']) { 
     354            case "Network" : 
     355            case "Server" : 
     356            case "User" : 
     357            case "ContentTypeFilter" : 
     358            case "ProfileTemplate" : 
     359                $supportsPreview = false; 
     360                break; 
     361 
     362            default : 
     363                break; 
     364        } 
     365 
     366        // Process deletion abilities 
     367        switch ($_REQUEST['object_class']) { 
     368            case "User" : 
     369                $supportsDeletion = false; 
     370                break; 
     371            case "Network" : 
     372            case "Node" : 
     373            case "Server" : 
     374            case "ProfileTemplate" : 
     375            case "ContentTypeFilter" : 
     376                break; 
     377 
     378            default : 
     379                break; 
     380        } 
     381 
     382        if (!$object) { 
     383            echo "<div class='errormsg'>" . _("Sorry, the 'object_id' parameter must be specified") . "</div>"; 
     384            exit; 
     385        } 
     386 
     387        if (!empty ($_REQUEST['debug'])) { 
     388            $common_input .= "<input type='hidden' name='debug' value='true'>"; 
     389        } 
     390 
     391        $common_input .= "<input type='hidden' name='object_id' value='" . $object->getId() . "'>"; 
     392        $common_input .= "<input type='hidden' name='object_class' value='" . get_class($object) . "'>"; 
     393 
     394        $html .= "<form name='generic_object_form' enctype='multipart/form-data' action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' method='post'>"; 
     395        $html .= $common_input; 
     396        $html .= $object->getAdminUI(); 
     397        $html .= "<div class='generic_object_admin_edit'>"; 
     398        $html .= "<input type='hidden' name='action' value='save'>"; 
     399        $html .= "<input type='submit' class='submit' name='save_submit' value='" . _("Save") . " " . get_class($object) . "'>"; 
     400 
     401        if ($supportsDeletion) { 
     402            $html .= "<script type='text/javascript'>"; 
     403            $html .= "document.write(\"<input type='hidden' name='action_delete' value='no' id='form_action_delete' />\");"; 
     404            $html .= "document.write(\"<input type='submit' class='submit' name='action_delete_submit' onmouseup='document.getElementById(\\\"form_action_delete\\\").value = \\\"delete\\\"' onkeyup='document.getElementById(\\\"form_action_delete\\\").value = \\\"delete\\\"' value='" . _("Delete") . " " . get_class($object) . "' />\");"; 
     405            $html .= "</script>"; 
     406        } 
     407 
     408        $html .= '</form>'; 
     409 
     410        if ($supportsPreview) { 
     411            $html .= "<form action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' target='_blank' method='post'>"; 
     412            $html .= $common_input; 
     413            $html .= "<input type='hidden' name='action' value='preview'>"; 
     414            $html .= "<input type='submit' class='submit' name='preview_submit' value='" . _("Preview") . " " . get_class($object) . "'>"; 
     415            $html .= '</form>'; 
     416        } 
     417 
     418        // Display delete button (without check for unchecked persitant switch) only if JavaScript has been disabled 
     419        if ($supportsDeletion) { 
     420            $html .= "<noscript>"; 
     421            $html .= "<form action='" . GENERIC_OBJECT_ADMIN_ABS_HREF . "' method='post'>"; 
     422            $html .= $common_input; 
     423            $html .= "<input type='hidden' name='action' value='delete'>"; 
     424            $html .= "<input type='submit' class='submit'  name='delete_submit' value='" . _("Delete") . " " . get_class($object) . "'>"; 
     425            $html .= '</form>'; 
     426            $html .= "</noscript>"; 
     427        } 
     428 
     429        $html .= "<div class='clearbr'></div>"; 
     430        $html .= "</div>"; 
     431        break; 
     432 
     433    default : 
     434        // Do nothing 
     435        break; 
    436436} 
    437437