예제 #1
0
파일: login.php 프로젝트: dalinhuang/zotop
 public function actionShortcut()
 {
     $title = zotop::get('title');
     $url = zotop::get('url');
     $shortcut = "[InternetShortcut]\nURL=" . $url . "\nIDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2";
     header("Content-type: application/octet-stream");
     header("Content-Disposition: attachment; filename=" . $title . ".url;");
     echo $shortcut;
 }
예제 #2
0
 public function actionAdd()
 {
     $category = zotop::model('blog.category');
     $referer = zotop::get('referer');
     $referer = empty($referer) ? zotop::url('blog/category/index') : $referer;
     if (form::isPostBack()) {
         $post = form::post();
         $category->insert($post);
         if (!$category->error()) {
             msg::success('保存成功', $referer);
         }
         msg::error($category->msg());
     }
     $data['id'] = $category->max('id') + 1;
     $data['order'] = $data['id'];
     $page = new dialog();
     $page->set('title', '添加分类');
     $page->set('referer', $referer);
     $page->set('data', $data);
     $page->display();
 }
예제 #3
0
파일: file.php 프로젝트: dalinhuang/zotop
 public function actionEdit($file = '')
 {
     $file = empty($file) ? zotop::get('file') : $file;
     $file = trim(url::decode($file), '/');
     $filepath = ZOTOP_PATH_ROOT . DS . str_replace('/', DS, $file);
     if (form::isPostBack()) {
         $content = request::post('source');
         $content = trim($content);
         if (empty($content)) {
             msg::error('内容为空,无法保存!');
         }
         file::write($filepath, trim($content));
         msg::success('内容保存成功!');
     }
     $filecontent = file::read($filepath);
     $page = new dialog();
     $page->title = '文件编辑器';
     $page->set('file', $file);
     $page->set('filepath', $filepath);
     $page->set('filecontent', $filecontent);
     $page->display();
 }
예제 #4
0
파일: index.php 프로젝트: dalinhuang/zotop
 public function actionIndex($dir = '')
 {
     $dir = empty($dir) ? zotop::get('dir') : $dir;
     $dir = url::decode($dir);
     $path = ZOTOP_PATH_ROOT . DS . trim($dir, DS);
     $path = path::clean($path);
     //获取当前目录的子目录及子文件
     $folders = (array) folder::folders($path);
     $files = (array) folder::files($path);
     $position = '<a href="' . zotop::url('webftp/index/index') . '">root</a>';
     $dirs = arr::dirpath($dir, '/');
     foreach ($dirs as $d) {
         $position .= ' <em>/</em> <a href="' . zotop::url('webftp/index/index', array('dir' => rawurlencode($d[1]))) . '">' . $d[0] . '</a>';
     }
     $page = new page();
     $page->title = '文件管理器';
     $page->set('position', $position);
     $page->set('navbar', $this->navbar($dir));
     $page->set('folders', $folders);
     $page->set('files', $files);
     $page->set('path', $path);
     $page->set('dir', $dir);
     $page->display();
 }
예제 #5
0
 public function actionDelete($file)
 {
     $file = empty($file) ? zotop::get('file') : $file;
     $file = trim(url::decode($file), '/');
     $filepath = site::template($file);
     if (file::delete($filepath)) {
         msg::success('删除成功', url::referer());
     }
     msg::error('删除失败');
 }
예제 #6
0
파일: side.php 프로젝트: dalinhuang/zotop
?>
" target="mainIframe">待审核</a></li>
		<li><span class="zotop-icon zotop-icon-draft"></span><a href="<?php 
echo zotop::url('content/content/draft');
?>
" target="mainIframe">草稿箱</a></li>
		<li><span class="zotop-icon zotop-icon-recycle"></span><a href="<?php 
echo zotop::url('content/content/recycle');
?>
" target="mainIframe">回收站</a></li>
	
	</ul>
</div>
<?php 
box::footer();
box::header();
?>
	<form class="smallsearch" target="mainIframe" method="get" action="<?php 
echo zotop::url('content/content/index');
?>
">
		<input type="text" name="keywords" class="text" value="<?php 
echo zotop::get('keywords');
?>
" title="请输入关键词进行搜索"/>
		<button type="submit"><span class="zotop-icon zotop-icon-search button-icon"></span></button>
	</form>
<?php 
box::footer();
$this->bottom();
$this->footer();
예제 #7
0
 public function actionSave()
 {
     $content = zotop::model('content.content');
     if (form::isPostBack()) {
         $post = form::post();
         $return = zotop::get('return');
         $status = zotop::get('status');
         if (is_numeric($status)) {
             $post['status'] = $status;
         }
         $content->save($post);
         if (!$content->error()) {
             msg::success('保存成功', $return);
         }
         msg::error($content->msg());
     }
     return true;
 }