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


PHP CMSCategory::getSimpleCategories方法代码示例

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


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

示例1: _displayForm


//.........这里部分代码省略.........
                $parentCmsCategory = new CMSCategory((int) $parentTemp->id_cms_category, $this->context->cookie->id_lang);
                $this->_html .= '<option value="' . $parentTemp->id . '">' . $parentTemp->id . ' - ' . $parentCmsCategory->name . '</option>';
            } elseif ($parentTemp->id_product != 0) {
                $parentProduct = new Product((int) $parentTemp->id_product, false, $this->context->cookie->id_lang);
                $this->_html .= '<option value="' . $parentTemp->id . '">' . $parentTemp->id . ' - ' . $parentProduct->name . '</option>';
            } else {
                $this->_html .= '<option value="' . $parentTemp->id . '">' . $parentTemp->id . ' - ' . $parentTemp->title . '</option>';
            }
        }
        $this->_html .= '
                            </select>
                            <p class="clear">' . $this->l('Choose a parent link for your link and a dropdown will appear in the nav bar for the parent') . '.</p>
                        </div>
                    </div>
                </div>';
        // category ou non
        $this->_html .= '
                <div class="step-3">
                    <h3 class="' . (isset($responsiveLink) ? 'hidden' : '') . '">' . $this->l('Step 3 : Choose your link type') . '.</h3>
                    <div class="option ' . (isset($responsiveLink) ? 'hidden' : '') . '">
                        <label for="iscategory">' . $this->l('Is a category link?') . '</label>
                        <div class="margin-form">
                            <input type="radio" name="iscategory" class="link-choice" value="1" ' . (isset($category) ? 'checked="checked"' : '') . '>
                            <label class="t"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '"></label>
                            <input type="radio" name="iscategory" class="link-choice" value="0" ' . (isset($category) ? '' : 'checked="checked"') . '>
                            <label class="t"> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '"></label>
                        </div>
                    </div>

                    <div class="option-block ' . (isset($category) ? 'active' : '') . '">
                        <label for="category">' . $this->l('Choose your category page :') . '</label>
                        <div class="margin-form">
                            <select name="category" id="category" size="5">';
        foreach (Category::getSimpleCategories($this->context->cookie->id_lang) as $categoryTemp) {
            $this->_html .= '
                                <option value="' . $categoryTemp['id_category'] . '" ' . (isset($category) && $category->id == $categoryTemp['id_category'] ? 'selected="selected"' : '') . '>' . $categoryTemp['name'] . '</option>';
        }
        $this->_html .= '
                            </select>
                        </div>
                    </div>';
        // cms ou non
        $this->_html .= '
                    <div class="option ' . (isset($responsiveLink) ? 'hidden' : '') . '">
                        <label for="iscms">' . $this->l('Is a CMS link?') . '</label>
                        <div class="margin-form">
                            <input type="radio" name="iscms" class="link-choice" value="1" ' . (isset($cms) ? 'checked="checked"' : '') . '>
                            <label class="t"> <img src="../img/admin/enabled.gif" alt="' . $this->l('Yes') . '" title="' . $this->l('Yes') . '"></label>
                            <input type="radio" name="iscms" class="link-choice" value="0" ' . (isset($cms) ? '' : 'checked="checked"') . '>
                            <label class="t"> <img src="../img/admin/disabled.gif" alt="' . $this->l('No') . '" title="' . $this->l('No') . '"></label>
                        </div>
                    </div>

                    <div class="option-block ' . (isset($cms) ? 'active' : '') . '">
                        <label for="cms">' . $this->l('Choose your CMS page :') . '</label>
                        <div class="margin-form">
                            <select name="cms" id="cms"  size="5">';
        foreach (CMS::listCms($this->context->cookie->id_lang) as $cmsTemp) {
            $this->_html .= '
                                <option value="' . $cmsTemp['id_cms'] . '" ' . (isset($cms) && $cms->id == $cmsTemp['id_cms'] ? 'selected="selected"' : '') . '>' . $cmsTemp['meta_title'] . '</option>';
        }
        $this->_html .= '
                            </select>
                        </div>
                    </div>';
        // cms category or not
开发者ID:arozanski,项目名称:simpleresponsivetheme,代码行数:67,代码来源:responsivelinks.php


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