public function add_input_tag($name, HTMLTags_InputTag $input_tag, $label_text = NULL, $post_content = NULL)
 {
     #echo "In HTMLTags_SimpleOLForm::add_input_tag(...)\n";
     $input_li = new HTMLTags_LI();
     if (!isset($label_text)) {
         $l_t_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($name, '_');
         $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
         #    echo "\$label_text: $label_text\n";
         #} else {
         #    echo "\$label_text: $label_text\n";
     }
     #echo "After if\n";
     $input_label = new HTMLTags_Label($label_text);
     $input_label->set_attribute_str('for', $name);
     #$input_label->set_attribute_str('id', $name);
     $input_li->append_tag_to_content($input_label);
     $input_li->append_tag_to_content($input_tag);
     if (isset($post_content)) {
         #print_r($post_content);
         $input_li->append($post_content);
         #} else {
         #	echo "No post_content!\n";
     }
     $input_msg_box = new HTMLTags_Span();
     $input_msg_box->set_attribute_str('id', $name . 'msg');
     $input_msg_box->set_attribute_str('class', 'rules');
     $input_li->append_tag_to_content($input_msg_box);
     if (count($this->input_lis) == 0) {
         $this->first_input_name = $name;
     }
     $this->input_lis[] = $input_li;
 }
 public static function get_module_name(HaddockProjectOrganisation_ModuleDirectory $module_directory)
 {
     /*
      * Does the module have name file?
      */
     $name_file_name = self::get_name_file_name($module_directory);
     if (is_file($name_file_name)) {
         return trim(file_get_contents($name_file_name));
     }
     /*
      * Does this module have a module config file?
      */
     if ($module_directory->has_module_config_file()) {
         $module_config_file = $module_directory->get_module_config_file();
         if ($module_config_file->has_module_name()) {
             return $module_config_file->get_module_name();
         }
     }
     /*
      * There isn't a module name set in the file,
      * so we should work out the name algorithmically.
      */
     if (preg_match('{([^\\\\/]+)$}', $module_directory->get_name(), $matches)) {
         $c_c_m_n_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($matches[1], '-');
         return $c_c_m_n_l_o_ws->get_words_as_capitalised_string();
     }
     return '';
 }
 protected function get_input_lis()
 {
     $input_lis = array();
     $visible_fields = $this->get_visible_fields();
     foreach ($visible_fields as $visible_field) {
         if ($visible_field->get_name() != 'id') {
             $input_li = new HTMLTags_LI();
             $l_t_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($visible_field->get_name(), '_');
             $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
             $input_label = new HTMLTags_Label($label_text);
             $input_label->set_attribute_str('for', $visible_field->get_name());
             #$input_label->set_attribute_str('id', $visible_field->get_name());
             $input_li->append_tag_to_content($input_label);
             $field_renderer = $visible_field->get_renderer();
             $input_tag = $field_renderer->get_form_input();
             #print_r($visible_field);
             if ($visible_field->has_default()) {
                 $input_tag->set_value($visible_field->get_default());
             }
             $input_li->append_tag_to_content($input_tag);
             $input_lis[] = $input_li;
         }
     }
     return $input_lis;
 }
 protected function get_input_lis()
 {
     $input_lis = array();
     $visible_fields = $this->get_visible_fields();
     $row_renderer = $this->row->get_renderer();
     foreach ($visible_fields as $visible_field) {
         $input_li = new HTMLTags_LI();
         $l_t_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($visible_field->get_name(), '_');
         $label_text = $l_t_l_o_ws->get_words_as_capitalised_string();
         $input_label = new HTMLTags_Label($label_text);
         $input_label->set_attribute_str('for', $visible_field->get_name());
         #$input_label->set_attribute_str('id', $name);
         $input_li->append_tag_to_content($input_label);
         #$field_renderer = $visible_field->get_renderer();
         #
         #$input_tag = $field_renderer->get_form_input();
         #
         #echo '$visible_field->get_name(): ' . $visible_field->get_name() . "\n";
         #
         #$input_tag->set_value(
         #    $this->row->get($visible_field->get_name())
         #);
         $input_tag = $row_renderer->get_input_tag_for_field($visible_field);
         $input_li->append_tag_to_content($input_tag);
         $input_lis[] = $input_li;
     }
     return $input_lis;
 }
 public function get_module_name_as_l_o_w()
 {
     $module_name_as_l_o_w = null;
     if (preg_match('{([^\\\\/]+)$}', $this->get_name(), $matches)) {
         $module_name_as_l_o_w = Formatting_ListOfWordsHelper::get_list_of_words_for_string($matches[1], '-');
     }
     return $module_name_as_l_o_w;
 }
 public function append_nonsortable_field_name($field_name, $title = NULL)
 {
     $th = new HTMLTags_TH();
     if (!isset($title)) {
         $f_n_l_o_ws = Formatting_ListOfWordsHelper::get_list_of_words_for_string($field_name, '_');
         $title = $f_n_l_o_ws->get_words_as_capitalised_string();
     }
     $th->append_str_to_content($title);
     $this->append_tag_to_content($th);
 }
 public function get_camel_case_root()
 {
     $project_title = '';
     $project_tag = $this->get_project_tag();
     if ($project_tag->hasAttribute('camel_case_root')) {
         $project_title = $project_tag->getAttribute('camel_case_root');
     } else {
         $project_name = $this->get_project_name();
         $pn_low = Formatting_ListOfWordsHelper::get_list_of_words_for_string($project_name, '-');
         $project_title = $pn_low->get_words_as_camel_case_string();
     }
     return $project_title;
 }
 /**
  * The column heading of for an action.
  */
 protected function make_action_th($action_str)
 {
     #echo "\$action_str: $action_str\n";
     $title_low = Formatting_ListOfWordsHelper::get_list_of_words_for_string($action_str, '_');
     $title = $title_low->get_words_as_capitalised_string();
     #echo $title;
     return new HTMLTags_TH($title);
 }
 public static function get_camel_case_root()
 {
     #$config_file = self::get_project_specific_config_file();
     #return $config_file->get_project_title();
     $camel_case_root_file_name = self::get_camel_case_root_file_name();
     if (is_file($camel_case_root_file_name)) {
         return trim(file_get_contents($camel_case_root_file_name));
     } else {
         $name = self::get_name();
         $name_low = Formatting_ListOfWordsHelper::get_list_of_words_for_string($name, '-');
         return $name_low->get_words_as_camel_case_string();
     }
 }
 public function get_title()
 {
     if (isset($this->title)) {
         return $this->title;
     }
     if ($this->has_page_config_file()) {
         $page_config_file = $this->get_page_config_file();
         if ($page_config_file->has_page_title()) {
             return $page_config_file->get_page_title();
         }
     }
     /**
      * Work out the title from the link.
      */
     $title_as_l_o_w = Formatting_ListOfWordsHelper::get_list_of_words_for_string($this->get_page_name(), '-');
     return $title_as_l_o_w->get_words_as_capitalised_string();
 }
 public function get_title_for_page_in_module_in_section($page, $module, $section)
 {
     $page_element = $this->get_page_element_in_module_in_section($page, $module, $section);
     $title = '';
     if ($page_element->hasAttribute('title')) {
         $title = $page_element->getAttribute('title');
     } else {
         $ptlow = Formatting_ListOfWordsHelper::get_list_of_words_for_string($page_element->getAttribute('name'), $separator = '-');
         $title = $ptlow->get_words_as_capitalised_string();
     }
     return $title;
 }
 public static function get_action_th($action_str)
 {
     $title_low = Formatting_ListOfWordsHelper::get_list_of_words_for_string($action_str);
     return new HTMLTags_TH($title_low->get_words_as_capitalised_string());
 }
 public function get_module_name_as_l_o_w()
 {
     #$project_directory = $this->get_project_directory();
     #$project_name = $project_directory->get_current_project_name();
     #$p_n_l_o_ws = Formatting_ListOfWords::get_list_of_words_for_string($project_name, '-');
     #
     #return $p_n_l_o_ws;
     #$hpo_cm
     #	= Configuration_ConfigManagerHelper
     #		::get_config_manager(
     #			'haddock',
     #			'haddock-project-organisation'
     #		);
     #
     #$project_name = $hpo_cm->get_project_name();
     $project_name = HaddockProjectOrganisation_ProjectInformationHelper::get_name();
     return Formatting_ListOfWordsHelper::get_list_of_words_for_string($project_name, '-');
 }