Example #1
0
 public function edit_info()
 {
     $this->theme->setBreadcrumb("编辑信息");
     $this->theme->setTitle("编辑信息");
     $this->theme->header_add($this->theme->css(get_bootstrap_plugin_url("markdown/markdown.min.css")));
     $this->theme->header_add($this->theme->js(['src' => get_bootstrap_plugin_url("markdown/markdown.js")]));
     $this->__view("User/header.php");
     $this->__view("User/edit_info.php");
     $this->__view("User/footer.php");
 }
Example #2
0
 public function edit_gallery()
 {
     lib()->load('Gallery');
     $gallery = new Gallery(req()->_plain()->get('id'), login_user()->getId());
     $this->theme->setBreadcrumb("编辑图集");
     $this->theme->setTitle("编辑图集信息");
     $this->theme->header_add($this->theme->css(get_bootstrap_plugin_url("markdown/markdown.min.css")));
     $this->theme->header_add($this->theme->js(['src' => get_bootstrap_plugin_url("markdown/markdown.js")]));
     $this->__view("User/header.php");
     $this->__view("Photo/edit_gallery.php", ['info' => $gallery->getInfo(), 'gallery' => $gallery]);
     $this->__view("User/footer.php");
 }
Example #3
0
 public function view()
 {
     $this->__lib('Message');
     $mg = new \ULib\Message();
     $req = req()->_plain();
     $data = ['content' => '', 'error' => ''];
     try {
         $data['content'] = $mg->read($req->req('id'), login_user()->getId());
         $this->theme->header_add($this->theme->css(get_bootstrap_plugin_url("markdown/markdown.min.css")));
         $this->theme->header_add($this->theme->js(['src' => get_bootstrap_plugin_url("markdown/markdown.js")]));
         $this->theme->header_add($this->theme->js(['src' => get_style("message_action.js")]));
     } catch (\Exception $ex) {
         $data['error'] = $ex->getMessage();
     }
     $this->theme->setBreadcrumb("查看消息");
     $this->theme->setTitle("查看消息");
     $this->__view("User/header.php");
     $this->__view("Message/view.php", $data);
     $this->__view("User/footer.php");
 }
Example #4
0
 public function edit()
 {
     l_h('html_tag.php');
     $this->theme->setBreadcrumb("编辑文章");
     $this->theme->setTitle("编辑文章");
     $id = intval(req()->get('id'));
     $this->__lib('Post');
     $post = new Post($id);
     $info = $post->getInfo(login_user()->getId());
     $this->theme->header_add($this->theme->css(get_bootstrap_plugin_url("markdown/markdown.min.css")));
     $this->theme->header_add($this->theme->js(['src' => get_bootstrap_plugin_url("markdown/markdown.js")]));
     if (!isset($info['post_id']) || $info['post_id'] != $id) {
         $this->__view("User/header.php");
         $this->__view("Posts/not_found.php");
     } else {
         $this->__view("User/header.php");
         $this->__view("Posts/edit.php", ['info' => $info, 'post' => $post]);
     }
     $this->__view("User/footer.php");
 }
Example #5
0
			})
			.appendTo("head");
		$("#MessageSendForm").ajaxForm(function (data) {
			if (data['status']) {
				modal_show("<span class='text-warning'>发送状态!</span>",
					"<div><p class='text-success'>成功发送给:" + data['content']['ok'] + " 个用户</p>" +
						(data['content']['error'] > 0 ? "<p class='text-danger'>" + data['content']['error'] + " 个用户发送失败</p>" : "") +
						"<p>详情查看发信箱。</p></div>"
				);
				markdown_edit.setContent("");
			} else {
				alert_error(data['msg'], "发送错误!");
			}
		});
		$.getScript('<?php 
echo get_bootstrap_plugin_url('markdown/markdown.js');
?>
', function () {
			$("#InputContent").markdown({
				onShow: function (e) {
					markdown_edit = e;
				}, onPreview: function (e) {
					var previewContent;
					var originalContent = e.getContent();
					var status = $.ajaxSettings.async;
					$.ajaxSetup({
						async: false
					});
					$.post(SITE_URL + "UserApi/markdown", {content: originalContent}, function (data) {
						if (data['status']) {
							previewContent = data['content'];