/** * 激活插件方法,如果激活失败,直接抛出异常 * * @access public * @return string * @throws Typecho_Plugin_Exception */ public static function activate() { $info = HighSlide_Plugin::galleryinstall(); Helper::addPanel(3, 'HighSlide/manage-gallery.php', _t('页面相册'), _t('配置页面相册 <span style="color:#999;">(HighSlide全功能版核心支持)</span>'), 'administrator'); Helper::addAction('gallery-edit', 'HighSlide_Action'); Typecho_Plugin::factory('Widget_Archive')->header = array('HighSlide_Plugin', 'headlink'); Typecho_Plugin::factory('Widget_Archive')->footer = array('HighSlide_Plugin', 'footlink'); Typecho_Plugin::factory('Widget_Abstract_Contents')->contentEx = array('HighSlide_Plugin', 'autohighslide'); Typecho_Plugin::factory('Widget_Abstract_Contents')->excerptEx = array('HighSlide_Plugin', 'autohighslide'); Typecho_Plugin::factory('admin/write-post.php')->bottom = array('HighSlide_Plugin', 'jshelper'); Typecho_Plugin::factory('admin/write-page.php')->bottom = array('HighSlide_Plugin', 'jshelper'); Typecho_Plugin::factory('admin/write-post.php')->option = array('HighSlide_Plugin', 'uploadpanel'); return _t($info); }
?> </div> <ul id="file-list"></ul> </div> </div> <div id="tab-forms"><?php HighSlide_Plugin::form()->render(); ?> </div> <?php } else { ?> <div id="tab-settings" class="typecho-content-panel"> <?php HighSlide_Plugin::form('sync', '2')->render(); ?> </div><!-- end #tab-advance --> <?php } ?> </div> </div> </div> </div> <?php include 'copyright.php'; include 'common-js.php';
/** * 执行裁切图片 * * @access public * @return void */ public function cropthumbnail() { $imgname = $this->request->from('imgname'); $w = $this->request->from('w'); $h = $this->request->from('h'); $x1 = $this->request->from('x1'); $y1 = $this->request->from('y1'); //获取附件源参数 $path = $this->request->from('path'); $url = $this->request->from('url'); if ($imgname) { $result = HighSlide_Plugin::crophandle($imgname['imgname'], $w['w'], $h['h'], $x1['x1'], $y1['y1'], $path['path'], $url['url']); $this->response->throwJson(array('bytes' => number_format(ceil($result / 1024)) . ' Kb')); } $this->response->throwJson(false); }