当前位置: 首页>>代码示例>>PHP>>正文


PHP AttributeGroup::getAttributes方法代码示例

本文整理汇总了PHP中AttributeGroup::getAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP AttributeGroup::getAttributes方法的具体用法?PHP AttributeGroup::getAttributes怎么用?PHP AttributeGroup::getAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AttributeGroup的用法示例。


在下文中一共展示了AttributeGroup::getAttributes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: displayList

    public function displayList()
    {
        global $currentIndex, $cookie;
        echo '<br /><a href="' . $currentIndex . '&add' . $this->table . '&token=' . $this->token . '"><img src="../img/admin/add.gif" border="0" /> <b>' . $this->l('Add attributes group') . '</b></a><br />
		<a href="' . $currentIndex . '&addattribute&token=' . $this->token . '"><img src="../img/admin/add.gif" border="0" /> ' . $this->l('Add attribute') . '</a><br /><br />
		' . $this->l('Click on the group name to view its attributes. Click again to hide them.') . '<br /><br />';
        if ($this->_list === false) {
            Tools::displayError('No elements found');
        }
        $this->displayListHeader();
        echo '<input type="hidden" name="groupid" value="0">';
        if (!sizeof($this->_list)) {
            echo '<tr><td class="center" colspan="' . sizeof($this->_list) . '">' . $this->l('No elements found') . '</td></tr>';
        }
        $irow = 0;
        foreach ($this->_list as $tr) {
            $id = (int) $tr['id_' . $this->table];
            echo '
			<tr' . ($irow++ % 2 ? ' class="alt_row"' : '') . '>
				<td style="vertical-align: top; padding: 4px 0 4px 0" class="center"><input type="checkbox" name="' . $this->table . 'Box[]" value="' . $id . '" class="noborder" /></td>
				<td style="width: 140px; vertical-align: top; padding: 4px 0 4px 0; cursor: pointer" onclick="$(\'#attributes_' . $id . '\').slideToggle();">' . $tr['name'] . '</td>
				<td style="vertical-align: top; padding: 4px 0 4px 0; width: 340px">
					<div id="attributes_' . $id . '" style="display: none">
					<table class="table" cellpadding="0" cellspacing="0">
						<tr>
							<th><input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, \'attribute' . $id . 'Box[]\', this.checked)" /></th>
							<th width="100%">' . $this->l('Attribute') . '</th>
							<th>' . $this->l('Actions') . '</th>
						</tr>';
            $attributes = AttributeGroup::getAttributes((int) $cookie->id_lang, $id);
            foreach ($attributes as $attribute) {
                echo '
						<tr>
							<td class="center"><input type="checkbox" name="attribute' . $id . 'Box[]" value="' . $attribute['id_attribute'] . '" class="noborder" /></td>
							<td>
								' . ($tr['is_color_group'] ? '<div style="float: left; width: 18px; height: 12px; border: 1px solid #996633; background-color: ' . $attribute['color'] . '; margin-right: 4px;"></div>' : '') . $attribute['name'] . '
							</td>
							<td class="center">
								<a href="' . $currentIndex . '&id_attribute=' . $attribute['id_attribute'] . '&updateattribute&token=' . $this->token . '">
								<img src="../img/admin/edit.gif" border="0" alt="' . $this->l('Edit') . '" title="' . $this->l('Edit') . '" /></a>&nbsp;
								<a href="' . $currentIndex . '&id_attribute=' . $attribute['id_attribute'] . '&deleteattribute&token=' . $this->token . '"
								onclick="return confirm(\'' . $this->l('Delete attribute', __CLASS__, true, false) . ' : ' . $attribute['name'] . '?\');">
								<img src="../img/admin/delete.gif" border="0" alt="' . $this->l('Delete') . '" title="' . $this->l('Delete') . '" /></a>
							</td>
						</tr>';
            }
            echo '
					</table>
					<p><input type="Submit" class="button" name="submitDelattribute" value="' . $this->l('Delete selection') . '"
					onclick="changeFormParam(this.form, \'' . $currentIndex . '\', ' . $id . '); return confirm(\'' . $this->l('Delete selected items?', __CLASS__, true, false) . '\');" /></p>
					</div>
					</td>';
            echo '
				<td style="vertical-align: top; padding: 4px 0 4px 0" class="center">
					<a href="' . $currentIndex . '&id_' . $this->table . '=' . $id . '&update' . $this->table . '&token=' . $this->token . '">
					<img src="../img/admin/edit.gif" border="0" alt="' . $this->l('Edit') . '" title="' . $this->l('Edit') . '" /></a>&nbsp;
					<a href="' . $currentIndex . '&id_' . $this->table . '=' . $id . '&delete' . $this->table . '&token=' . $this->token . '" onclick="return confirm(\'' . $this->l('Delete item', __CLASS__, true, false) . ' : ' . $tr['name'] . '?\');">
					<img src="../img/admin/delete.gif" border="0" alt="' . $this->l('Delete') . '" title="' . $this->l('Delete') . '" /></a>
				</td>
			</tr>';
        }
        $this->displayListFooter();
    }
开发者ID:hecbuma,项目名称:quali-fisioterapia,代码行数:63,代码来源:AdminAttributesGroups.php

示例2: hookTop

 function hookTop($params)
 {
     global $cookie;
     global $smarty;
     /* GETTING ATTRIBUTES */
     if (Configuration::get('ADVSEARCH_ATTRIBUTES') == 1) {
         $attributeGroups = AttributeGroup::getAttributesGroups(intval($cookie->id_lang));
         if (!sizeof($attributeGroups) || $attributeGroups === false) {
             $text = '';
         } else {
             $text = '<h2>' . $this->l('ATTRIBUTES') . '</h2>';
             //.md5('TAGS').'<br>'.md5('categories');
             foreach ($attributeGroups as $group) {
                 $attributes = AttributeGroup::getAttributes(intval($cookie->id_lang), $group['id_attribute_group']);
                 if (!sizeof($attributes) || $attributes === false) {
                     continue;
                 }
                 $text = $text . '<div onclick="showAtrybuty(' . $group['id_attribute_group'] . ');" class="dialogOpcjeTitle">' . $group['public_name'] . '</div>';
                 $text .= '<div id="opcje_' . $group['id_attribute_group'] . '" style="display:none;" class="opcjeItem">';
                 $text .= '<table>';
                 foreach ($attributes as $attribute) {
                     $text = $text . '<tr><td><input name="atrybut_opcja[]" value="' . $attribute['id_attribute'] . '" type="checkbox" class="dialoginput"></td><td>&nbsp;&nbsp;' . trim($attribute['name']) . '</td></tr>';
                 }
                 $text .= '</table></div>';
             }
         }
     } else {
         $text = '';
     }
     /* GETTING ATTRIBUTES */
     /* GETTING CATEGORIES */
     if (Configuration::get('ADVSEARCH_CATEGORIES') == 1) {
         $result = Category::getCategories(intval($cookie->id_lang), true, false);
         $resultParents = array();
         $resultIds = array();
         foreach ($result as $row) {
             ${$row}['name'] = Category::hideCategoryPosition($row['name']);
             $resultParents[$row['id_parent']][] = $row;
             $resultIds[$row['id_category']] = $row;
         }
         $blockCategTree = $this->getTree($resultParents, $resultIds);
         $cats = $this->showCats($blockCategTree['children'], 0);
     } else {
         $cats = '';
     }
     /* GETTING CATEGORIES */
     /* GETTING SUPPLIERS */
     if (Configuration::get('ADVSEARCH_SUPPLIERS') == 1) {
         $sup_sel = Supplier::getSuppliers(false, intval($params['cookie']->id_lang), true);
         if (sizeof($sup_sel) > 0) {
             sort($sup_sel);
             $sup_show = 1;
         } else {
             $sup_show = 0;
         }
         if ($sup_show == 1) {
             $var = array();
             foreach ($sup_sel as $sup) {
                 //$sup['nb_products']=$this->CountSupPro($sup['id_supplier']);
                 $var[] = $sup;
             }
             $sup_sel = $var;
         }
         $supl_display = '<h2>' . $this->l('SUPPLIERS') . '</h2>';
         foreach ($sup_sel as $supply) {
             $supl_display .= '<div class="dialogOpcjeTitle"><input type="checkbox" value="' . $supply['id_supplier'] . '" name="supply[]">&nbsp;&nbsp;' . $supply['name'] . '</div>';
         }
     } else {
         $supl_display = '';
     }
     /* GETTING SUPPLIERS */
     /* GETTING MANUFACTURER */
     if (Configuration::get('ADVSEARCH_MANUFACTURERS') == 1) {
         $man_sel = Manufacturer::getManufacturers(true, intval($params['cookie']->id_lang), true);
         $man_display = '<h2>' . $this->l('MANUFACTURER') . '</h2>';
         foreach ($man_sel as $manuf) {
             if ($manuf['nb_products'] > 0) {
                 $man_display .= '<div class="dialogOpcjeTitle"><input type="checkbox" value="' . $manuf['id_manufacturer'] . '" name="manufacturer[]">&nbsp;&nbsp;' . $manuf['name'] . '</div>';
             }
         }
     } else {
         $man_display = '';
     }
     /* GETTING MANUFACTURER */
     /* GETTING TAG CLOUDS */
     if (Configuration::get('ADVSEARCH_TAGS') == 1) {
         $tag_sel = array();
         $tag_sel = Tag::getMainTags(intval($params['cookie']->id_lang), 500);
         if (sizeof($tag_sel)) {
             sort($tag_sel);
         } else {
             $tag_show = 0;
         }
         $tagi = '<h2>' . $this->l('TAGS') . '</h2><div class="dialogOpcjeTitle">';
         for ($i = 0; $i < sizeof($tag_sel); $i++) {
             $tagi .= '<p id="advSearchTags" onclick="parent.location.href=\'modules/yasearch/results.php?tag=' . urlencode($tag_sel[$i]['name']) . '\'">&nbsp;&nbsp;' . ucfirst($tag_sel[$i]['name']) . '</p>';
         }
         $tagi .= '</div>';
     } else {
         $tagi = '';
//.........这里部分代码省略.........
开发者ID:redb,项目名称:prestashop,代码行数:101,代码来源:yasearch.php


注:本文中的AttributeGroup::getAttributes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。