簡體   English   中英

Opencart:如何在管理面板上隱藏菜單?

[英]Opencart: How to hide menus on admin panel?

我是新來的,請幫忙。

我試圖在管理面板上隱藏一些無法使用的菜單,例如重復的配置文件,屬性,制造商等。我試圖修改menu.tpl,但它沒有改變任何東西。

路徑:

admin/view/template/common/ *.tpl

這是我的管理面板上的鏈接(對於重復的配置文件):

admin/index.php?route=catalog/recurring&token=somerandomcharactershere

任何人都可以分享我需要修改的位置或文件嗎? 提前致謝! 和平了。

編輯:
例如,這是menu.tpl

<ul id="menu">
<li id="dashboard"><a href="<?php echo $home; ?>"><i class="fa fa-dashboard fa-fw"></i> <span><?php echo $text_dashboard; ?></span></a></li>
<li id="catalog"><a class="parent"><i class="fa fa-tags fa-fw"></i> <span><?php echo $text_catalog; ?></span></a>
<ul>
  <li><a href="<?php echo $category; ?>"><?php echo $text_category; ?></a>   </li>
  <li><a href="<?php echo $product; ?>"><?php echo $text_product; ?></a></li>

  <!--<li><a href="<?php echo $recurring; ?>"><?php echo $text_recurring; ?></a></li>-->

  <li><a href="<?php echo $filter; ?>"><?php echo $text_filter; ?></a></li>

  <!--<li><a class="parent"><?php echo $text_attribute; ?></a>-->

    <ul>
      <!--
      <li><a href="<?php echo $attribute; ?>"><?php echo $text_attribute; ?> </a></li>
      <li><a href="<?php echo $attribute_group; ?>"><?php echo $text_attribute_group; ?></a></li>
      -->
    </ul>


  </li>
  <!--
  <li><a href="<?php echo $option; ?>"><?php echo $text_option; ?></a></li>
  <li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li>
  <li><a href="<?php echo $download; ?>"><?php echo $text_download; ?></a></li>
  <li><a href="<?php echo $review; ?>"><?php echo $text_review; ?></a></li>
  <li><a href="<?php echo $information; ?>"><?php echo $text_information; ?></a></li>
  -->

   </ul>
   </li>
<li id="extension"><a class="parent"><i class="fa fa-puzzle-piece fa-fw"></i> <span><?php echo $text_extension; ?></span></a>
   <ul>
  <li><a href="<?php echo $installer; ?>"><?php echo $text_installer; ?></a></li>
  <li><a href="<?php echo $modification; ?>"><?php echo $text_modification; ?></a></li>
  <li><a href="<?php echo $analytics; ?>"><?php echo $text_analytics; ?></a></li>
  <li><a href="<?php echo $captcha; ?>"><?php echo $text_captcha; ?></a></li>
  <li><a href="<?php echo $feed; ?>"><?php echo $text_feed; ?></a></li>
  <li><a href="<?php echo $fraud; ?>"><?php echo $text_fraud; ?></a></li>
  <li><a href="<?php echo $module; ?>"><?php echo $text_module; ?></a></li>
  <li><a href="<?php echo $payment; ?>"><?php echo $text_payment; ?></a></li>
  <li><a href="<?php echo $shipping; ?>"><?php echo $text_shipping; ?></a></li>
  <li><a href="<?php echo $total; ?>"><?php echo $text_total; ?></a></li>
  <?php if ($openbay_show_menu == 1) { ?>
  <li><a class="parent"><?php echo $text_openbay_extension; ?></a>
        <ul>
      <li><a href="<?php echo $openbay_link_extension; ?>"><?php echo $text_openbay_dashboard; ?></a></li>
      <li><a href="<?php echo $openbay_link_orders; ?>"><?php echo $text_openbay_orders; ?></a></li>
      <li><a href="<?php echo $openbay_link_items; ?>"><?php echo $text_openbay_items; ?></a></li>
      <?php if ($openbay_markets['ebay'] == 1) { ?>
      <li><a class="parent"><?php echo $text_openbay_ebay; ?></a>
        <ul>
          <li><a href="<?php echo $openbay_link_ebay; ?>"><?php echo $text_openbay_dashboard; ?></a></li>
          <li><a href="<?php echo $openbay_link_ebay_settings; ?>"><?php echo $text_openbay_settings; ?></a></li>
          <li><a href="<?php echo $openbay_link_ebay_links; ?>"><?php echo $text_openbay_links; ?></a></li>
          <li><a href="<?php echo $openbay_link_ebay_orderimport; ?>"><?php echo $text_openbay_order_import; ?></a></li>
        </ul>
      </li>
      <?php } ?>
      <?php if ($openbay_markets['amazon'] == 1) { ?>
      <li><a class="parent"><?php echo $text_openbay_amazon; ?></a>
        <ul>
          <li><a href="<?php echo $openbay_link_amazon; ?>"><?php echo $text_openbay_dashboard; ?></a></li>
          <li><a href="<?php echo $openbay_link_amazon_settings; ?>"><?php echo $text_openbay_settings; ?></a></li>
          <li><a href="<?php echo $openbay_link_amazon_links; ?>"><?php echo $text_openbay_links; ?></a></li>
        </ul>
      </li>
      <?php } ?>
      <?php if ($openbay_markets['amazonus'] == 1) { ?>
      <li><a class="parent"><?php echo $text_openbay_amazonus; ?></a>
        <ul>
          <li><a href="<?php echo $openbay_link_amazonus; ?>"><?php echo $text_openbay_dashboard; ?></a></li>
          <li><a href="<?php echo $openbay_link_amazonus_settings; ?>"><?php echo $text_openbay_settings; ?></a></li>
          <li><a href="<?php echo $openbay_link_amazonus_links; ?>"><?php echo $text_openbay_links; ?></a></li>
        </ul>
      </li>
      <?php } ?>
      <?php if ($openbay_markets['etsy'] == 1) { ?>
      <li><a class="parent"><?php echo $text_openbay_etsy; ?></a>
        <ul>
          <li><a href="<?php echo $openbay_link_etsy; ?>"><?php echo $text_openbay_dashboard; ?></a></li>
          <li><a href="<?php echo $openbay_link_etsy_settings; ?>"><?php echo $text_openbay_settings; ?></a></li>
          <li><a href="<?php echo $openbay_link_etsy_links; ?>"><?php echo $text_openbay_links; ?></a></li>
        </ul>
        </li>
        <?php } ?>
       </ul>
        </li>
       <?php } ?>
      </ul>
       </li>
  <!--<li id="design" style="display:none;"><a class="parent"><i class="fa fa-television fa-fw"></i> <span><?php echo $text_design; ?></span></a>
   <ul>
   <li><a href="<?php echo $layout; ?>"><?php echo $text_layout; ?></a></li>
   <li><a href="<?php echo $banner; ?>"><?php echo $text_banner; ?></a></li>
    </ul>
   </li>-->
   <li id="sale"><a class="parent"><i class="fa fa-shopping-cart fa-fw"></i>     <span><?php echo $text_sale; ?></span></a>
     <ul>
  <li><a href="<?php echo $order; ?>"><?php echo $text_order; ?></a></li>

  <!--<li><a href="<?php echo $order_recurring; ?>"><?php echo $text_order_recurring; ?></a></li>-->

  <li><a href="<?php echo $return; ?>"><?php echo $text_return; ?></a></li>
  <li><a class="parent"><?php echo $text_voucher; ?></a>
    <ul>
      <li><a href="<?php echo $voucher; ?>"><?php echo $text_voucher; ?></a>         </li>
      <li><a href="<?php echo $voucher_theme; ?>"><?php echo $text_voucher_theme; ?></a></li>
      </ul>
    </li>
    <li><a class="parent"><?php echo $text_paypal ?></a>
      <ul>
      <li><a href="<?php echo $paypal_search ?>"><?php echo $text_paypal_search ?></a></li>
          </ul>
                 </li>
              </ul>
             </li>
       <li id="customer"><a class="parent"><i class="fa fa-user fa-fw"></i> <span><?php echo $text_customer; ?></span></a>
           <ul>
             <li><a href="<?php echo $customer; ?>"><?php echo $text_customer; ?></a></li>
       <li><a href="<?php echo $customer_group; ?>"><?php echo $text_customer_group; ?></a></li>
        <li><a href="<?php echo $custom_field; ?>"><?php echo $text_custom_field; ?></a></li>
            </ul>
       </li>
              <li><a class="parent"><i class="fa fa-share-alt fa-fw"></i> <span><?php echo $text_marketing; ?></span></a>
            <ul>
            <li><a href="<?php echo $marketing; ?>"><?php echo $text_marketing; ?></a></li>
         <li><a href="<?php echo $affiliate; ?>"><?php echo $text_affiliate; ?></a></li>
          <li><a href="<?php echo $coupon; ?>"><?php echo $text_coupon; ?></a></li>
             <li><a href="<?php echo $contact; ?>"><?php echo $text_contact; ?></a></li>
           </ul>
           </li>
               <li id="system"><a class="parent"><i class="fa fa-cog fa-fw"></i> <span><?php echo $text_system; ?></span></a>
             <ul>
           <li><a href="<?php echo $setting; ?>"><?php echo $text_setting; ?></a></li>
                <li><a class="parent"><?php echo $text_users; ?></a>
                <ul>
                 <li><a href="<?php echo $user; ?>"><?php echo $text_user; ?></a></li>
      <li><a href="<?php echo $user_group; ?>"><?php echo $text_user_group; ?></a></li>
      <li><a href="<?php echo $api; ?>"><?php echo $text_api; ?></a></li>
    </ul>
  </li>
  <li><a class="parent"><?php echo $text_localisation; ?></a>
    <ul>
      <li><a href="<?php echo $location; ?>"><?php echo $text_location; ?></a></li>
      <li><a href="<?php echo $language; ?>"><?php echo $text_language; ?></a></li>
      <li><a href="<?php echo $currency; ?>"><?php echo $text_currency; ?></a></li>
      <li><a href="<?php echo $stock_status; ?>"><?php echo $text_stock_status; ?></a></li>
      <li><a href="<?php echo $order_status; ?>"><?php echo $text_order_status; ?></a></li>
      <li><a class="parent"><?php echo $text_return; ?></a>
        <ul>
          <li><a href="<?php echo $return_status; ?>"><?php echo $text_return_status; ?></a></li>
          <li><a href="<?php echo $return_action; ?>"><?php echo $text_return_action; ?></a></li>
          <li><a href="<?php echo $return_reason; ?>"><?php echo $text_return_reason; ?></a></li>
        </ul>
      </li>
      <li><a href="<?php echo $country; ?>"><?php echo $text_country; ?></a></li>
      <li><a href="<?php echo $zone; ?>"><?php echo $text_zone; ?></a></li>
      <li><a href="<?php echo $geo_zone; ?>"><?php echo $text_geo_zone; ?></a></li>
      <li><a class="parent"><?php echo $text_tax; ?></a>
        <ul>
          <li><a href="<?php echo $tax_class; ?>"><?php echo $text_tax_class; ?></a></li>
          <li><a href="<?php echo $tax_rate; ?>"><?php echo $text_tax_rate; ?></a></li>
        </ul>
      </li>
      <li><a href="<?php echo $length_class; ?>"><?php echo $text_length_class; ?></a></li>
      <li><a href="<?php echo $weight_class; ?>"><?php echo $text_weight_class; ?></a></li>
    </ul>
  </li>
  <li><a class="parent"><?php echo $text_tools; ?></a>
    <ul>
      <li><a href="<?php echo $upload; ?>"><?php echo $text_upload; ?></a></li>
      <li><a href="<?php echo $backup; ?>"><?php echo $text_backup; ?></a></li>
      <li><a href="<?php echo $error_log; ?>"><?php echo $text_error_log; ?></a></li>
                </ul>
            </li>
             </ul>
                    </li>
                  <li id="reports"><a class="parent"><i class="fa fa-bar-chart-o fa-fw"></i> <span><?php echo $text_reports; ?></span></a>
                        <ul>
                <li><a class="parent"><?php echo $text_sale; ?></a>
                  <ul>
                    <li><a href="<?php echo $report_sale_order; ?>"><?php echo $text_report_sale_order; ?></a></li>
                <li><a href="<?php echo $report_sale_tax; ?>"><?php echo $text_report_sale_tax; ?></a></li>
                    <li><a href="<?php echo $report_sale_shipping; ?>"><?php echo $text_report_sale_shipping; ?></a></li>
                     <li><a href="<?php echo $report_sale_return; ?>"><?php echo $text_report_sale_return; ?></a></li>
                      <li><a href="<?php echo $report_sale_coupon; ?>"><?php echo $text_report_sale_coupon; ?></a></li>
                    </ul>
                </li>
                <li><a class="parent"><?php echo $text_product; ?></a>
                <ul>
                    <li><a href="<?php echo $report_product_viewed; ?>"><?php echo $text_report_product_viewed; ?></a></li>
                  <li><a href="<?php echo $report_product_purchased; ?>"><?php echo $text_report_product_purchased; ?></a></li>
                    </ul>
                </li>
                <li><a class="parent"><?php echo $text_customer; ?></a>
    <ul>
      <li><a href="<?php echo $report_customer_online; ?>"><?php echo $text_report_customer_online; ?></a></li>
      <li><a href="<?php echo $report_customer_activity; ?>"><?php echo $text_report_customer_activity; ?></a></li>
      <li><a href="<?php echo $report_customer_order; ?>"><?php echo $text_report_customer_order; ?></a></li>
      <li><a href="<?php echo $report_customer_reward; ?>"><?php echo $text_report_customer_reward; ?></a></li>
      <li><a href="<?php echo $report_customer_credit; ?>"><?php echo $text_report_customer_credit; ?></a></li>
    </ul>
  </li>
  <li><a class="parent"><?php echo $text_marketing; ?></a>
    <ul>
      <li><a href="<?php echo $report_marketing; ?>"><?php echo $text_marketing; ?></a></li>
      <li><a href="<?php echo $report_affiliate; ?>"><?php echo $text_report_affiliate; ?></a></li>
      <li><a href="<?php echo $report_affiliate_activity; ?>"><?php echo $text_report_affiliate_activity; ?></a></li>
               </ul>
             </li>
             </ul>
                 </li>
                   </ul>

從管理菜單隱藏重復配置文件,屬性,制造商的鏈接 -

  1. 創建新文件並復制下面的代碼。 使用擴展名.ocmod.xml保存此文件(example - hidelinks.ocmod.xml)

     <modification> <name>Remove some links from admin menu</name> <version>1.0</version> <link>test</link> <author>test</author> <code>remove_some_links_menu</code> <file path="admin/view/template/common/menu.tpl"> <operation> <search><![CDATA[<li><a href="<?php echo $recurring; ?>"><?php echo $text_recurring; ?></a></li>]]></search> <add position="replace"><![CDATA[]]></add> </operation> <operation> <search><![CDATA[<li><a class="parent"><?php echo $text_attribute; ?></a>]]></search> <add position="replace"><![CDATA[<li style="display:none;"><a class="parent"><?php echo $text_attribute; ?></a>]]></add> </operation> <operation> <search><![CDATA[<li><a href="<?php echo $manufacturer; ?>"><?php echo $text_manufacturer; ?></a></li>]]></search> <add position="replace"><![CDATA[]]></add> </operation> </file> </modification> 
  2. 轉到分機>分機安裝程序,單擊上傳按鈕並上傳保存的文件。

  3. 檢查修改列表中是否存在並啟用了擴展。 刷新緩存(擴展>修改>刷新緩存)。

刷新頁面,您將看到所有三個菜單鏈接(配置文件,屬性,制造商)都消失了。

這是使用OpenCart 2.1.x版測試的

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM