Ejemplo n.º 1
0
 /**
  * Checks if an Item needs class-information
  * @param $no_class_exist_check If this is true, method will not check the existence of the class
  * @return bool
  */
 private function is_class_information($no_class_exist_check)
 {
     if ($this->sample and is_numeric($this->gid)) {
         $sample_template = new SampleTemplate($this->sample->get_template_id());
         $attribute_array = $sample_template->get_gid_attributes($this->gid);
         if (is_array($attribute_array) and count($attribute_array) >= 1) {
             if ($attribute_array['class']) {
                 $class_name = $attribute_array['class'];
                 if ($this->exist_class($class_name) and ($no_class_exist_check == false or $no_class_exist_check == null)) {
                     return false;
                 } else {
                     $class_array = $sample_template->get_class($class_name);
                     if (is_array($class_array) and count($class_array) >= 1) {
                         foreach ($class_array as $key => $value) {
                             if ($value['xml_element'] == "information") {
                                 $return_array = array();
                                 if ($value['keywords'] == "keywords") {
                                     $return_array['keywords'] = true;
                                 }
                                 if ($value['description'] == "description") {
                                     $return_array['description'] = true;
                                 }
                                 if ($return_array['keywords'] or $return_array['description']) {
                                     return $return_array;
                                 } else {
                                     return false;
                                 }
                             }
                         }
                     } else {
                         return false;
                     }
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }