12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- // by 请勿倒卖,已申请软著,否则追究法律责任
- namespace app\admin;
- class module extends Base
- {
- public function initialize()
- {
- parent::initialize();
- $this->Administrator(7);
- $this->header();
- }
- public function __destruct()
- {
- $this->footer();
- }
- function index()
- {
- ?><div class="container"><?php
- $this->nav3();
- ?><table class="tb tb2">
- <tr><th class="partition">插件列表</th></tr>
- </table>
- <table class="tb tb2">
- <?php
- global $develop_auth;
- $query = db('plugin')->where('in_type', '>', 0)->order('in_id desc')->select();
- $count = db('plugin')->where('in_type', '>', 0)->count();
- if ($count == 0) {
- ?><tr><td colspan="2" class="td27">暂无插件</td></tr><?php
- } else {
- foreach ($query as $row) {
- ?><tr class="hover hover"><td valign="top" style="width:45px"><img src="source/plugin/<?php echo $row['in_dir'];?>/preview.jpg" onerror="this.src='static/admincp/image/preview.png'" style="cursor:pointer" onclick="location.href='plugin.php/<?php echo $row['in_dir'];?>/<?php echo $row['in_file'];?>/';" width="40" height="40" align="left" /></td><td class="light" valign="top" style="width:200px"><?php echo $row['in_name'];?><br /><span class="sml"><?php echo $row['in_dir'];?></span><br /></td><td valign="bottom"><span class="light">作者: <?php echo $row['in_author'];?></span><div class="psetting"><a href="<?php echo $row['in_address'];?>" target="_blank">查看</a></div></td><td align="right" valign="bottom" style="width:160px"><?php echo $row['in_addtime'];?><br /><br /><a style="cursor:pointer" onclick="del_msg('?c=module&a=uninst&id=<?php echo $row['in_id'];?>&dir=<?php echo $row['in_dir'];?>');">卸载</a> </td></tr><?php
- }
- }
- ?></table>
- <table class="tb tb2">
- <tr><th class="partition">扩展列表</th></tr>
- </table>
- <table class="tb tb2">
- <?php
- $query = db('plugin')->where('in_type', '<', 1)->order('in_addtime desc')->select();
- $count = db('plugin')->where('in_type', '<', 1)->count();
- if ($count == 0) {
- ?><tr><td colspan="2" class="td27">暂无扩展</td></tr><?php
- } else {
- foreach ($query as $row) {
- ?><tr class="hover hover"><td valign="top" style="width:45px"><img src="source/plugin/<?php echo $row['in_dir'];?>/preview.jpg" onerror="this.src='static/admincp/image/preview.png'" width="40" height="40" align="left" /></td><td class="light" valign="top" style="width:200px"><?php echo $row['in_name'];?><br /><span class="sml"><?php echo $row['in_dir'];?></span><br /></td><td valign="bottom"><span class="light">作者: <?php echo $row['in_author'];?></span><div class="psetting"><a href="<?php echo $row['in_address'];?>" target="_blank">查看</a></div></td><td align="right" valign="bottom" style="width:160px"><?php echo $row['in_addtime'];?><br /><br /><a style="cursor:pointer" onclick="del_msg('?c=module&a=uninst&id=<?php echo $row['in_id'];?>&dir=<?php echo $row['in_dir'];?>');">卸载</a> </td></tr><?php
- }
- }
- ?></table>
- <table class="tb tb2">
- <tr><td colspan="15"><div class="fixsel"><a href="<?php echo is_ssl() ? str_replace('http://', 'https://', $develop_auth) : $develop_auth;?>">获取更多应用</a></div></td></tr>
- </table>
- </div><?php
- }
- function uninst()
- {
- $this->del_plugin($_GET['id'], $_GET['dir']);
- }
- function del_plugin($id, $dir)
- {
- if (@(include_once 'source/plugin/' . $dir . '/function.php')) {
- plugin_uninstall();
- }
- if (db('plugin')->where('in_id', $id)->delete()) {
- echo "<script type=\"text/javascript\">parent.\$('menu_app').innerHTML='" . $this->Menu_App() . "';</script>";
- destroyDir('source/plugin/' . $dir . '/');
- $this->ShowMessage("恭喜您,应用卸载成功!", "?c=module", "infotitle2", 3000, 1);
- }
- }
- }
|