PHPFusion\QuantumFields::display_all_fields PHP Method

display_all_fields() public method

* Hardcoded Column Attributes - Can be added to forms but is it too technical for non coders?
public display_all_fields ( )
    public function display_all_fields()
    {
        global $aidlink;
        if ($this->debug) {
            print_p($_POST);
        }
        opentable($this->system_title);
        echo "<div class='row'>\n";
        echo "<div class='col-xs-12 col-sm-7'>\n";
        if (!empty($this->page[0])) {
            $tab_title = array();
            foreach ($this->page[0] as $page_id => $page_data) {
                $tab_title['title'][$page_id] = self::parse_label($page_data['field_cat_name']);
                $tab_title['id'][$page_id] = $page_id;
                $tab_title['icon'][$page_id] = '';
            }
            reset($tab_title['title']);
            $tab_active = tab_active($tab_title, key($tab_title['title']));
            echo opentab($tab_title, $tab_active, 'uftab');
            foreach ($this->page[0] as $page_id => $page_details) {
                echo opentabbody($tab_title['title'][$page_id], $tab_title['id'][$page_id], $tab_active);
                // load all categories here.
                if ($this->debug) {
                    echo "<div class='m-t-20 text-dark'>\n";
                    if ($page_id == 1) {
                        echo sprintf($this->locale['fields_0100'], DB_USERS);
                    } else {
                        echo sprintf($this->locale['fields_0101'], $page_details['field_cat_db'], $page_details['field_cat_index']);
                    }
                    echo "</div>\n";
                }
                // Edit/Delete Category Administration
                echo "<div class='m-t-20 m-b-0'>\n";
                echo "<div class='btn-group pull-right'>\n";
                echo "<a class='btn btn-default' href='" . FUSION_SELF . $aidlink . "&amp;action=cat_edit&amp;cat_id=" . $page_id . "'>" . $this->locale['edit'] . " Category</a>";
                echo "<a class='btn btn-danger' href='" . FUSION_SELF . $aidlink . "&amp;action=cat_delete&amp;cat_id=" . $page_id . "'>" . $this->locale['delete'] . " Category</a>";
                echo "</div>\n";
                echo "</div>\n";
                if (isset($this->page[$page_id])) {
                    echo "<div class='clearfix m-t-20'>\n";
                    $i = 0;
                    $counter = count($this->page[$page_id]) - 1;
                    foreach ($this->page[$page_id] as $cat_id => $field_cat) {
                        // field category information
                        if ($this->debug) {
                            print_p($field_cat);
                        }
                        echo "<div class='clearfix'>\n";
                        echo form_para(self::parse_label($field_cat['field_cat_name']), $cat_id . '-' . self::parse_label($field_cat['field_cat_name']), 'profile_category_name display-inline-block pull-left');
                        echo "<div class='pull-left m-t-10 m-l-10'>\n";
                        if ($i != 0) {
                            echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=cmu&amp;cat_id=" . $cat_id . "&amp;parent_id=" . $field_cat['field_parent'] . "&amp;order=" . ($field_cat['field_cat_order'] - 1) . "'>" . $this->locale['move_up'] . "</a> - ";
                        }
                        if ($i !== $counter) {
                            echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=cmd&amp;cat_id=" . $cat_id . "&amp;parent_id=" . $field_cat['field_parent'] . "&amp;order=" . ($field_cat['field_cat_order'] + 1) . "'>" . $this->locale['move_down'] . "</a> - ";
                        }
                        echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=cat_edit&amp;cat_id=" . $cat_id . "'>" . $this->locale['edit'] . "</a> - ";
                        echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=cat_delete&amp;cat_id=" . $cat_id . "'>" . $this->locale['delete'] . "</a>";
                        echo "</div>\n";
                        echo "</div>\n";
                        if (isset($this->fields[$cat_id])) {
                            $k = 0;
                            $item_counter = count($this->fields[$cat_id]) - 1;
                            foreach ($this->fields[$cat_id] as $arr => $field_data) {
                                if ($this->debug) {
                                    print_p($field_data);
                                }
                                //Fields - Move down/Move Up - Edit - Delete
                                echo "<div class='text-left'>\n";
                                if ($k != 0) {
                                    echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=fmu&amp;parent_id=" . $field_data['field_cat'] . "&amp;field_id=" . $field_data['field_id'] . "&amp;order=" . ($field_data['field_order'] - 1) . "'>" . $this->locale['move_up'] . "</a> - ";
                                }
                                if ($k !== $item_counter) {
                                    echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=fmd&amp;parent_id=" . $field_data['field_cat'] . "&amp;field_id=" . $field_data['field_id'] . "&amp;order=" . ($field_data['field_order'] + 1) . "'>" . $this->locale['move_down'] . "</a> - ";
                                }
                                if ($field_data['field_type'] == 'file') {
                                    echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=module_edit&amp;module_id=" . $field_data['field_id'] . "'>" . $this->locale['edit'] . "</a> - ";
                                } else {
                                    echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=field_edit&amp;field_id=" . $field_data['field_id'] . "'>" . $this->locale['edit'] . "</a> - ";
                                }
                                echo "<a class='text-smaller' href='" . FUSION_SELF . $aidlink . "&amp;action=field_delete&amp;field_id=" . $field_data['field_id'] . "'>" . $this->locale['delete'] . "</a>";
                                echo "</div>\n";
                                $options = array('inline' => 1, 'show_title' => 1, 'hide_value' => 1);
                                if ($field_data['field_type'] == 'file') {
                                    $options += array('plugin_folder' => $this->plugin_folder, 'plugin_locale_folder' => $this->plugin_locale_folder);
                                }
                                echo $this->display_fields($field_data, $this->callback_data, $this->method, $options);
                                $k++;
                            }
                        }
                        $i++;
                    }
                    echo "</div>\n";
                } else {
                    // display no category
                    echo "<div class='m-t-20 well text-center'>" . $this->locale['fields_0102'] . self::parse_label($page_details['field_cat_name']) . "</div>\n";
                }
                echo closetabbody();
            }
            echo closetab();
        } else {
            echo "<div class='well text-center'>" . $this->locale['fields_0103'] . "</div>\n";
        }
        echo "</div>\n<div class='col-xs-12 col-sm-5'>\n";
        $this->quantum_admin_buttons();
        echo "</div>\n</div>\n";
        closetable();
    }