protected function displayValidFields()
    {
        $html = '<ul>';
        $object_list = AddressFormat::getLiableClass('Address');
        $object_list['Address'] = null;
        // Get the available properties for each class
        foreach ($object_list as $class_name => &$object) {
            $fields = array();
            $html .= '<li>
				<a href="javascript:void(0);" onClick="displayAvailableFields(\'' . $class_name . '\')">' . $class_name . '</a>';
            foreach (AddressFormat::getValidateFields($class_name) as $name) {
                $fields[] = '<a style="color:#4B8;" href="javascript:void(0);" class="addPattern" id="' . $class_name . ':' . $name . '">
					' . $name . '</a>';
            }
            $html .= '
				<div class="availableFieldsList" id="availableListFieldsFor_' . $class_name . '" style="width:300px;">
				' . implode(', ', $fields) . '</div></li>';
            unset($object);
        }
        return $html .= '</ul>';
    }
    protected function displayValidFields()
    {
        /* The following translations are needed later - don't remove the comments!
        		$this->l('Customer');
        		$this->l('Warehouse');
        		$this->l('Country');
        		$this->l('State');
        		$this->l('Address');
        		*/
        $html_tabnav = '<ul class="nav nav-tabs" id="custom-address-fields">';
        $html_tabcontent = '<div class="tab-content" >';
        $object_list = AddressFormat::getLiableClass('Address');
        $object_list['Address'] = null;
        // Get the available properties for each class
        $i = 0;
        $class_tab_active = 'active';
        foreach ($object_list as $class_name => &$object) {
            if ($i != 0) {
                $class_tab_active = '';
            }
            $fields = array();
            $html_tabnav .= '<li class="' . $class_tab_active . '"">
				<a href="#availableListFieldsFor_' . $class_name . '"><i class="icon-caret-down"></i>&nbsp;' . Translate::getAdminTranslation($class_name, 'AdminCountries') . '</a></li>';
            foreach (AddressFormat::getValidateFields($class_name) as $name) {
                $fields[] = '<a href="javascript:void(0);" class="addPattern btn btn-default btn-xs" id="' . ($class_name == 'Address' ? $name : $class_name . ':' . $name) . '">
					<i class="icon-plus-sign"></i>&nbsp;' . ObjectModel::displayFieldName($name, $class_name) . '</a>';
            }
            $html_tabcontent .= '
				<div class="tab-pane availableFieldsList panel ' . $class_tab_active . '" id="availableListFieldsFor_' . $class_name . '">
				' . implode(' ', $fields) . '</div>';
            unset($object);
            $i++;
        }
        $html_tabnav .= '</ul>';
        $html_tabcontent .= '</div>';
        return $html = $html_tabnav . $html_tabcontent;
    }
Ejemplo n.º 3
0
    protected function displayValidFields()
    {
        $html_tabnav = '<ul class="nav nav-tabs" id="custom-address-fields">';
        $html_tabcontent = '<div class="tab-content" >';
        $object_list = AddressFormat::getLiableClass('Address');
        $object_list['Address'] = null;
        // Get the available properties for each class
        $i = 0;
        $class_tab_active = 'active';
        foreach ($object_list as $class_name => &$object) {
            if ($i != 0) {
                $class_tab_active = '';
            }
            $fields = array();
            $html_tabnav .= '<li class="' . $class_tab_active . '"">
				<a href="#availableListFieldsFor_' . $class_name . '"><i class="icon-caret-down"></i>&nbsp;' . $class_name . '</a></li>';
            foreach (AddressFormat::getValidateFields($class_name) as $name) {
                $fields[] = '<a href="javascript:void(0);" class="addPattern btn btn-default btn-xs" id="' . ($class_name == 'Address' ? $name : $class_name . ':' . $name) . '">
					<i class="icon-plus-sign"></i>&nbsp;' . $name . '</a>';
            }
            $html_tabcontent .= '
				<div class="tab-pane availableFieldsList panel ' . $class_tab_active . '" id="availableListFieldsFor_' . $class_name . '">
				' . implode(' ', $fields) . '</div>';
            unset($object);
            $i++;
        }
        $html_tabnav .= '</ul>';
        $html_tabcontent .= '</div>';
        return $html = $html_tabnav . $html_tabcontent;
    }