Ejemplo n.º 1
0
         foreach ( $current_rubrics as $rubric ) {
            switch ( $rubric ) {
               case CS_GROUP_TYPE:
                  $rubric_connection[] = CS_GROUP_TYPE;
                  break;
#               case CS_TOPIC_TYPE:
#                  $rubric_connection[] = CS_TOPIC_TYPE;
#                  break;
            }
         }
      }
      $form->setRubricConnections($rubric_connection);

      // Redirect to attach groups
      if ( isOption($command, $translator->getMessage('RUBRIC_DO_ATTACH_GROUP_BUTTON')) ) {
         attach_redirect(CS_GROUP_TYPE, $iid);
      }
      include_once('include/inc_right_boxes_handling.php');

#      // Redirect to attach topics
#      if ( isOption($command, $translator->getMessage('RUBRIC_DO_ATTACH_TOPIC_BUTTON')) ) {
#         attach_redirect(CS_TOPIC_TYPE, $iid);
#      }

      // init data display
      if (!empty($_POST)) {
         if (empty($session_post_vars)){
            $session_post_vars = $_POST;
         }
         if ( !empty($_FILES) ) {
         if ( !empty($_FILES['upload']['tmp_name']) ) {
Ejemplo n.º 2
0
         attach_redirect(CS_DISCUSSION_TYPE, $current_iid);
      }

      // Redirect to attach PROJECT
      if ( isOption($command, $translator->getMessage('RUBRIC_DO_ATTACH_PROJECT_BUTTON')) ) {
         attach_redirect(CS_PROJECT_TYPE, $current_iid);
      }


            // Redirect to attach topics
            if ( isOption($command, $translator->getMessage('RUBRIC_DO_ATTACH_TOPIC_BUTTON')) ) {
               attach_redirect(CS_TOPIC_TYPE, $current_iid);
            }
            // Redirect to attach institutions
            if ( isOption($command, $translator->getMessage('RUBRIC_DO_ATTACH_INSTITUTION_BUTTON')) ) {
               attach_redirect(CS_INSTITUTION_TYPE, $current_iid);
            }
         }


         // Load form data from postvars
         if ( !empty($_POST) ) {
            if ( !empty($_FILES) ) {
               if ( !empty($_FILES['logo']['tmp_name']) ) {
                  $new_temp_name = $_FILES['logo']['tmp_name'].'_TEMP_'.$_FILES['logo']['name'];
                  move_uploaded_file($_FILES['logo']['tmp_name'],$new_temp_name);
                  $_FILES['logo']['tmp_name'] = $new_temp_name;
                  $session_item = $environment->getSessionItem();
                  if (!isset($room_iid) or empty($room_iid)){
                     $room_iid = $environment->getCurrentContextID();
                  }
Ejemplo n.º 3
0
      }
   }

   // Delete item
   elseif ( isOption($command, $translator->getMessage('HOMEPAGE_DELETE_BUTTON')) ) {
      cleanup_session($current_iid);
      $homepage_item->delete();
      redirect($environment->getCurrentContextID(),$environment->getCurrentModule(), 'detail', '');
   }

   // Show form and/or save item
   else {

      // Redirect to attach material
      if ( isOption($command, $translator->getMessage('HOMEPAGE_RUBRIK_BUTTON')) ) {
         attach_redirect(CS_MATERIAL_TYPE, $current_iid);
      }

      // Initialize the form
      $params = array();
      $params['environment'] = $environment;
      $params['with_modifying_actions'] = true;
      $form = $class_factory->getClass(HOMEPAGE_DETAIL_VIEW,$params);
      unset($params);
      $form->switch2Form();

      // Load form data from postvars
      if ( !empty($_POST) ) {
         $form->setFormPost($_POST);
      }