Exemple #1
0
	<?= @helper('accordion.startPane', array('id' => 'menu-pane')) ?>
		<?= @template('form_accordion', array('params' => $module->params, 'id' => 'param-page', 'title' => 'Module Parameters')) ?>

		<? if($module->params->getNumParams('advanced')) : ?>
		<?= @template('form_accordion', array('params' => $module->params, 'group' => 'advanced')) ?>
		<? endif ?>
	
		<? if($module->params->getNumParams('other')) : ?>
		<?= @template('form_accordion', array('params' => $module->params, 'group' => 'other')) ?>
		<? endif ?>
	<?= @helper('accordion.endPane') ?>
</div>
<div class="clr"></div>

<? if(!$module->type || $module->type == 'custom' || $module->type == 'mod_custom') : ?>
<fieldset class="adminform">
	<legend><?= @text('Custom Output') ?></legend>
	
	<?= @editor(array(
		'name'		=> 'content',
		//@TODO is escaping the module content really necessary?
		'content'	=> @escape($module->content),
		'height'	=> 400,
		'cols'		=> 60,
		'buttons'	=> array('pagebreak', 'readmore')
	)) ?>
</fieldset>
<? endif ?>

<input type="hidden" name="type" value="<?= $module->type ?>" />
</form>
Exemple #2
0
                <input required class="input-block-level" id="package-title" name="title" value="<?php 
echo @escape($package->title);
?>
" size="50" maxlength="255" type="text" />
            </div>
        </div>
        
        <div class="control-group">
            <label class="control-label" for="package-body">
                <?php 
echo @text('LIB-AN-ENTITY-DESCRIPTION');
?>
            </label>
            <div class="controls">
                <?php 
echo @editor(array('name' => 'body', 'content' => @escape($package->body), 'html' => array('maxlength' => '20000', 'cols' => '10', 'rows' => '5', 'class' => 'input-block-level', 'id' => 'package-body')));
?>
            </div>
        </div>
        
        <div class="control-group">
            <label class="control-label" for="package-price">
                <?php 
echo @text('COM-SUBSCRIPTIONS-PACKAGE-PRICE');
?>
            </label> 
            <div class="controls">
                <div class="input-append">
                    <input class="span2" id="package-price" required type="text" placeholder="00.00" value="<?php 
echo $package->price;
?>
 function parse_htmltext($params, $value = '')
 {
     import_func('content');
     return editor($params['name'], $value, 480);
 }
?>
" />
            <label for="slug"><?php 
echo @text('Slug');
?>
</label>
            <input class="inputbox" type="text" name="slug" id="slug" size="40" maxlength="255" value="<?php 
echo $category->slug;
?>
" placeholder="<?php 
echo @text('Slug');
?>
" /> 
        </div>
        <?php 
echo @editor(array('name' => 'description', 'editor' => null, 'width' => '100%', 'height' => '300', 'cols' => '60', 'rows' => '20', 'buttons' => true, 'options' => array('theme' => 'simple', 'pagebreak', 'readmore')));
?>
    </div>

    <div class="grid_4">
        <div class="panel">
            <h3><?php 
echo @text('Publish');
?>
</h3>
            <table class="admintable">
                <tr>
                    <td class="key">
                        <?php 
echo @text('Published');
?>
Exemple #5
0
?>
</label>
					<div class="controls">
						<?php 
echo @editor(array('name' => 'message_success', 'width' => '100%', 'buttons' => false, 'options' => array('theme' => 'simple', 'pagebreak', 'readmore')));
?>
					</div>
				</div>
				<div class="control-group">
					<label class="control-label" for="name"><?php 
echo @text('ERROR_MESSAGE');
?>
</label>
					<div class="controls">
						<?php 
echo @editor(array('name' => 'message_error', 'width' => '100%', 'buttons' => false, 'options' => array('theme' => 'simple', 'pagebreak', 'readmore')));
?>
					</div>
				</div>
			</fieldset>
			<? if($form->cck_fieldset_id) : ?>
				<fieldset>
					<legend><?php 
echo @text('FIELDS');
?>
</legend>
					<?php 
echo @service('com://admin/cck.controller.element')->cck_fieldset_id($form->cck_fieldset_id)->row($form->id)->table('wufoo_forms')->getView()->assign('row', $form)->layout('list')->display();
?>
				</fieldset>
			<? endif; ?>
Exemple #6
0
echo $_SERVER['REQUEST_URI'];
?>
" method="post">
  <input type="hidden" name="_IS_POST_BACK_" value=""/>
  <div style="margin:0 0 20px;">
    <input name="title" type="text" class="edit_textbox edit_view" style="font-size:18px;" placeholder="在此输入标题" value="<?php 
echo htmlspecialchars($page_title);
?>
"/>
  </div>
  <div style="margin-bottom:20px;">
    <?php 
require 'editor.php';
?>
    <?php 
editor($page_content);
?>
  </div>
  <div>
    <input name="path" type="text" class="edit_textbox" placeholder="在此修改固定链接" value="<?php 
echo htmlspecialchars($page_path);
?>
"/>
  </div>
  <div style="margin-bottom:20px;">
    时间:
    <select name="year">
      <option value=""></option>
<?php 
$year = substr($page_date, 0, 4);
for ($i = date("Y") - 3; $i <= date("Y") + 3; $i++) {
Exemple #7
0
</label>
			<div class="controls">
				<input id="article-title" class="input-block-level" name="title" value="" maxlength="255" type="text" required autofocus />
			</div>
		</div>
		
		<div class="control-group">
            <label class="control-label" for="article-description">
                <?php 
echo @text('COM-ARTICLES-ARTICLE-DESCRIPTION');
?>
            </label> 
            
            <div class="controls">
                <?php 
echo @editor(array('name' => 'description', 'content' => '', 'html' => array('maxlength' => '20000', 'cols' => '5', 'rows' => '5', 'class' => 'input-block-level', 'id' => 'article-description')));
?>
            </div>
        </div>
		
		<div class="control-group">
			<label class="control-label" for="article-excerpt"><?php 
echo @text('COM-ARTICLES-ARTICLE-EXCERPT');
?>
</label>
			<div class="controls">
				<input id="article-excerpt" class="input-block-level" name="excerpt" maxlength="250" type="text" required />
			</div>
		</div>
		
		<div class="control-group">
Exemple #8
0
echo $article->filename;
?>
" />&nbsp;&nbsp;设置为http://开头,将链接到指定的地址。</td></tr>
<tr><td class="label">默认模板</td><td class="input"><input type="text" class="txt" name="articletemplets" value="{style}/<?php 
echo $article->templets;
?>
" /></td></tr>
<tr><td class="label">文章内容</td><td class="input">
<textarea id="contentform" rows="1" cols="1" style="width:580px;height:360px;" name="articlecontent"><?php 
echo $article->content;
?>
</textarea>
<!-- Load TinyMCE -->
<?php 
require_once "editor.php";
editor('kindeditor', 'articlecontent');
?>
<script type="text/javascript">
	$().ready(function() {
		var formoptions = {
			beforeSubmit: function() {
				$("#submitbtn").val("正在处理...");
				$("#submitbtn").attr("disabled","disabled");
			},
            success: function (msg) {
                alert(msg);
				var now = new Date();
				$("#pubdate").val(now.format("yyyy-mm-dd HH:MM:ss"));
				$("#submitbtn").val("提交");
				$("#submitbtn").attr("disabled","");
            }
Exemple #9
0
 function send_newsletter($id)
 {
     $this->load->model('admin/settings_model');
     //$data['mail_settings']=$this->settings_model->get_email_settings();
     $mail_settings = $this->settings_model->get_email_settings();
     $this->form_validation->set_rules('subject', 'Subject', 'required|xss_clean|trim');
     $this->form_validation->set_rules('receiver_options', 'Receiver', 'required|xss_clean|trim');
     if ($this->input->post('receiver_options') == '1') {
         $this->form_validation->set_rules('receiver', 'Receiver Email', 'required|xss_clean|trim|valid_email|callback_validate_receiver');
     }
     $this->form_validation->set_rules('content', 'Content', 'required|xss_clean');
     editor();
     if ($this->form_validation->run() == FALSE) {
         $data['info'] = $this->newsletter_model->get_newsletter($id);
         $data['title'] = 'Send Newsletter';
         $data['main'] = 'admin/newsletter/send_newsletter';
         $this->load->view('admin/admin', $data);
     } else {
         if ($this->input->post('receiver_options') == '1') {
             $to = $this->input->post('receiver');
         } else {
             $receivers = $this->newsletter_model->get_receivers();
             //echo '<pre>',print_r($receivers,1),'</pre>';
             foreach ($receivers as $receiver) {
                 $emails[] = $receiver["email"];
             }
             // echo '<pre>',print_r($emails,1),'</pre>'; exit;
         }
         $mail_params = array("subject" => $this->input->post('subject'), "message" => $this->input->post('content'), "to" => $emails);
         if (send_email($mail_settings, $mail_params)) {
             $this->session->set_userdata('flash_msg_type', "success");
             $this->session->set_flashdata('flash_msg', 'Newsletter Sent Successfully.');
             redirect(ADMIN_PATH . '/newsletter/send_newsletter' . '/' . $id, 'refresh');
         } else {
             $this->session->set_userdata('flash_msg_type', "danger");
             $this->session->set_flashdata('flash_msg', "Newsletter Can't be sent. Please try again later. Click <a target='_blank' href='" . base_url('admin/error_log') . "'>here</a> to view the error log.");
             redirect(ADMIN_PATH . '/newsletter/send_newsletter' . '/' . $id, 'refresh');
         }
     }
 }
Exemple #10
0
 function write()
 {
     $_m = model('UserLogs');
     $_l = model('UserLogCat');
     if ($_POST) {
         //如果没得到id,说明提交的是添加操作
         if (empty($_POST['title'])) {
             return Swoole\JS::js_back('标题不能为空!');
         }
         Swoole\Filter::safe($_POST['content']);
         $_POST['content'] = Swoole\Filter::remove_xss($_POST['content']);
         Swoole\Filter::addslash($_POST['content']);
         $blog['title'] = $_POST['title'];
         $blog['content'] = $_POST['content'];
         $blog['c_id'] = (int) $_POST['c_id'];
         if (isset($_POST['act']) and $_POST['act'] == 'draft') {
             $blog['dir'] = 1;
         } else {
             $blog['dir'] = 0;
         }
         if (!empty($_POST['id'])) {
             //如果得到id,说明提交的是修改的操作
             $id = (int) $_POST['id'];
             $det = $_m->get($id)->get();
             if ($det['uid'] != $this->uid) {
                 exit('access deny!not your blog!');
             }
             $_m->set($id, $blog);
             if (isset($_POST['autosave'])) {
                 return 1;
             } else {
                 return Swoole\JS::js_back('修改成功', -2);
             }
         } else {
             $blog['uid'] = $this->uid;
             $bid = $_m->put($blog);
             $_l->set($blog['c_id'], array('num' => '`num`+1'));
             if (isset($_POST['autosave'])) {
                 return $bid;
             } else {
                 return Swoole\JS::js_back('添加成功');
             }
         }
     } else {
         require_once WEBPATH . '/swoole_plugin/fckeditor/Swoole.plugin.php';
         $cat = $_l->getMap(array('uid' => $this->uid), 'name');
         if (empty($cat)) {
             $cat = array();
         }
         if (!empty($_GET['id'])) {
             $id = $_GET['id'];
             $det = $_m->get($id)->get();
             Swoole\Filter::deslash($det['content']);
             $form = Swoole\Form::select('c_id', $cat, $det['c_id']);
             $this->swoole->tpl->assign('det', $det);
             $editor = editor("content", $det['content'], 480, false, false, array('empty' => '请选择日志分类'));
         } else {
             $form = Swoole\Form::select('c_id', $cat, '', false, array('empty' => '请选择日志分类'));
             $editor = editor("content", '', 480, false);
         }
         $this->swoole->tpl->assign('form', $form);
         $this->swoole->tpl->assign('editor', $editor);
         $this->swoole->tpl->display();
     }
 }
    $mid = $_SESSION['valid_user'];
    $pw = $_SESSION['pw'];
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php 
    echo $page_title;
    ?>
 - BenFund</title>
<?php 
    include $ROOT . "/includes/head.php";
    ?>
<script type="text/javascript">womOn();</script>
<?php 
    @editor(simple);
    ?>
<script type="text/javascript">
function FCKeditor_OnComplete( elm1 ){
 tb_remove();
}
</script>
<script type="text/javascript" src="https://www.benfund.com/includes/js/thickbox.js"></script>
<link rel="stylesheet" href="https://www.benfund.com/includes/css/thickbox.css" type="text/css" media="screen" />
<?php 
    include $ROOT . '/functions/page_loading.php';
    ?>
</head>
<body>
<img src="https://www.benfund.com/images/elements/blank.gif" onload="pageloading();">
<div class="container">
Exemple #12
0
<?php

date_default_timezone_set("asia/kuala_lumpur");
//require_once("./include/xhtml.php");
if ($_GET['do'] == "") {
    browser();
} else {
    if ($_GET['do'] == "editor") {
        if ($_GET['action'] == "") {
            editor();
        } else {
            if ($_GET['action'] == "load") {
                load($_GET['file']);
            } else {
                if ($_GET['action'] == "save") {
                    save($_GET['file']);
                } else {
                    if ($_GET['action'] == "download") {
                        download($_GET['file']);
                    }
                }
            }
        }
    } else {
        if ($_GET['do'] == "getfile") {
            if ($_GET['file'] == "zepto.min.js") {
                file_zepto();
            } else {
                if ($_GET['file'] == "codemirror-compressed.js") {
                    file_codemirror();
                } else {
Exemple #13
0
<tr><td class="label">SEO标题</td><td class="input"><input type="text" class="txt" name="productseotitle" /></td></tr>
<tr><td class="label">SEO关键词</td><td class="input"><input type="text" class="txt" name="productkeywords" /></td></tr>
<tr><td class="label">SEO描述</td><td class="input"><textarea class="txt" name="productdescription" style="width:200px;height:110px;"></textarea></td></tr>
<tr><td class="label">缩略图</td><td class="input"><div id="ptinfo"><input class="upfile txt" type="file" style="width:280px;" name="productthumb" /> 或者 <a href="javascript:void(0);" onclick="setinput();" style="color:#0000cc;">输入地址</a></div></td></tr>
<tr><td class="label">发布时间</td><td class="input"><input id="pubdate" type="text" class="txt" name="productadddate" value="<?php 
echo date("Y-m-d H:i:s");
?>
"  />&nbsp;&nbsp;定时发布产品,该时间为北京时间。</td></tr>
<tr><td class="label">自定义文件名</td><td class="input"><input type="text" class="txt" name="productfilename" />&nbsp;&nbsp;设置为http://开头,将链接到指定的地址。</td></tr>
<tr><td class="label">默认模板</td><td class="input"><input type="text" class="txt" name="producttemplets" value="{style}/product.tpl" /></td></tr>
<tr><td class="label">产品介绍</td><td class="input">
<textarea id="contentform" rows="1" cols="1" style="width:580px;height:360px;" name="productcontent"></textarea>
<!-- Load TinyMCE -->
<?php 
require_once "editor.php";
editor('kindeditor', 'productcontent');
?>
<script type="text/javascript">
	$().ready(function() {
		var formoptions = {
			beforeSubmit: function() {
				$("#submitbtn").val("正在处理...");
				$("#submitbtn").attr("disabled","disabled");
			},
            success: function (msg) {
                alert(msg);
				if(msg == "产品添加成功!")
				{
					$("#sform").resetForm();
					var now = new Date();
					$("#pubdate").val(now.format("yyyy-mm-dd HH:MM:ss"));
Exemple #14
0
			<td colspan="2"><input type="text" name="name" id="name" class="textinput" size="30" maxlength="80" value="<?php 
echo $EV['name'];
?>
">&nbsp;&nbsp;&nbsp;&nbsp;</td>
		</tr>
		<tr class="b" nowrap>
			<td>分类排序:</td>
			<td colspan="2"><input type="text" name="sortorder" id="sortorder" size="10" class="textinput" value="<?php 
echo $EV['sort_order'] ? $EV['sort_order'] : '0';
?>
">&nbsp;&nbsp;数值大的在前,默认为0不排序</td>
		</tr>
		<tr class="b" nowrap>
			<td>分类介绍:</td>
			<td colspan="2"><?php 
echo editor('content', $EV['content'], array('toolbar' => 'Default', 'height' => '200'));
?>
</td>
		</tr>
		<tr class="b" nowrap>
			<td>上传图片:</td>
			<!--<td width="1%"><input type="checkbox" id="isimgad" value="1" name="isimgad" onclick="isimg()"></td>-->
			<td colspan="2"><input type="file"  id="img" name="img">&nbsp;<?php 
if ($EV['img']) {
    ?>
<img src="/<?php 
    echo $EV['img'];
    ?>
"><?php 
}
?>
Exemple #15
0
" />
            <label for="slug"><?php 
echo @text('Slug');
?>
</label>
            <input class="inputbox" type="text" name="slug" id="slug" size="40" maxlength="255" value="<?php 
echo $taxonomy->slug;
?>
" placeholder="<?php 
echo @text('Slug');
?>
" />
        </div>

        <?php 
echo @editor(array('name' => 'description', 'id' => 'description', 'width' => '100%', 'height' => '391', 'cols' => '100', 'rows' => '20', 'buttons' => array('pagebreak', 'readmore')));
?>
    </div>
    <div id="panels" class="grid_4">
        <div class="panel">
            <h3><?php 
echo @text('Details');
?>
</h3>
            <table class="paramlist admintable">
                <tr>
                    <td class="paramlist_key">
                        <label><?php 
echo @text('Parent');
?>
</label>
Exemple #16
0
echo stripslashes($page->title);
?>
" size="50" maxlength="255" type="text">
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label" for="page-description">
			    <?php 
echo @text('COM-PAGES-PAGE-DESCRIPTION');
?>
			</label> 
			
			<div class="controls">
				<?php 
echo @editor(array('name' => 'description', 'content' => @escape($page->description), 'html' => array('maxlength' => '20000', 'cols' => '5', 'rows' => '5', 'class' => 'input-block-level', 'id' => 'page-description')));
?>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label" for="page-excerpt">
			    <?php 
echo @text('COM-PAGES-PAGE-EXCERPT');
?>
			</label> 
			
			<div class="controls">
				<textarea required maxlength="500" class="input-block-level" name="excerpt" cols="10" rows="5" id="page-excerpt"><?php 
echo @escape($page->excerpt);
?>
Exemple #17
0
 function admin_add()
 {
     $this->_check_cms();
     $model = createModel($this->app);
     $php = Swoole::getInstance();
     if ($_POST) {
         $this->proc_upfiles();
         if (isset($_POST['cid'])) {
             $cid = (int) $_POST['cid'];
             $cate = getCategory($cid);
             $_POST['cname'] = $cate['name'];
             $_POST['fid'] = $cate['fid'];
             $fcate = getCategory($cate['fid']);
             $_POST['fname'] = $fcate['name'];
         } elseif (isset($_POST['fid'])) {
             $fid = (int) $_POST['fid'];
             $_POST['fid'] = $fid;
             $fcate = getCategory($fid);
             $_POST['fname'] = $fcate['name'];
         }
         $_POST['uptime'] = time();
         //将远程图片本地化
         Swoole_content::image_local($_POST['content']);
         if (!empty($_POST['id'])) {
             //如果得到id,说明提交的是修改的操作
             $id = (int) $_POST['id'];
             unset($_POST['id']);
             $model->set($id, $_POST);
             Swoole_js::js_back('修改成功', -2);
             if ($php->config->cms['html_static']) {
                 if (!empty($_POST['pagename'])) {
                     $this->updatePage($_POST['pagename']);
                 } else {
                     $this->updateDetail($id);
                 }
             }
         } else {
             //如果没得到id,说明提交的是添加操作
             //if(!isset($_POST['cid']) and isset($_GET['fid'])) $_POST['cid'] = $_GET['fid'];
             $_POST['uid'] = $_SESSION['admin_user_id'];
             $_POST['uname'] = $_SESSION['admin_user']['realname'];
             $id = $model->put($_POST);
             Swoole_js::js_back('添加成功');
             if ($php->config->cms['html_static']) {
                 if (!empty($_POST['pagename'])) {
                     $this->updatePage($_POST['pagename']);
                 } else {
                     $this->updateDetail($id);
                 }
             }
         }
     } else {
         //Error::dbd();
         if (empty($_GET['fid']) and empty($_GET['cid'])) {
             $cates = getCategorys($this->app);
             $this->swoole->tpl->assign('cates', $cates);
         }
         $this->swoole->plugin->load('fckeditor');
         if (isset($_GET['id'])) {
             $id = $_GET['id'];
             $det = $model->get($id)->get();
             $editor = editor("content", $det['content'], 480);
             $this->swoole->tpl->assign('det', $det);
             $this->swoole->tpl->assign('cates', false);
         } else {
             $editor = editor("content", '', 480);
         }
         $this->swoole->tpl->assign('editor', $editor);
         $this->swoole->tpl->display('admin_' . strtolower($this->app) . '_detail.html');
     }
 }
Exemple #18
0
    ?>
  <?php 
}
?>
  <div style="margin:0 0 20px;">
    <input name="title" type="text" class="edit_textbox edit_view" style="font-size:18px;" placeholder="在此输入标题" value="<?php 
echo htmlspecialchars($post_title);
?>
"/>
  </div>
  <div style="margin-bottom:20px;">
    <?php 
require 'editor.php';
?>
    <?php 
editor($post_content);
?>
  </div>
  <div style="margin-bottom:20px;">
    <input name="tags" type="text" class="edit_textbox" placeholder="在此输入标签,多个标签之间用逗号分隔" value="<?php 
echo htmlspecialchars(implode(',', $post_tags));
?>
"/>
  </div>
  <div style="margin-bottom:20px;text-align:right">
    <div style="float:left">
    时间:
    <select name="year">
      <option value=""></option>
<?php 
$year = substr($post_date, 0, 4);
Exemple #19
0
echo @text('Published');
?>
</label>
				<?php 
echo @helper('select.booleanlist', array('name' => 'enabled', 'selected' => $member->enabled));
?>
		</fieldset>
	</div>
	<div style="width:30%;">
		<fieldset>
			<legend><?php 
echo @text('Biography');
?>
</legend>
			<?php 
echo @editor(array('row' => $member, 'name' => 'biography', 'height' => 200, 'buttons' => false, 'options' => array('mode' => 'simple')));
?>
			<script type="text/javascript">
			// get rid of the toggle editor button
			$$('.button2-left').getParent().setStyle('display', 'none');
			</script>
		</fieldset>

	</div>
	<?php 
/*
<div style="width:22%; float: left">
	<fieldset>
		<legend><?= @text('Tags'); ?></legend>
		<?= @overlay(@route('option=com_terms&view=terms&row='.$member->id.'&table=jedi_members&layout=module#terms-panel')); ?>
	</fieldset>
Exemple #20
0
 /**
  * HTML文本编辑器
  * @param $name
  * @param $value
  * @param $attrArray
  * @return unknown_type
  */
 static function htmltext($name, $value = '', $attrArray = null)
 {
     if (!isset($attrArray['height'])) {
         $attrArray['height'] = 480;
     }
     global $php;
     $php->plugin->load('fckeditor');
     return editor($name, $value, $attrArray['height']);
 }
Exemple #21
0
 function handle_entity_add($config)
 {
     if (!isset($config['model'])) {
         die('参数错误!');
     }
     if (empty($config['tpl.add'])) {
         $config['tpl.add'] = LIBPATH . '/data/tpl/admin_entity_add.html';
     }
     if (empty($config['tpl.modify'])) {
         $config['tpl.modify'] = LIBPATH . '/data/tpl/admin_entity_modify.html';
     }
     $_model = model($config['model']);
     if ($_POST) {
         $this->proc_upfiles();
         if (!empty($_POST['id'])) {
             //如果得到id,说明提交的是修改的操作
             $id = $_POST['id'];
             if ($_model->set($_POST['id'], $_POST)) {
                 JS::js_back('修改成功', -2);
                 exit;
             } else {
                 JS::js_back('修改失败', -1);
                 exit;
             }
         } else {
             //如果没得到id,说明提交的是添加操作
             if (empty($_POST['title'])) {
                 JS::js_back('标题不能为空!');
                 exit;
             }
             $id = $_model->put($_POST);
             JS::js_back('添加成功');
             exit;
         }
     } else {
         $this->swoole->plugin->load('fckeditor');
         if (isset($_GET['id'])) {
             $id = $_GET['id'];
             $news = $_model->get($id)->get();
             $editor = editor("content", $news['content'], 480);
             $this->swoole->tpl->assign('editor', $editor);
             $this->swoole->tpl->assign('news', $news);
             $this->swoole->tpl->display($config['tpl.modify']);
         } else {
             $editor = editor("content", "", 480);
             $this->swoole->tpl->assign('editor', $editor);
             $this->swoole->tpl->display($config['tpl.add']);
         }
     }
 }
Exemple #22
0
if (!empty($tag)) {
    //tag search
    showHeader('#' . $tag);
} elseif (!empty($fav)) {
    //favorites
    showHeader('Favoritos');
} else {
    showHeader('');
}
?>
		<div id="menu">
			<ul>
<?php 
if (loggedIn()) {
    echo "<a href=\"./\"><img src=\"common/home.png\"></a><li><a href=\"./?fav=1\">Meus favoritos</a></li>";
    if (editor() || admin()) {
        echo "<li><a href=\"nova_noticia.php\">Inserir notícia</a></li>";
    }
    if (admin()) {
        echo "<li><a href=\"procurar_utilizador.php\">Gerir utilizadores</a></li>" . "<li><a href=\"gerir_servidor.php\">Gerir servidores</a></li>" . "<li><a href=\"obter_noticias.php\">Obter notícias</a></li>";
    }
} else {
    echo "<li></li>";
}
echo "</ul>";
showLoginMenu();
echo "</div>";
showMessage();
if (empty($tag) && empty($fav) && empty($id)) {
    echo '<div id="search">
				<input type="text" name="search" size="75" placeholder="Introduza os termos de pesquisa..."> <input type="checkbox" name="title" checked="checked">Título <input type="checkbox" name="text">Texto <input type="checkbox" name="tag">Tag
Exemple #23
0
<?php

require_once 'common/functions.php';
require_once 'db/db.php';
if (!loggedIn() || !isset($_GET['id'])) {
    //if not logged in or no id set, go away
    die(json_encode('Operação não permitida'));
}
$id = (int) $_GET['id'];
$news_id = (int) $_GET['news_id'];
if (user() && !isCommentFromUser($id, $db) || (editor() || admin()) && !isCommentFromUser($id, $db) && !isNewsFromUser($news_id, $db)) {
    //if it's an user and the comment isn't his, or an editor/admin and the comment isn't in his news and it's not his comment, go away
    die(json_encode('Operação não permitida'));
}
$stmt = $db->prepare('DELETE FROM comment WHERE rowid= :id');
$stmt->bindparam(':id', $id);
if (!$stmt->execute()) {
    $error = $db->errorInfo();
    echo json_encode("Erro: " . $error[2]);
} else {
    echo json_encode('ok');
}
Exemple #24
0
function showNewsId($news, $db)
{
    foreach ($news as $i => $row) {
        if ($i > 0) {
            //if repeating news (because of tags)
            echo " <a href=\"./?tag=" . $row['tagname'] . "\">#" . $row['tagname'] . "</a>";
        } else {
            echo "<div class=\"noticia\" id=" . $row['id'] . ">";
            if (loggedIn()) {
                //favorites
                if (hasFavorite($row['id'], $db)) {
                    echo "<div class=\"del_favorite\" id=\"" . $row['id'] . "\"><img width=\"30px\" src=\"common/star_filled.png\">";
                } else {
                    echo "<div class=\"add_favorite\" id=\"" . $row['id'] . "\"><img width=\"30px\" src=\"common/star_empty.png\">";
                }
                echo "</div>";
            }
            echo "<h3>" . stripslashes($row['title']) . "</h3>\n\t\t\t\t<img src=\"http://lorempixel.com/300/200/\" alt=\"300x200\">\t\t\t\t\n\t\t\t\t<div class=\"newsbody\">" . nl2br(stripslashes($row['text'])) . "</div>\n\t\t\t\t<div class=\"newsdetails\">\n\t\t\t\t<br />";
            if (!empty($row['url'])) {
                //display URL if news is imported
                echo "<b>URL original:</b> <a target=\"_blank\" href=\"" . stripslashes($row['url']) . "\">" . $row['url'] . "</a><br>";
            }
            echo "<b>Submetida por:</b> " . getUserProfileLink($row['posted_by'], $db) . "<br>";
            if (!empty($row['imported_by'])) {
                echo "<b>Importada por:</b> " . getUserProfileLink($row['imported_by'], $db) . "<br>";
            }
            echo displayDate($row['date']);
            if ($row['tagname'] != "") {
                echo "</div><div class=\"newstags\"><a href=\"./?tag=" . stripslashes($row['tagname']) . "\">#" . stripslashes($row['tagname']) . "</a>";
            }
            //first tag (close news details and start tags div)
        }
        if (++$i == sizeof($news)) {
            //if next row is the end
            echo "</div>";
            echo "<div class=comment" . $row['id'] . "><h2>Comentários:</h2><div id=comments_server></div>";
            echo "</div>";
            if (isset($_SESSION['user_id'])) {
                echo "<div id=new_comment><textarea id=textarea_new_comment rows=4 placeholder=\"Novo Comentário...\"/></textarea><br><input id=send_comment type=button value=\"Enviar Comentário\"></div>";
            }
            if (loggedIn() && (editor() || admin())) {
                echo "<ul>";
                echo "<li><a href=./>Ver Todas</a></li>";
                if (loggedIn() && (admin() || editor() && ($_SESSION['username'] == $row['posted_by'] || $_SESSION['username'] == $row['imported_by']))) {
                    echo "<li><a href=\"editar_noticia.php?id=" . $row['id'] . "\">Editar</a></li><li><a href=\"apagar_noticia.php?id=" . $row['id'] . "\">Apagar</a></li>";
                }
                echo "<li style=\"border:0;\"></li>";
                //display full height <ul>
                echo "</ul>";
            }
            echo "</div>";
        }
    }
}
Exemple #25
0
function editpage()
{
    global $set, $langmessage, $selected, $pagenum, $prefix;
    print "<h2>{$langmessage['90']}</h2>\n";
    $result = dbquery('SELECT * FROM ' . $prefix . 'paginas WHERE page="' . $pagenum . '"');
    if ($row = fetch_array($result)) {
        $out = stripslashes(html_entity_decode($row['content']));
    }
    print "<form method=\"post\" action=\"\">\n<fieldset>\n";
    editor($out);
    print "\n<input  type=\"hidden\" name=\"pagenum\" value=\"" . $pagenum . "\" />\n";
    if ($_POST['extra'] == "1") {
        print savereturn("Save Page Extra");
    } else {
        print $langmessage[67] . ": <input style=\"width: 95%\" type=\"text\" name=\"description\" value=\"";
        if ($row['description'] != "") {
            print decode($row['description']);
        }
        print "\" />\n<table>\n";
        print "<tr><td>{$langmessage['160']}</td><td>";
        print "<select name=\"restricted\">\n";
        print "<option value=\"0\"";
        if ($row['restricted'] == 0 || $row['restricted'] == 1) {
            print " selected";
        }
        print ">{$langmessage['161']}</option>";
        print "<option value=\"2\"";
        if ($row['restricted'] == 2) {
            print " selected";
        }
        print ">{$langmessage['162']}</option>";
        print "<option value=\"3\"";
        if ($row['restricted'] == 3) {
            print " selected";
        }
        print ">{$langmessage['29']}</option>";
        print "<option value=\"4\"";
        if ($row['restricted'] == 4 || $row['restricted'] == 5) {
            print " selected";
        }
        print ">{$langmessage['163']}</option></select></td></tr>\n";
        print "<tr><td>{$langmessage['11']}&nbsp;</td><td><select name=\"template\">\n";
        print "<OPTION VALUE=\"\">Default</OPTION>\n";
        $folder = "templates";
        $files = filelist("/./", "templates", 1);
        foreach ($files as $file) {
            print '<OPTION VALUE="' . $file . '"';
            if (trim($file) == $row['template'] && $row['template'] != "") {
                print " SELECTED";
            }
            print '>' . $file . "&nbsp;</OPTION>\n";
        }
        print "</select></td></tr>\n";
        print "<tr><td>{$langmessage['36']}</td><td><select name=\"extra\">\n";
        $output = dbquery("SELECT id FROM " . $prefix . "extras");
        $xtras = fetch_all($output);
        print "<option value=\"0\"";
        if ($row['m3'] == 0) {
            print " SELECTED";
        }
        print ">None</option>\n";
        foreach ($xtras as $xtra) {
            print "<option value=\"" . $xtra['id'] . '"';
            if ($row['m3'] == $xtra['id']) {
                print " SELECTED";
            }
            print ">Extra " . $xtra['id'] . "</option>\n";
        }
        print "</select></td></tr>\n</table>\n";
        print savereturn("Save");
    }
}
$uid = $row['id'];
$m_type = $row['m_type'];
$name = $row['name'];
$c_name = $row['contact_name'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>BenFund - Advanced Flyer Editor</title>
<?php 
include $ROOT . "/includes/head.php";
?>
<script type="text/javascript">womOn();</script>
<?php 
@editor(simple, 900, 600);
?>
<script type="text/javascript">
function FCKeditor_OnComplete( outputtext ){
 tb_remove();
}
</script>
<script type="text/javascript" src="https://www.benfund.com/includes/js/thickbox.js"></script>
<link rel="stylesheet" href="https://www.benfund.com/includes/css/thickbox.css" type="text/css" media="screen" />
<?php 
include $ROOT . '/functions/page_loading.php';
?>
</head>
<body>
<img src="https://www.benfund.com/images/elements/blank.gif" onload="pageloading();">
<div class="container">
" />
            <label for="slug"><?php 
echo @text('Slug');
?>
</label>
            <input class="inputbox" type="text" name="slug" id="slug" size="40" maxlength="255" value="<?php 
echo $article->slug;
?>
" placeholder="<?php 
echo @text('Slug');
?>
" />
        </div>

        <?php 
echo @editor(array('name' => 'text', 'text' => $article->text, 'width' => '100%', 'height' => '300', 'cols' => '60', 'rows' => '20', 'buttons' => true, 'options' => array('theme' => 'simple', 'pagebreak', 'readmore')));
?>
    </div>
    <div id="panels" class="grid_4">
        <div class="panel">
            <h3><?php 
echo @text('Publish');
?>
</h3>
            <table class="paramlist admintable">
                <tr>
                    <td class="paramlist_key">
                        <label><?php 
echo @text('Published');
?>
</label>
echo @template('form_accordion', array('params' => $module->params, 'group' => 'other'));
?>
		<? endif ?>
	<?php 
echo @helper('accordion.endPane');
?>
</div>
<div class="clr"></div>

<? if(!$module->type || $module->type == 'custom' || $module->type == 'mod_custom') : ?>
<fieldset class="adminform">
	<legend><?php 
echo @text('Custom Output');
?>
</legend>
	
	<?php 
echo @editor(array('name' => 'content', 'content' => @escape($module->content), 'height' => 400, 'cols' => 60, 'buttons' => array('pagebreak', 'readmore')));
?>
</fieldset>
<? endif ?>

<input type="hidden" name="type" value="<?php 
echo $module->type;
?>
" />
<input type="hidden" name="client_id" value="<?php 
echo $module->client_id;
?>
" />
</form>
Exemple #29
0
                    $bEnd = true;
                    $note = "";
                    break 2;
            }
        }
    }
    if (!$bEnd && $bLogged) {
        if (!file_exists($filename)) {
            add($filename);
        }
        $page_content .= read($filename);
    }
} elseif ($bLogged && isset($_POST['editor_content']) && !empty($_POST['editor_content']) && isset($_POST['editor_note']) && !empty($_POST['editor_note'])) {
    $note = $_POST['editor_note'];
    $filename = $filePath . $note . ".txt";
    $editor_text .= editor($filename, stripslashes($_POST['editor_content']));
    $editor_visible = true;
} else {
    $note = "";
}
$page_title = $note != "" ? "QuickNote - " . $note : "QuickNote";
if (!$bLogged && !$page_content) {
    $page_content .= '<p class="error">You must be logged in</p>';
}
function editor($filename, $content = null)
{
    if ($content != null || !file_exists($filename)) {
        $editor_text = $content;
        file_put_contents($filename, $content);
    } else {
        $editor_text = file_get_contents($filename);