Warning: htmlentities(): charset `UTF-8;' not supported, assuming utf-8 in /home/eoecomau/public_html/janesjwu.com/wp-content/plugins/wp-super-cache/wp-cache-base.php on line 6

Warning: htmlentities(): charset `UTF-8;' not supported, assuming utf-8 in /home/eoecomau/public_html/janesjwu.com/wp-content/plugins/wp-super-cache/wp-cache-base.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /home/eoecomau/public_html/janesjwu.com/wp-content/plugins/wp-super-cache/wp-cache-base.php:6) in /home/eoecomau/public_html/janesjwu.com/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1196
Modification:Add To Admin Menu 添加管理账户菜单-又闻琴音

Modification:Add To Admin Menu 添加管理账户菜单

This blog is from http://www.opencart-templates.co.uk/information-modificaition-add-to-admin-menu


Lots of extensions add to the opencart menu, here’s an example modification for easy copy/paste:
很多扩展都可以添加管理账户菜单,这个修改示例可供大家简易地复制/粘贴:

– Opencart 2.3(2.3版本)
Changes to menu follows user group permissions and less changes are required 🙂
对于菜单的变动跟从用户组权限,需要较少的变动:)

<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Foo</name>
<code>foo</code>
<version>1.0.0.1</version>
<author>Opencart-Templates</author>
<link>http://www.opencart-templates.co.uk</link>

<file path="admin/controller/common/column_left.php">
<operation>
<search index="0"><![CDATA[if ($this->user->hasPermission('access', 'extension/extension')) { ]]></search>
<add position="before"><![CDATA[ if ($this->user->hasPermission('access', 'extension/foo')) {
$extension[] = array(
'name' => $this->language->get('text_foo'),
'href' => $this->url->link('extension/foo', 'token=' . $this->session->data['token'], true),
'children' => array()
);
}
]]></add>
</operation>
</file>

<file path="admin/language/en-gb/common/column_left.php">
<operation>
<search index="0"><![CDATA[<?php]]></search>
<add position="after"><![CDATA[$_['text_foo'] = 'Foo';]]></add>
</operation>
</file>
</modification>

– Pre Opencart 2.3(2.3之前版本)

<?xml version="1.0" encoding="utf-8"?>
<modification>
<name>Reviews Pro</name>
<code>review_pro</code>
<version>1.0.0.1</version>
<author>Opencart-Templates</author>
<link>http://www.opencart-templates.co.uk</link>

<file path="admin/language/english/common/menu.php">
<operation>
<search index="0"><![CDATA[$_['text_review'] = 'Reviews';]]></search>
<add position="after"><![CDATA[$_['text_review_pro'] = 'Reviews Pro';]]></add>
</operation>
</file>

<file path="admin/controller/common/menu.php">
<operation>
<search index="0"><![CDATA[$data['text_review'] = $this->language->get('text_review');]]></search>
<add position="after"><![CDATA[ $data['text_review_pro'] = $this->language->get('text_review_pro');]]></add>
</operation>
<operation>
<search index="0"><![CDATA[$data['review'] = $this->url->link('catalog/review', 'token=' . $this->session->data['token'], 'SSL');]]></search>
<add position="after"><![CDATA[ $data['review_pro'] = $this->url->link('catalog/review_pro', 'token=' . $this->session->data['token'], 'SSL');]]></add>
</operation>
</file>

<file path="admin/view/template/common/menu.tpl">
<operation>
<search index="0"><![CDATA[<li><a href="<?php echo $review; ?>"><?php echo $text_review; ?></a></li>]]></search>
<add position="before"><![CDATA[ <li><a href="<?php echo $review_pro; ?>"><?php echo $text_review_pro; ?></a></li>]]></add>
</operation>
</file>
</modification>

“>

未经允许不得转载:又闻琴音 » Modification:Add To Admin Menu 添加管理账户菜单

赞 (0) 评论 (0) 分享 ()

评论 抢沙发

评论前必须登录!