当前位置: 首页>>代码示例>>PHP>>正文


PHP check_editable函数代码示例

本文整理汇总了PHP中check_editable函数的典型用法代码示例。如果您正苦于以下问题:PHP check_editable函数的具体用法?PHP check_editable怎么用?PHP check_editable使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了check_editable函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: plugin_edit_action

function plugin_edit_action()
{
    global $vars, $_title_edit, $load_template_func;
    if (PKWK_READONLY) {
        die_message('PKWK_READONLY prohibits editing');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page, true, true);
    if (isset($vars['preview']) || $load_template_func && isset($vars['template'])) {
        return plugin_edit_preview();
    } else {
        if (isset($vars['write'])) {
            return plugin_edit_write();
        } else {
            if (isset($vars['cancel'])) {
                return plugin_edit_cancel();
            }
        }
    }
    $postdata = @join('', get_source($page));
    if ($postdata == '') {
        $postdata = auto_template($page);
    }
    return array('msg' => $_title_edit, 'body' => edit_form($page, $postdata));
}
开发者ID:KimuraYoichi,项目名称:PukiWiki,代码行数:25,代码来源:edit.inc.php

示例2: plugin_add_action

function plugin_add_action()
{
    global $get, $post, $vars, $_title_add, $_msg_add;
    if (PKWK_READONLY) {
        die_message('PKWK_READONLY prohibits editing');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page);
    $get['add'] = $post['add'] = $vars['add'] = TRUE;
    return array('msg' => $_title_add, 'body' => '<ul>' . "\n" . ' <li>' . $_msg_add . '</li>' . "\n" . '</ul>' . "\n" . edit_form($page, ''));
}
开发者ID:geoemon2k,项目名称:source_wiki,代码行数:11,代码来源:add.inc.php

示例3: plugin_add_action

function plugin_add_action()
{
    global $get, $post, $vars;
    // if (PKWK_READONLY) die_message('PKWK_READONLY prohibits editing');
    if (auth::check_role('readonly')) {
        die_message('PKWK_READONLY prohibits editing');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page);
    $get['add'] = $post['add'] = $vars['add'] = TRUE;
    return array('msg' => _("Add to \$1"), 'body' => '<ul>' . "\n" . ' <li>' . _('Two and the contents of an input are added for a new-line to the contents of a page of present addition.') . '</li>' . "\n" . '</ul>' . "\n" . edit_form($page, ''));
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:12,代码来源:add.inc.php

示例4: plugin_add_action

function plugin_add_action()
{
    global $get, $post, $vars;
    $qm = get_qm();
    if (PKWK_READONLY) {
        die_message('PKWK_READONLY prohibits editing');
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page);
    $get['add'] = $post['add'] = $vars['add'] = TRUE;
    return array('msg' => $qm->m['plg_add']['title'], 'body' => '<ul>' . "\n" . ' <li>' . $qm->m['plg_add']['note'] . '</li>' . "\n" . '</ul>' . "\n" . edit_form($page, ''));
}
开发者ID:big2men,项目名称:qhm,代码行数:12,代码来源:add.inc.php

示例5: check

 function check()
 {
     if (PKWK_READONLY) {
         die_message('PKWK_READONLY prohibits editing');
     }
     check_editable($this->page, true, true);
     if (!is_page($this->page)) {
         die_message('No such page');
     }
     if (!$this->sections->is_valid_id($this->id)) {
         die_message('Invalid id');
     }
 }
开发者ID:lolo3-sight,项目名称:wiki,代码行数:13,代码来源:secedit.inc.php

示例6: plugin_blog_edit_action

function plugin_blog_edit_action()
{
    global $vars, $load_template_func;
    $qm = get_qm();
    if (PKWK_READONLY) {
        die_message($qm->m['fmt_err_pkwk_readonly']);
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page, true, true);
    if (isset($vars['preview']) || $load_template_func && isset($vars['template'])) {
        return plugin_edit_preview();
    } else {
        if (isset($vars['write'])) {
            return plugin_edit_write();
        } else {
            if (isset($vars['cancel'])) {
                return plugin_edit_cancel();
            }
        }
    }
    $postdata = @join('', get_source($page));
    if ($postdata == '') {
        $postdata = auto_template($page);
    }
    if ($postdata == '') {
        $postdata = <<<EOD
//--------- {$qm->m['plg_blog_edit']['ntc_post_conf']} --------------
#topicpath
// {$qm->m['plg_blog_edit']['ntc_post_tag']}

//---------- {$qm->m['plg_blog_edit']['ntc_post_body']} -------------
#blog_body

{$qm->m['plg_blog_edit']['post_body']}

//--------- {$qm->m['plg_blog_edit']['ntc_post_more']} ------------------
{$qm->m['plg_blog_edit']['post_more']}



//------- {$qm->m['plg_blog_edit']['ntc_post_comment']} --------
&br;
#blog_comment
----
{$qm->m['plg_blog_edit']['post_comment']}

#comment2(textarea,10)
EOD;
    }
    return array('msg' => $qm->m['fmt_title_edit'], 'body' => edit_form($page, $postdata));
}
开发者ID:big2men,项目名称:qhm,代码行数:51,代码来源:blog_edit.inc.php

示例7: check

 function check()
 {
     $qm = get_qm();
     if (PKWK_READONLY) {
         die_message($qm->m['fmt_err_pkwk_readonly']);
     }
     check_editable($this->page, true, true);
     if (!is_page($this->page)) {
         die_message($qm->m['plg_secedit']['err_nopage']);
     }
     if (!$this->sections->is_valid_id($this->id)) {
         die_message($qm->m['plg_secedit']['err_invalid_id']);
     }
 }
开发者ID:big2men,项目名称:qhm,代码行数:14,代码来源:secedit.inc.php

示例8: plugin_edit_action

function plugin_edit_action()
{
    // global $vars, $_title_edit, $load_template_func;
    global $vars, $load_template_func;
    // if (PKWK_READONLY) die_message( _('PKWK_READONLY prohibits editing') );
    if (auth::check_role('readonly')) {
        die_message(_('PKWK_READONLY prohibits editing'));
    }
    if (PKWK_READONLY == ROLE_AUTH && auth::get_role_level() > ROLE_AUTH) {
        die_message(_('PKWK_READONLY prohibits editing'));
    }
    if (isset($vars['realview'])) {
        return plugin_edit_realview();
    }
    $page = isset($vars['page']) ? $vars['page'] : '';
    check_editable($page, true, true);
    if (!is_page($page) && auth::is_check_role(PKWK_CREATE_PAGE)) {
        die_message(_('PKWK_CREATE_PAGE prohibits editing'));
    }
    if (isset($vars['preview']) || $load_template_func && isset($vars['template'])) {
        return plugin_edit_preview();
    } else {
        if (isset($vars['write'])) {
            return plugin_edit_write();
        } else {
            if (isset($vars['cancel'])) {
                return plugin_edit_cancel();
            }
        }
    }
    $source = get_source($page);
    auth::is_role_page($source);
    $postdata = $vars['original'] = join('', $source);
    if (!empty($vars['id'])) {
        $postdata = plugin_edit_parts($vars['id'], $source);
        if ($postdata === FALSE) {
            unset($vars['id']);
            // なかったことに :)
            $postdata = $vars['original'];
        }
    }
    if ($postdata == '') {
        $postdata = auto_template($page);
    }
    return array('msg' => _('Edit of  $1'), 'body' => edit_form($page, $postdata));
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:46,代码来源:edit.inc.php

示例9: plugin_delete_action

function plugin_delete_action()
{
    global $vars, $script, $load_template_func, $style_name, $layout_pages;
    global $defaultpage;
    $qm = get_qm();
    $qt = get_qt();
    if (PKWK_READONLY) {
        die_message($qm->m['fmt_err_pkwk_readonly']);
    }
    $page = isset($vars['page']) ? $vars['page'] : $defaultpage;
    $s_page = h($page);
    $digest = md5(join('', get_source($page)));
    check_editable($page, true, true);
    if ($page === $defaultpage) {
        $body = <<<EOD
<p>
{$page}は削除できません。
</p>
EOD;
        return array('msg' => '$1の削除', 'body' => $body);
    }
    $body = <<<EOD
<p>
{$page}を削除しますか?
</p>
<form method="POST" action="{$script}">
 <div>
  <p><input type="hidden" name="plugin" value="delete" />
  <input type="hidden" name="write" value="1" />
  <input type="hidden" name="page" value="{$s_page}" />
  <input type="hidden" name="digest" value="{$digest}" />
  <input type="submit" value="実行する" />
  </p>
 </div>
</form>
EOD;
    $body .= '<hr />' . convert_html(get_source($page));
    if (isset($vars['write'])) {
        plugin_delete_write();
        redirect($defaultpage, $page . 'を削除しました');
    }
    return array('msg' => '$1の削除', 'body' => $body);
}
开发者ID:big2men,项目名称:qhm,代码行数:43,代码来源:delete.inc.php

示例10: plugin_ssl_convert

/**
*
*
*/
function plugin_ssl_convert()
{
    global $script, $script_ssl, $vars, $reg_exp_host;
    //------------ [重要かつ複雑なロジック] ----------------------------------
    // #sslと記述されたページのみ、ssl通信の対象としたいため以下のような処理をする
    // (ナビ、メニュー、ナビ2などは、通常のURLにリンクさせたい)
    //
    //   0. lib/init.php で、$script_ssl が未設定なら生成される
    //   2. 入れ替えた後は、$script_ssl によって、コンテンツ部分の様々なURLが作られる
    //   3. lib/html.php 内で、元に戻す
    //   4. naviや、menuや、pukiwiki.skin.phpで呼び出すところでは、元の$scriptが使われる
    //
    //   なるべく、ドメインを含めないURL指定を心掛けるとよいかも
    //
    // lib/html.php でSSL用の処理(HTMLコードの書き換えを実行)をするためのフラグ
    $qt = get_qt();
    $qt->setv('plugin_ssl_flag', TRUE);
    $go_ssl_url = $script_ssl . '?' . rawurlencode($vars['page']);
    // 移動を促すメッセージ
    $args = func_get_args();
    $msg = isset($args[0]) ? h($args[0]) : '暗号化されたページへ移動してください';
    // javascriptで判定して、https:に移動させる(PHPのSERVER変数が信用できないから)
    $qt->setv('jquery_include', true);
    $js_co = check_editable($vars['page'], false, false) ? '//' : '';
    $js = <<<EOD
<script type="text/javascript">
if( document.location.protocol != 'https:' ){
\t{$js_co}location.href = '{$go_ssl_url}';
\t\$(function(){
\t\t\$('div#plugin_ssl_msg').html('<a href="{$go_ssl_url}" data-target="nowin">{$msg}</a>');
\t});
}
</script>
EOD;
    $qt->appendv_once('plugin_ssl', 'beforescript', $js);
    // 外部ウインドウで開くリストから、通常ページへのURLを除外
    $p_url = parse_url(is_https() ? $script_ssl : $script);
    $reg_exp_host .= ($reg_exp_host == '' ? '' : '|') . $p_url['host'];
    return <<<EOD
<div id="plugin_ssl_msg"></div>
EOD;
}
开发者ID:big2men,项目名称:qhm,代码行数:46,代码来源:ssl.inc.php

示例11: plugin_gmapfun_convert


//.........这里部分代码省略.........
                    $f['lng'] = $geoobj['lng'];
                    $f['lat'] = $geoobj['lat'];
                }
            }
            $f['lat'] = $f['lat'] == '' ? '35.658613' : $f['lat'];
            $f['lng'] = $f['lng'] == '' ? '139.745525' : $f['lng'];
            if ($type == 'default') {
                $list_str .= '<div class="gmap_mklist_dump">';
                $list_str .= '<div class="mapmk" longdesc="' . $f['link'] . ',' . $f['lat'] . ',' . $f['lng'] . '" title="' . $f['title'] . '">' . $f['title'] . '</div>
</div>';
            } else {
                $list_str .= '<div class="gmap_mklist_fm mapmk" longdesc="' . $f['link'] . ',' . $f['lat'] . ',' . $f['lng'] . '" title="' . $f['title'] . '">';
                if ($f['img'] != '') {
                    $size = "";
                    $position = "";
                    list($width, $height) = getimagesize($f['img']);
                    $sz = PLUGIN_GMAPFUN_MARK_IMAGE_SIZE;
                    if ($width > $height) {
                        $size = ' width="' . PLUGIN_GMAPFUN_MARK_IMAGE_SIZE . '"';
                        if (PLUGIN_GMAPFUN_MARK_IMAGE_SIZE > $width) {
                            $size = ' width="' . $width . '"';
                        }
                        $position = 'top:' . (7 + (PLUGIN_GMAPFUN_MARK_IMAGE_SIZE - $height * (PLUGIN_GMAPFUN_MARK_IMAGE_SIZE / $width)) / 2) . 'px;';
                    } else {
                        $size = ' height="' . PLUGIN_GMAPFUN_MARK_IMAGE_SIZE . '"';
                        if (PLUGIN_GMAPFUN_MARK_IMAGE_SIZE > $height) {
                            $size = ' height="' . $height . '"';
                        }
                        $position = 'left:' . (7 + (PLUGIN_GMAPFUN_MARK_IMAGE_SIZE - $width * (PLUGIN_GMAPFUN_MARK_IMAGE_SIZE / $height)) / 2) . 'px;';
                    }
                    $list_str .= '<img src="' . $f['img'] . '" class="mapmk" ' . $size . ' style="' . $position . '" />';
                }
                $list_str .= '<div class="pola_title">' . $f['title'] . '</div></div>';
            }
        }
    }
    $list_str .= '<div style="clear:both;"></div>';
    $body = str_replace('<%markerlist%>', $list_str, $gmap_disp);
    if (check_editable($vars['page'], false, false)) {
        $addscript .= '
<style type="text/css">
.gmap_edit_page
{
border-radius:7px;
-ms-filter: "alpha( opacity=60 )";/* IE8 */
filter: alpha( opacity=60 );/* IE6-7 */
opacity: 0.6;
background-color: #333;
position: absolute;
bottom:5px;
left:0px;
width:90%;
padding:10px;
text-align:center;
color:#fff;
cursor:pointer;
}
</style>
<script type="text/javascript">
<!--
	$(function(){
		$("div#marker_info").click(function(){
			var url = page_exists($(this));
			if (url)
			{
				location.href = url;
			}
			return false;
		})
		.hover(
			function(){
				var url = page_exists($(this));
				if (url)
				{
					$(this).append("<div class=\\"gmap_edit_page\\">クリックするとこのページの編集ができます</div>");
				}
			},
			function(){
				$(this).children("div.gmap_edit_page").remove();
			}
		);
		
		function page_exists(obj)
		{
			var pageobj = obj.find("input:hidden[name=pagename]");
			if (pageobj.length)
			{
				var tmpurl = location.href.split("?");
				return tmpurl[0]+"?cmd=edit&page="+pageobj.val();
			}
			return false;
		}
	});
// -->
</script>
';
    }
    $qt->appendv_once('plugin_gmapfun' + $s_gmapfun_cnt, 'beforescript', $addscript);
    return $body;
}
开发者ID:big2men,项目名称:qhm,代码行数:101,代码来源:gmapfun.inc.php

示例12: plugin_list_get_commands

function plugin_list_get_commands($page)
{
    $retarr = array('read' => array('format' => '%s?%s', 'label' => '表示'), 'edit' => array('format' => '%s?cmd=edit&page=%s', 'label' => '編集'), 'diff' => array('format' => '%s?cmd=diff&page=%s', 'label' => '差分'), 'backup' => array('format' => '%s?cmd=backup&page=%s', 'label' => 'バックアップ'), 'rename' => array('format' => '%s?cmd=rename&refer=%s', 'label' => '名前変更'), 'delete' => array('format' => '%s?cmd=delete&page=%s', 'label' => '削除'), 'map' => array('format' => '%s?cmd=map&refer=%s', 'label' => 'マップ'), 'template' => array('format' => '%s?cmd=template&refer=%s', 'label' => '複製'));
    if (PKWK_READONLY) {
        return array('read' => $retarr['read']);
    }
    if (!ss_admin_check()) {
        unset($retarr['diff'], $retarr['backup'], $retarr['rename'], $retarr['map'], $retarr['template']);
        if (!check_editable($page, FALSE, FALSE)) {
            unset($retarr['edit']);
        }
    }
    return $retarr;
}
开发者ID:big2men,项目名称:qhm,代码行数:14,代码来源:list.inc.php

示例13: plugin_qblog_comment_convert

function plugin_qblog_comment_convert()
{
    global $script, $vars, $digest, $username;
    global $qblog_defaultpage, $qblog_comment_check, $qblog_enable_comment;
    static $called = FALSE;
    $page = $vars['page'];
    if (PKWK_READONLY) {
        return '';
    }
    // Show nothing
    if ($called) {
        return '';
    }
    // Only once
    $called = TRUE;
    //QBlog ページ以外設置不可
    if ($page === $qblog_defaultpage or !is_qblog()) {
        return '';
    }
    if (isset($qblog_enable_comment) && !$qblog_enable_comment) {
        return '';
    }
    $editable = check_editable($qblog_defaultpage, FALSE, FALSE);
    $qt = get_qt();
    $qt->setv('jquery_include', TRUE);
    $qm = get_qm();
    // TODO: remove
    // !既存のコメントを出力
    $comments = array();
    if (file_exists(CACHEQBLOG_DIR . encode($page) . '.qbcm.dat')) {
        $comments = unserialize(file_get_contents(CACHEQBLOG_DIR . encode($page) . '.qbcm.dat'));
    }
    if (count($comments) > 0) {
        foreach ($comments as $i => $comment) {
            if (!$comment['show']) {
                unset($comments[$i]);
                continue;
            }
            $cnt = $i + 1;
            if ($editable or $comment['accepted']) {
                $comment['msg'] = h($comment['msg']);
                //他のコメントにレスができる
                $comment['msg'] = preg_replace('/(&gt;&gt;|※)(\\d+)/', '<a href="#qbcomment_$2">$1$2</a>', $comment['msg']);
                $comment['msg'] = nl2br($comment['msg']);
                //URLをリンクに
                $ptns = array('/(?:https?|ftp)(?::\\/\\/[-_.!~*\'()a-zA-Z0-9;\\/?:\\@&=+\\$,%#]+)/');
                $rpls = array('<a href="$0">$0</a>');
                $comment['msg'] = preg_replace($ptns, $rpls, $comment['msg']);
                $comments[$i]['msg'] = $comment['msg'];
            }
        }
    }
    //認証コード生成
    $authcode = '' . rand(0, 9) . rand(0, 9) . rand(0, 9) . rand(0, 9);
    $action = $script . '?' . rawurlencode($page);
    $name = '';
    if ($editable) {
        $name = $username === $_SESSION['usr'] ? '管理人' : $_SESSION['usr'];
    }
    $name = isset($vars['name']) ? $vars['name'] : $name;
    $title = isset($vars['title']) ? $vars['title'] : '';
    $msg = isset($vars['msg']) ? $vars['msg'] : '';
    // !エラー処理
    $auth_err = $title_err = $name_err = FALSE;
    if (isset($vars['qblog_comment_auth_error'])) {
        $auth_err = $vars['qblog_comment_auth_error'];
    }
    if (isset($vars['qblog_comment_title_error'])) {
        $title_err = $vars['qblog_comment_title_error'];
    }
    if (isset($vars['qblog_comment_name_error'])) {
        $name_err = $vars['qblog_comment_name_error'];
    }
    ob_start();
    include PLUGIN_DIR . 'qblog/comment_template.html';
    $html = ob_get_clean();
    return $html;
}
开发者ID:big2men,项目名称:qhm,代码行数:78,代码来源:qblog_comment.inc.php

示例14: plugin_qblog_list_convert

function plugin_qblog_list_convert()
{
    global $vars, $qblog_date_format, $show_passage;
    global $qblog_page_prefix, $qblog_defaultpage, $qblog_page_format, $qblog_close;
    global $style_name;
    //閉鎖中は何も表示しない
    if ($qblog_close && !ss_admin_check()) {
        return '';
    }
    static $exec_count = 1;
    $qm = get_qm();
    $qt = get_qt();
    $qt->setv('jquery_include', TRUE);
    $list_type = PLUGIN_QBLOG_LIST_TYPE;
    $recent_posts = PLUGIN_QBLOG_LIST_DEFAULT_POSTS;
    if (func_num_args()) {
        $args = func_get_args();
        if (count($args) > 2) {
            return '#qblog_list([line or table], [number])';
        }
        foreach ($args as $arg) {
            if (is_numeric($arg)) {
                $recent_posts = (int) $arg;
            }
            if ($arg == 'line') {
                $list_type = $arg;
            }
        }
    }
    //表示モード
    //recent, archives, category
    $mode = isset($vars['mode']) ? $vars['mode'] : 'recent';
    //表示ページ:ページネーション
    //表示ページは必ず 1以上の整数
    $page_num = isset($vars['p']) ? (int) $vars['p'] : 1;
    $page_num = $page_num <= 0 ? 1 : $page_num;
    // !前処理
    if (!is_bootstrap_skin()) {
        $include_bs = '
<link rel="stylesheet" href="skin/bootstrap/css/bootstrap-custom.min.css" />
<script type="text/javascript" src="skin/bootstrap/js/bootstrap.min.js"></script>';
        $qt->appendv_once('include_bootstrap_pub', 'beforescript', $include_bs);
    }
    //qblog.css を読み込む
    $head = '
<link rel="stylesheet" href="plugin/qblog/qblog.css" />';
    $qt->appendv_once('qblog_beforescript', 'beforescript', $head);
    //---- キャッシュのための処理を登録 -----
    $qt->enable_cache = FALSE;
    //------------------------------------
    if (!file_exists(PLUGIN_QBLOG_LIST_CACHE)) {
        return $qm->m['plg_recent']['err_file_notfound'] . '<br />';
    }
    $script = get_script_uri();
    $date = $items = '';
    //h2.title 前に挿入するHTML
    $pre_title_html = '';
    // !新規記事追加リンクを表示
    // デフォルトブログページが編集できるユーザー
    $editable = FALSE;
    if (check_editable($qblog_defaultpage, FALSE, FALSE) === TRUE) {
        $editable = TRUE;
        $search_replace = array('YYYY' => date('Y'), 'MM' => date('m'), 'DD' => date('d'));
        $newpage = str_replace(array_keys($search_replace), array_values($search_replace), $qblog_page_format);
        $number_holder_pos = strpos($newpage, '#');
        if ($number_holder_pos !== FALSE) {
            $filename_prefix = encode(substr($newpage, 0, $number_holder_pos));
            $files = glob(DATA_DIR . $filename_prefix . '*');
            $pattern = '/^(' . str_replace('#', '(\\d+)', preg_quote($newpage)) . ')$/';
            $max = 1;
            foreach ($files as $file) {
                $pagename = decode(basename($file, '.txt'));
                if (preg_match($pattern, $pagename, $mts)) {
                    $max = max($mts[2], $max);
                }
            }
            $newpage = str_replace('#', $max + 1, $newpage);
        }
        $addpostlink = $script . '?cmd=qblog&mode=addpost';
        $pre_title_html .= '<a href="' . h($addpostlink) . '" class="badge badge-info" style="color:#fff"><i class="icon-white icon-edit" style="vertical-align:text-bottom;"></i> 記事の追加</a> ';
    }
    // !モードによって、読み込むキャッシュを替える
    $pages = array();
    $start = ($page_num - 1) * $recent_posts;
    $addquery = '';
    switch ($mode) {
        case 'archives':
            $date = $vars['date'];
            $addquery = '&mode=archives&date=' . rawurlencode($date);
            if (preg_match('/^(\\d{4})(\\d{2})$/', $date, $mts)) {
                $year = $mts[1];
                $month = $mts[2];
            } else {
                $year = date('Y');
                $month = date('m');
            }
            $date = $year . $month;
            $files = glob(DATA_DIR . encode($qblog_page_prefix . $date) . '*');
            foreach ($files as $file) {
                $pages[] = decode(basename($file, '.txt'));
//.........这里部分代码省略.........
开发者ID:big2men,项目名称:qhm,代码行数:101,代码来源:qblog_list.inc.php

示例15: plugin_table_edit2_action

function plugin_table_edit2_action()
{
    global $vars, $post, $auth_users, $_string;
    $table_num = $vars['table_num'];
    $page = isset($vars['refer']) ? $vars['refer'] : null;
    if (empty($page)) {
        Utility::dieMessage('Page name is null.');
    }
    $wiki = Factory::Wiki($page);
    if (is_freeze($page)) {
        check_editable($page, true, true);
    }
    if ($wiki->isFreezed()) {
        $wiki->checkEditable(true);
    }
    //	Cancel
    $anchr_jump = PLUGIN_TABLE_EDIT2_ANCHR_JUMP ? '#TableEdit2TableNumber' . $table_num : '';
    if (isset($vars['cancel'])) {
        Utility::redirect($wiki->uri() . $anchr_jump);
        exit;
    }
    $line_count = 1;
    $table_sub_num = 1;
    //td
    $table_sub_num_chk = 1;
    //td
    $setting = 0;
    $import = $export = $csv_cancel = 0;
    $edit_mod = isset($vars['edit_mod']) ? $vars['edit_mod'] : '';
    $td_edit = $edit_mod == 't_edit_td' || $edit_mod == 'td' ? 1 : 0;
    $tr_edit = $edit_mod == 't_edit' || $edit_mod == 'tr' ? 1 : 0;
    $t_edit = $edit_mod == 't_edit_td' || $edit_mod == 't_edit' ? 1 : 0;
    $edit_show = $edit_mod == 'tdshow' || $edit_mod == 'show' ? 1 : 0;
    // Petit SPAM Check (Client(Browser)-Server Ticket Check)
    $spam = FALSE;
    if (!function_exists('honeypot_write') && $t_edit) {
        $spam = plugin_table_edit2_spam($post['encode_hint']);
    }
    if ($spam) {
        return plugin_table_edit2_honeypot();
    }
    if (Auth::check_role('readonly')) {
        die_message('PKWK_READONLY prohibits editing');
    }
    if (PLUGIN_TABLE_EDIT2_HTTP_REFERER) {
        if (!function_exists('path_check')) {
            if (!preg_match('/^(' . $script_uri . ')/', $_SERVER['HTTP_REFERER'])) {
                return;
            }
        } else {
            if (!path_check($script_uri, $_SERVER['HTTP_REFERER'])) {
                return;
            }
        }
    }
    if ($edit_mod === 'setting') {
        $set = new TableEdit2SettingWrite($vars);
        if (!$set->sc) {
            return $set->error;
        }
        $setting = 1;
        unset($vars['table_mod']);
    }
    $notimestamp = FALSE;
    if (isset($vars['csv_mod']) || isset($vars['ex_cancel']) || isset($vars['im_cancel']) || isset($vars['set_csv']) || isset($vars['csv_back'])) {
        $csv = new TableEdit2CsvAction();
        if (isset($vars['csv_mod']) && $vars['csv_mod'] === 'import') {
            $csv->csv_import($vars);
            $import = 1;
        } else {
            if (isset($vars['csv_mod']) && $vars['csv_mod'] === 'export') {
                $export = 1;
                $csv_export_data = array();
            } else {
                if (isset($vars['ex_cancel']) || isset($vars['im_cancel'])) {
                    $csv_cancel = 1;
                    $notimestamp = TRUE;
                } else {
                    if (isset($vars['set_csv'])) {
                        $set_csv = 1;
                        $notimestamp = TRUE;
                    } else {
                        if (isset($vars['csv_back'])) {
                            if (PLUGIN_TABLE_EDIT2_CSV_UNLINK) {
                                $con = new TableEdit2CsvConversion($page, array('name' => $vars['file_name']));
                                unlink($con->filename);
                                unlink($con->logname);
                            }
                            Utility::redirect($wiki->uri());
                            exit;
                        } else {
                            return array('msg' => 'csv error', 'body' => 'csv option error');
                            // . join("\n", $csv_data)
                        }
                    }
                }
            }
        }
    }
    if (isset($vars['table_mod'])) {
//.........这里部分代码省略.........
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:101,代码来源:table_edit2.inc.php


注:本文中的check_editable函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。