Opencart:如何隐藏管理面板上的菜单?

Opencart: How to hide menus on admin panel?

我对此很陌生,请帮忙。

我试图在管理面板上隐藏一些不可用的菜单,例如重复配置文件、属性、制造商等。我试图修改 menu.tpl 但它没有任何改变。

路径:

admin/view/template/common/ *.tpl

这是我管理面板上的 link(用于重复配置文件):

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 保存此文件(示例 - 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