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


PHP FeatureValue::getFeatureValues方法代码示例

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


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

示例1: displayFormFeatures

    function displayFormFeatures($obj, $languages, $defaultLanguage)
    {
        global $cookie, $currentIndex;
        if ($obj->id) {
            $feature = Feature::getFeatures(intval($cookie->id_lang));
            $ctab = '';
            foreach ($feature as $tab) {
                $ctab .= 'ccustom_' . $tab['id_feature'] . '¤';
            }
            $ctab = rtrim($ctab, '¤');
            echo '
			<table cellpadding="5">
				<tr>
					<td colspan="2"><b>' . $this->l('Assign features to this product') . '</b></td>
				</tr>
			</table>
			<hr style="width:730px;"><br />';
            // Header
            $nb_feature = Feature::nbFeatures(intval($cookie->id_lang));
            echo '
			<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:600px;">
				<tr>
					<th>' . $this->l('Features') . '</td>
					<th style="width:220px">' . $this->l('Value') . '</td>
					<th style="width:170px">' . $this->l('Customized') . '</td>
				</tr>';
            if (!$nb_feature) {
                echo '<tr><td colspan="3" style="text-align:center;">' . $this->l('No features defined') . '</td></tr>';
            }
            echo '</table>';
            // Listing
            if ($nb_feature) {
                echo '
				<table cellpadding="5" style="width:600px; margin-top:10px">';
                foreach ($feature as $tab_features) {
                    $current_item = false;
                    $custom = false;
                    $product_features = $obj->getFeatures();
                    foreach ($product_features as $tab_products) {
                        if ($tab_products['id_feature'] == $tab_features['id_feature']) {
                            $current_item = $tab_products['id_feature_value'];
                        }
                    }
                    echo '
					<tr>
						<td>' . $tab_features['name'] . '</td>
						<td style="width:220px">
							<select name="feature_' . $tab_features['id_feature'] . '_value">
							<option value="0">---&nbsp;</option>';
                    $feature_values = FeatureValue::getFeatureValues($tab_features['id_feature']);
                    foreach ($feature_values as $tab_values) {
                        if (!$tab_values['custom']) {
                            $value = FeatureValue::selectLang(FeatureValue::getFeatureValueLang($tab_values['id_feature_value']), intval($cookie->id_lang));
                            echo '<option value="' . $tab_values['id_feature_value'] . '"' . ($current_item == $tab_values['id_feature_value'] ? ' selected="selected"' : '') . '>' . substr($value, 0, 40) . (Tools::strlen($value) > 40 ? '...' : '') . '&nbsp;</option>';
                        } else {
                            $custom = true;
                        }
                    }
                    echo '
							</select>
						</td>
						<td style="width:170px">';
                    $tab_customs = array();
                    if ($custom) {
                        $tab_customs = FeatureValue::getFeatureValueLang($current_item);
                    }
                    foreach ($languages as $language) {
                        $custom_lang = FeatureValue::selectLang($tab_customs, $language['id_lang']);
                        echo '
								<div id="ccustom_' . $tab_features['id_feature'] . '_' . $language['id_lang'] . '" style="display: ' . ($language['id_lang'] == $defaultLanguage ? 'block' : 'none') . '; float: left;">
									<input type="text" name="custom_' . $tab_features['id_feature'] . '_' . $language['id_lang'] . '" size="20" value="' . htmlentities(Tools::getValue('custom_' . $tab_features['id_feature'] . '_' . $language['id_lang'], $custom_lang), ENT_COMPAT, 'UTF-8') . '" />
								</div>';
                    }
                    $this->displayFlags($languages, $defaultLanguage, $ctab, 'ccustom_' . $tab_features['id_feature']);
                    echo '
						</td>
					</tr>';
                }
                echo '
				<tr>
					<td>&nbsp;</td>
					<td style="height:50px; " valign="bottom"><input type="submit" name="submitProductFeature" id="submitProductFeature" value="' . $this->l('Update features') . '" class="button" /></td>
				</tr>';
            }
            echo '</table>
			<hr style="width:730px;">
			<div style="text-align:center;">
				<a href="index.php?tab=AdminFeatures&addfeature&token=' . Tools::getAdminToken('AdminFeatures' . intval(Tab::getIdFromClassName('AdminFeatures')) . intval($cookie->id_employee)) . '" onclick="return confirm(\'' . $this->l('Are you sure you want to delete entered product information?', __CLASS__, true, false) . '\');"><img src="../img/admin/add.gif" alt="new_features" title="' . $this->l('Create new features') . '" />&nbsp;' . $this->l('Create new features') . '</a>
			</div>';
        } else {
            echo '<b>' . $this->l('You must save this product before adding features') . '.</b>';
        }
    }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:93,代码来源:AdminProducts.php


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