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


PHP cmsUser::getCsrfToken方法代码示例

本文整理汇总了PHP中cmsUser::getCsrfToken方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::getCsrfToken方法的具体用法?PHP cmsUser::getCsrfToken怎么用?PHP cmsUser::getCsrfToken使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsUser的用法示例。


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

示例1: applet_robots

function applet_robots() {
    global $_LANG;
    global $adminAccess;
    
    if (!cmsUser::isAdminCan('admin/robots', $adminAccess)) { cpAccessDenied(); }
    
    cmsCore::c('page')->setTitle($_LANG['ROBOTS_TITLE']);

    cpAddPathway($_LANG['ROBOTS_TITLE']);

    $do = cmsCore::request('do', array('edit', 'save'), 'edit');

    if (!file_exists(PATH .'/robots.txt')) {
        $fp = fopen(PATH .'/robots.txt', 'w');
        fwrite($fp, str_replace(array('%domen%', '%host%'), array(str_replace(array('https://', 'http://'), '', cmsCore::c('config')->host), cmsCore::c('config')->host), file_get_contents(PATH .'/includes/default_robots.txt')));
        fclose ($fp);
        chmod(PATH .'/robots.txt', 0777);
    }

    if ($do == 'save') {
        if (!cmsUser::checkCsrfToken()) { cmsCore::error404(); }

        $data = cmsCore::request('robots', 'str');
        
        $fp = fopen(PATH .'/robots.txt', 'w');
        fwrite($fp, stripcslashes($data) ."\n");
        fclose ($fp);
    }

    $robots = file_get_contents(PATH .'/robots.txt');
?>
<form action="" method="post">
    <div style="width:650px;">
        <input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
        
        <div class="form-group">
            <label><?php echo $_LANG['ROBOTS_TXT_DATA']; ?></label>
            <textarea name="robots" class="form-control" style="height: 400px;"><?php echo $robots; ?></textarea>
            <div class="help-block"><?php echo $_LANG['ROBOTS_TXT_INFO']; ?></div>
        </div>
        
        <input type="hidden" name="do" value="save" />
        
        <input type="submit" class="btn btn-primary" name="save" value="<?php echo $_LANG['SAVE']; ?>" />
        <input type="button" class="btn btn-default" name="back" value="<?php echo $_LANG['CANCEL']; ?>" onclick="window.history.back();" />
    </div>
</form>
<?php
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:49,代码来源:robots.php

示例2: applet_menu


//.........这里部分代码省略.........
        }

        $cfg['menu'] = $menu;
        $cfg_str = cmsCore::arrayToYaml($cfg);

        $sql = "INSERT INTO cms_modules (position, name, title, is_external, content, ordering, showtitle, published, user, config, css_prefix, access_list)
                VALUES ('". $position ."', '". $_LANG['AD_MENU'] ."', '". $title ."', 1, 'mod_menu', ". $maxorder .", 1, ". $published .", 0, '". $cfg_str ."', '". $css_prefix ."', '". $access_list ."')";

        cmsCore::c('db')->query($sql) ;

        $newid = cmsCore::c('db')->get_last_id('cms_modules');

        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'] , 'success');

        cmsCore::redirect('?view=modules&do=edit&id='.$newid);

    }

    if ($do == 'addmenu' || $do == 'add' || $do == 'edit') {
        cmsCore::c('page')->addHeadJS('admin/js/menu.js');
        echo '<script>';
        echo cmsPage::getLangJS('AD_SPECIFY_LINK_MENU');
        echo '</script>';
    }

    if ($do == 'addmenu') {
        cmsCore::c('page')->setTitle($_LANG['AD_MENU_ADD']);
        cpAddPathway($_LANG['AD_MENU_ADD']);

        $menu_list = cpGetList('menu');

?>
<form id="addform" name="addform" action="index.php?view=menu&do=submitmenu" method="post">
    <input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
            
    <div class="panel panel-default" style="width:650px;">
        <div class="panel-body">
            <div class="form-group">
                <label><?php echo $_LANG['AD_MODULE_MENU_TITLE']; ?></label>
                <input type="text" id="title2" class="form-control" name="title" style="width:99%" value="" />
            </div>

            <div class="form-group">
                <label><?php echo $_LANG['AD_MENU_TO_VIEW']; ?></label>
                <select id="menu" class="form-control" name="menu" style="width:99%">
                    <?php foreach ($menu_list as $menu) { ?>
                        <option value="<?php echo $menu['id']; ?>">
                            <?php echo $menu['title']; ?>
                        </option>
                    <?php } ?>
                </select>
                <div class="help-block"><?php echo $_LANG['AD_TO_CREATE_NEW_POINT']; ?></div>
            </div>
                    
            <div class="form-group">
                <label><?php echo $_LANG['AD_POSITION_TO_VIEW']; ?></label>
                <?php
                    $pos = cpModulePositions(cmsConfig::getConfig('template'));
                ?>
                <select id="position" class="form-control" name="position" style="width:99%">
                    <?php
                        if ($pos){
                            foreach($pos as $key=>$position) {
                                if (cmsCore::getArrVal($mod, 'position') == $position){
                                    echo '<option value="'. $position .'" selected>'. $position .'</option>';
                                } else {
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:menu.php

示例3:

            </td>
            <td align="center">
                <div><input name="author_add" type="button" id="author_add" value="&lt;&lt;"></div>
                <div><input name="author_remove" type="button" id="author_remove" value="&gt;&gt;" style="margin-top:4px"></div>
            </td>
            <td align="center" valign="top">
                <strong><?php echo $_LANG['ALL_USERS']; ?>:</strong><br/>
                <select name="userslist" size="15" multiple id="userslist" style="width:200px" class="text-input">
                    <?php echo $users_list; ?>
                </select>
            </td>
        </tr>
    </table>
    
    <input type="hidden" name="goadd" value="1" />
    <input type="hidden" name="csrf_token" id="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
</form>

<div class="sess_messages" style="display:none">
    <div class="message_info" id="error_mess"></div>
</div>
<script type="text/javascript" src="/includes/jquery/jquery.form.js"></script>

<script type="text/javascript">
    $().ready(function() {
        $('#author_remove').click(function() {
            return !$('#authorslist option:selected').remove().appendTo('#userslist');
        });
        $('#author_add').click(function() {
            return !$('#userslist option:selected').remove().appendTo('#authorslist');
        });
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:31,代码来源:com_blog_config.php

示例4: applet_userbanlist


//.........这里部分代码省略.........
                $item_id = array_shift($_SESSION['editlist']);
                if (sizeof($_SESSION['editlist']) == 0) {
                    unset($_SESSION['editlist']);
                } else {
                    $ostatok = '(' . $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) . ')';
                }
            } else {
                $item_id = cmsCore::request('id', 'int', 0);
            }
            $mod = $inDB->get_fields('cms_banlist', "id = '{$item_id}'", '*');
            if (!$mod) {
                cmsCore::error404();
            }
            echo '<h3>' . $_LANG['AD_EDIT_RULE'] . ' ' . $ostatok . '</h3>';
            cpAddPathway($_LANG['AD_EDIT_RULE']);
        }
        ?>
	  <div style="margin-top:2px;padding:10px;border:dotted 1px silver; width:508px;background:#FFFFCC">
	  	<div style="font-weight:bold"><?php 
        echo $_LANG['ATTENTION'];
        ?>
!</div>
		<div><?php 
        echo $_LANG['AD_CAUTION_INFO_0'];
        ?>
</div>
		<div><?php 
        echo $_LANG['AD_CAUTION_INFO_1'];
        ?>
</div>
	  </div>
      <form id="addform" name="addform" method="post" action="index.php?view=userbanlist">
        <input type="hidden" name="csrf_token" value="<?php 
        echo cmsUser::getCsrfToken();
        ?>
" />
        <table width="530" border="0" cellspacing="5" class="proptable">
          <tr>
            <td width="150" valign="top"><div><strong><?php 
        echo $_LANG['AD_BANLIST_USER'];
        ?>
: </strong></div></td>
			<?php 
        if ($do == 'add' && $to) {
            $mod['user_id'] = $to;
            $mod['ip'] = $inDB->get_field('cms_users', 'id=' . $to, 'last_ip');
        }
        ?>
            <td valign="top">
				<select name="user_id" id="user_id" onchange="loadUserIp()" style="width: 250px;">
                    <option value="0" <?php 
        if (@(!$mod['user_id'])) {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $_LANG['AD_WHITHOUT_USER'];
        ?>
</option>
                    <?php 
        if (isset($mod['user_id'])) {
            echo $inCore->getListItems('cms_users', $mod['user_id'], 'nickname', 'ASC', 'is_deleted=0 AND is_locked=0', 'id', 'nickname');
        } else {
            echo $inCore->getListItems('cms_users', 0, 'nickname', 'ASC', 'is_deleted=0 AND is_locked=0', 'id', 'nickname');
        }
        ?>
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:userbanlist.php

示例5: if

<?php if ($myblog || $is_admin || ($is_writer && $is_author)) { ?>
    <div class="float_bar">
        <?php if (!$post['published'] && ($is_admin)) { ?><span id="pub_link"><a class="ajaxlink" href="javascript:void(0)" onclick="<?php echo cmsCore::getInstance()->component; ?>.publishPost(<?php echo $post['id']; ?>);return false;"><?php echo $_LANG['PUBLISH']; ?></a> | </span><?php } ?><a href="/<?php echo cmsCore::getInstance()->component; ?>/editpost<?php echo $post['id']; ?>.html"><?php echo $_LANG['EDIT']; ?></a> | <a class="ajaxlink" href="javascript:void(0)" onclick="<?php echo cmsCore::getInstance()->component; ?>.deletePost(<?php echo $post['id']; ?>, '<?php echo cmsUser::getCsrfToken(); ?>');return false;"><?php echo $_LANG['DELETE']; ?></a>
    </div>
<?php } ?>
<h1 class="con_heading"><?php echo $post['title']; ?></h1>

<table width="100%" cellpadding="4" cellspacing="0">
    <tr>
        <td width="70" valign="top" align="center">
            <div><strong><?php echo $_LANG['AVTOR']; ?></strong></div>
            <div class="blog_post_avatar"><a href="<?php echo cmsUser::getProfileURL($post['author_login']); ?>"><img border="0" class="usr_img_small" src="<?php echo $post['author_avatar']; ?>" /></a></div>
            <div><strong><a href="<?php echo cmsUser::getProfileURL($post['author_login']); ?>"><?php echo $post['author_nickname']; ?></a></strong></div>
        </td>
        <td>
            <div class="blog_post_data" valign="top">
                <div><strong><?php echo $_LANG['PUBLISHED']; ?>:</strong> <?php if (!$post['published']) { ?><span id="pub_wait" style="color:#F00;"><?php echo $_LANG['ON_MODERATE']; ?></span><span id="pub_date" style="display:none;"><?php echo $post['fpubdate']; ?></span><?php } else { ?><?php echo $post['fpubdate']; ?><?php } ?></div>
                <div><strong><?php echo $_LANG['BLOG']; ?>:</strong> <a href="/<?php echo cmsCore::getInstance()->component; ?>/<?php echo $blog['seolink']; ?>"><?php echo $blog['title']; ?></a></div>
		<?php if ($blog['showcats'] && $cat) { ?>
                    <div><strong><?php echo $_LANG['CAT']; ?>:</strong> <a href="/<?php echo cmsCore::getInstance()->component; ?>/<?php echo $blog['seolink']; ?>/cat-<?php echo $cat['id']; ?>"><?php echo $cat['title']; ?></a></div>
                <?php } ?>
                <?php if ($post['edit_times']) { ?>
                    <div><strong><?php echo $_LANG['EDITED']; ?>:</strong> <?php echo $this->spellcount($post['edit_times'], $_LANG['TIME1'], $_LANG['TIME2'], $_LANG['TIME10']); ?> &mdash; <?php if ($post['edit_times'] > 1) { ?><?php echo $_LANG['LATS_TIME']; ?><?php } ?> <?php echo $post['feditdate']; ?></div>
                <?php } ?>
                <?php if ($post['feel']) { ?>
                    <div><strong><?php echo $_LANG['MOOD']; ?>:</strong> <?php echo $post['feel']; ?></div>
                <?php } ?>
                <?php if ($post['music']) { ?>
                    <div><strong><?php echo $_LANG['PLAYING']; ?>:</strong> <?php echo $post['music']; ?></div>
                <?php } ?>
            </div>
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:31,代码来源:com_blog_view_post.php

示例6: applet_usergroups


//.........这里部分代码省略.........
            if (isset($_REQUEST['multiple'])) {
                if (isset($_REQUEST['item'])) {
                    $_SESSION['editlist'] = cmsCore::request('item', 'array_int', array());
                } else {
                    cmsCore::addSessionMessage($_LANG['AD_NO_SELECT_OBJECTS'], 'error');
                    cmsCore::redirectBack();
                }
            }
            $ostatok = '';
            if (isset($_SESSION['editlist'])) {
                $item_id = array_shift($_SESSION['editlist']);
                if (sizeof($_SESSION['editlist']) == 0) {
                    unset($_SESSION['editlist']);
                } else {
                    $ostatok = '(' . $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) . ')';
                }
            } else {
                $item_id = cmsCore::request('id', 'int', 0);
            }
            $mod = $inDB->get_fields('cms_user_groups', "id = '{$item_id}'", '*');
            if (!$mod) {
                cmsCore::error404();
            }
            echo '<h3>' . $_LANG['AD_EDIT_GROUP'] . ' ' . $ostatok . '</h3>';
            cpAddPathway($_LANG['AD_EDIT_GROUP'] . ' ' . $mod['title']);
        }
        if (isset($mod['access'])) {
            $mod['access'] = str_replace(', ', ',', $mod['access']);
            $mod['access'] = explode(',', $mod['access']);
        }
        ?>
	<form id="addform" name="addform" method="post" action="index.php?view=usergroups">
        <input type="hidden" name="csrf_token" value="<?php 
        echo cmsUser::getCsrfToken();
        ?>
" />
		<table width="660" border="0" cellspacing="5" class="proptable">
			<tr>
				<td width="198" valign="top"><div><strong><?php 
        echo $_LANG['AD_GROUP_NAME'];
        ?>
: </strong></div><span class="hinttext"><?php 
        echo $_LANG['AD_VIEW_SITE'];
        ?>
</span></td>
				<td width="475" valign="top"><input name="title" type="text" id="title" size="30" value="<?php 
        echo htmlspecialchars($mod['title']);
        ?>
"/></td>
			</tr>
			<tr>
				<td valign="top"><div><strong><?php 
        echo $_LANG['AD_ALIAS'];
        ?>
:</strong></div><?php 
        if ($do == 'edit') {
            ?>
<span class="hinttext"><?php 
            echo $_LANG['AD_DONT_CHANGE'];
            ?>
</span><?php 
        }
        ?>
</td>
    <td valign="top"><input name="alias" type="text" id="title3" <?php 
        if (@$mod['alias'] == 'guest') {
开发者ID:vicktorwork,项目名称:cms1,代码行数:67,代码来源:usergroups.php

示例7: applet_menu


//.........这里部分代码省略.........
        $result = $inDB->query($sql);
        $row = $inDB->fetch_assoc($result);
        $maxorder = $row['max_o'] + 1;
        $menu = cmsCore::request('menu', 'str', '');
        $title = cmsCore::request('title', 'str', '');
        $position = cmsCore::request('position', 'str', '');
        $published = cmsCore::request('published', 'int', 0);
        $css_prefix = cmsCore::request('css_prefix', 'str', '');
        $is_public = cmsCore::request('is_public', 'int', '');
        if (!$is_public) {
            $access_list = $inCore->arrayToYaml(cmsCore::request('allow_group', 'array_int'));
        }
        $cfg['menu'] = $menu;
        $cfg_str = cmsCore::arrayToYaml($cfg);
        $sql = "INSERT INTO cms_modules (position, name, title, is_external, content, ordering, showtitle, published, user, config, css_prefix, access_list)\n                VALUES ('{$position}', '{$_LANG['AD_MENU']}', '{$title}', 1, 'mod_menu', {$maxorder}, 1, {$published}, 0, '{$cfg_str}', '{$css_prefix}', '{$access_list}')";
        $inDB->query($sql);
        $newid = $inDB->get_last_id('cms_modules');
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirect('?view=modules&do=edit&id=' . $newid);
    }
    if ($do == 'addmenu' || $do == 'add' || $do == 'edit') {
        $GLOBALS['cp_page_head'][] = '<script language="JavaScript" type="text/javascript" src="js/menu.js"></script>';
        echo '<script>';
        echo cmsPage::getLangJS('AD_SPECIFY_LINK_MENU');
        echo '</script>';
    }
    if ($do == 'addmenu') {
        $GLOBALS['cp_page_title'] = $_LANG['AD_MENU_ADD'];
        cpAddPathway($_LANG['AD_MENU_ADD']);
        $menu_list = cpGetList('menu');
        ?>
         <form id="addform" name="addform" action="index.php?view=menu&do=submitmenu" method="post">
             <input type="hidden" name="csrf_token" value="<?php 
        echo cmsUser::getCsrfToken();
        ?>
" />
             <table class="proptable" width="650" cellspacing="10" cellpadding="10">
                 <tr>
                     <td width="300" valign="top">
                         <strong><?php 
        echo $_LANG['AD_MODULE_MENU_TITLE'];
        ?>
</strong>
                     </td>
                     <td valign="top">
                         <input name="title" type="text" id="title2" style="width:99%" value=""/>
                     </td>
                 </tr>
                 <tr>
                     <td valign="top">
                         <strong><?php 
        echo $_LANG['AD_MENU_TO_VIEW'];
        ?>
</strong><br/>
                         <span class="hinttext"><?php 
        echo $_LANG['AD_TO_CREATE_NEW_POINT'];
        ?>
</span>
                     </td>
                     <td valign="top">
                         <select name="menu" id="menu" style="width:99%">
                             <?php 
        foreach ($menu_list as $menu) {
            ?>
                                 <option value="<?php 
            echo $menu['id'];
开发者ID:vicktorwork,项目名称:cms1,代码行数:67,代码来源:menu.php

示例8: applet_arhive

function applet_arhive() {
    $inCore = cmsCore::getInstance();
    
    global $_LANG;
    
    cmsCore::c('page')->setTitle($_LANG['AD_ARTICLES_ARCHIVE']);
    
    $cfg = $inCore->loadComponentConfig('content');
    $cfg_arhive = $inCore->loadComponentConfig('arhive');

    cpAddPathway($_LANG['AD_ARTICLE_SITE'], 'index.php?view=tree');
    cpAddPathway($_LANG['AD_ARTICLES_ARCHIVE'], 'index.php?view=arhive');

    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);

    if ($do == 'saveconfig') {
        if (!cmsUser::checkCsrfToken()) { cmsCore::error404(); }
        
        $cfg['source'] = cmsCore::request('source', 'str', '');
        $inCore->saveComponentConfig('arhive', $cfg);
        
        cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'] , 'success');
        cmsCore::redirect('?view=arhive&do=config');
    }
    
    if ($do == 'config') {
        $toolmenu = array(
            array( 'icon' => 'folders.gif', 'title' => $_LANG['AD_LIST_OF_ARTICLES'], 'link' => '?view=arhive' )
        );
        
        cpToolMenu($toolmenu);
        cpAddPathway($_LANG['AD_SETTINGS'], 'index.php?view=arhive&do=config');
?>
<form action="index.php?view=arhive&do=saveconfig" method="post" name="optform" target="_self" id="form1">
    <input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
    
    <div style="width:550px">
        <div class="form-group">
            <label><?php echo $_LANG['AD_SOURCE_MATERIALS']; ?></label>
            <select class="form-control" name="source">
                <option value="content" <?php if ($cfg_arhive['source'] == 'content') { echo 'selected="selected"'; } ?>><?php echo $_LANG['AD_ARTICLE_SITE']; ?></option>
                <option value="arhive" <?php if ($cfg_arhive['source'] == 'arhive') { echo 'selected="selected"'; } ?>><?php echo $_LANG['AD_ARTICLES_ARCHIVE']; ?></option>
                <option value="both" <?php if ($cfg_arhive['source'] == 'both') { echo 'selected="selected"'; } ?>><?php echo $_LANG['AD_CATALOG_AND_ARCHIVE']; ?></option>
            </select>
        </div>
    </div>
    
    <div>
        <input type="hidden" name="opt" value="saveconfig" />
        <input type="submit" class="btn btn-primary" name="save" value="<?php echo $_LANG['SAVE']; ?>" />
        <input type="button" class="btn btn-default" name="back" value="<?php echo $_LANG['CANCEL']; ?>" onclick="window.location.href='index.php?view=arhive';" />
    </div>
</form>
<?php
    }

    if ($do == 'list') {
        $toolmenu = array(
            array( 'icon' => 'config.gif', 'title' => $_LANG['AD_SETTINGS'], 'link' => '?view=arhive&do=config' ),
            array( 'icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=arhive&do=delete&multiple=1');" )
        );

        cpToolMenu($toolmenu);

        //TABLE COLUMNS
        $fields = array(
            array( 'title' => 'id', 'field' => 'id', 'width' => '40' ),
            array( 'title' => $_LANG['AD_CREATE'], 'field' => 'pubdate', 'width' => '80', 'filter' => 15, 'fdate' => '%d/%m/%Y' ),
            array( 'title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=content&do=edit&id=%id%', 'filter' => 15 ),
            array( 'title' => $_LANG['AD_PARTITION'], 'field' => 'category_id', 'width' => '150', 'filter' => 1, 'prc' => 'cpCatById', 'filterlist' => cpGetList('cms_category') )
        );

        //ACTIONS
        $actions = array(
            array( 'title' => $_LANG['AD_TO_ARTICLES_CATALOG'], 'icon' => 'arhive_off.gif', 'link' => '?view=arhive&do=arhive_off&id=%id%' ),
            array( 'title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=content&do=delete&id=%id%', 'confirm' => $_LANG['AD_DELETE_MATERIALS'] )
        );

        //Print table
        cpListTable('cms_content', $fields, $actions, 'is_arhive=1');
    }
    
    if ($do == 'arhive_off') {
        if (cmsCore::inRequest('id')) {
            cmsCore::c('db')->setFlag('cms_content', $id, 'is_arhive', '0');
            cmsCore::redirect('?view=arhive');
        }
    }

    if ($do == 'delete') {
        if (!cmsCore::inRequest('item')) {
            if ($id >= 0) {
                cmsCore::m('content')->deleteArticle($id, $cfg['af_delete']);
            }
        } else {
            cmsCore::m('content')->deleteArticles(cmsCore::request('item', 'array_int'), $cfg['af_delete']);
        }
        cmsCore::redirect('?view=arhive');
    }
//.........这里部分代码省略.........
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:101,代码来源:arhive.php

示例9: applet_modules


//.........这里部分代码省略.........
            $mod = cmsCore::c('db')->get_fields('cms_modules', "id = '". $item_id ."'", '*');
            if (!$mod) { cmsCore::error404(); }
            
            $mod['hidden_menu_ids'] = cmsCore::yamlToArray($mod['hidden_menu_ids']);
            $mod['titles'] = cmsCore::yamlToArray($mod['titles']);
            
            $show_all = false;
            
            $default_position = cmsCore::c('db')->get_field('cms_modules_bind', "module_id='". $mod['id'] ."' AND menu_id=0 AND tpl='". cmsCore::c('config')->template ."'", 'position');
            
            if (!empty($default_position)) {
                $show_all = true;
                $mod['position'] = $default_position;
            }

            echo '<h3>'. $_LANG['AD_EDIT_MODULE'] . $ostatok .'</h3>';
            cpAddPathway($mod['name']);
        }

        $toolmenu[] = array( 'icon' => 'save.gif',   'title' => $_LANG['SAVE'],   'link' => 'javascript:document.addform.submit();' );
        $toolmenu[] = array( 'icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);' );

        if (cmsCore::getArrVal($mod, 'is_external')) {
            $php_file = 'modules/'. $mod['content'] .'/backend.php';
            $xml_file = 'modules/'. $mod['content'] .'/backend.xml';
            if (file_exists($php_file) || file_exists($xml_file)) {
                $toolmenu[] = array( 'icon' => 'config.gif', 'title' => $_LANG['CONFIG_MODULE'], 'link' => '?view=modules&do=config&id='. $mod['id'] );
            }
        }

        cpToolMenu($toolmenu);
?>
    <form id="addform" name="addform" method="post" action="index.php">
        <input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
        <input type="hidden" name="view" value="modules" />

        <table class="table">
            <tr><td>
                <div class="panel panel-default">
                    <div class="panel-body">
                        <div class="form-group">
                            <label><?php echo $_LANG['AD_MODULE_TITLE']; ?> (<input type="checkbox" class="uittip" title="<?php echo $_LANG['AD_VIEW_TITLE'];?>" name="showtitle" <?php if ($mod['showtitle'] || $do == 'add') { echo 'checked="checked"'; } ?> value="1" />)</label>
                            <input type="text" id="title" class="form-control" style="width:100%" name="title" value="<?php echo htmlspecialchars($mod['title']);?>" />
                            <div class="help-block"><?php echo $_LANG['AD_VIEW_IN_SITE']; ?></div>
                        </div>
                        
                        <?php if (count($langs) > 1) { ?>
                            <label><?php echo $_LANG['AD_LANG_TITLES']; ?></label>
                            <?php foreach ($langs as $lang) { ?>
                                <div>
                                    <strong><?php echo $lang; ?>:</strong>
                                    <input name="titles[<?php echo $lang; ?>]" type="text" style="width:97%" value="<?php echo htmlspecialchars($mod['titles'][$lang]); ?>" placeholder="<?php echo $_LANG['AD_HINT_DEFAULT']; ?>" />
                                </div>
                            <?php } ?>
                            <div class="help-block"><?php echo $_LANG['AD_LANG_TITLES_HINT']; ?></div>
                        <?php } ?> 
                        
                        <div class="form-group">
                            <label><?php echo $_LANG['AD_MODULE_NAME']; ?></label>
                            <?php if (!isset($mod['user']) || @$mod['user'] == 1) { ?>
                                <input type="text" id="name" class="form-control" style="width:99%" name="name" value="<?php echo htmlspecialchars($mod['name']);?>" />
                            <?php } else { ?>
                                <input type="text" id="name" class="form-control" style="width:99%" name="" value="<?php echo @$mod['name'];?>" disabled="disabled" />
                                <input type="hidden" name="name" value="<?php echo htmlspecialchars($mod['name']);?>" />
                            <?php } ?>
                            <div class="help-block"><?php echo $_LANG['AD_SHOW_ADMIN']; ?></div>
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:modules.php

示例10: getAddedCode

 private function getAddedCode($component, $item_id)
 {
     $html = '<div id="fe_plugin_block">' . '<div id="fe_context_menu">' . '<a href="javascript:void(0);" id="fe_context_menu_link" onclick="showEditorBlock(\'' . $component . '\', ' . $item_id . ');">Редактировать</a>' . '</div>' . '<div id="fe_editor_block" class="fe_small_screen">' . '<span class="fe_cancel" onclick="hideEditorBlock();"></span>' . '<span class="fe_maximize" onclick="resizeEditorBlock(\'maximize\');"></span>' . '<span class="fe_minimize" onclick="resizeEditorBlock(\'minimize\');"></span>' . '<div id="fe_error_msg"></div>' . '<div id="fe_succes_msg"></div>' . '<div id="fe_editor_body"></div>' . '</div>' . '</div>' . '<input type="hidden" name="csrf_token" id="csrf_token" value="' . cmsUser::getCsrfToken() . '">' . '<script type="text/javascript" src="/plugins/p_front_editor/js/common.js"></script>' . '<link href="/plugins/p_front_editor/css/styles.css" type="text/css" rel="stylesheet">';
     return $html;
 }
开发者ID:m-fatikhov,项目名称:icms1_front_editor_plugin,代码行数:5,代码来源:plugin.php

示例11: applet_cats


//.........这里部分代码省略.........
        } else {
            if (cmsCore::inRequest('multiple')) {
                if (cmsCore::inRequest('item')) {
                    $_SESSION['editlist'] = cmsCore::request('item', 'array_int');
                } else {
                    echo '<p class="error">'. $_LANG['AD_NO_SELECT_OBJECTS'] .'</p>';
                    return;
                }
            }
            
            $ostatok = '';
            
            if (isset($_SESSION['editlist'])) {
                $id = array_shift($_SESSION['editlist']);
                if (sizeof($_SESSION['editlist']) == 0) {
                    unset($_SESSION['editlist']);
                } else {
                    $ostatok = '('. $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) .')';
                }
            } else {
                $id = cmsCore::request('id', 'int', 0);
            }
            
            $mod = cmsCore::c('db')->get_fields('cms_category', 'id='.$id, '*');
            if (!empty($mod['photoalbum'])) {
                $mod['photoalbum'] = unserialize($mod['photoalbum']);
            }
            
            echo '<h3>'. $_LANG['AD_EDIT_SECTION'] . $ostatok .'</h3>';
            cpAddPathway($mod['title'], 'index.php?view=cats&do=edit&id='. $mod['id']);
        }
?>
<form id="addform" name="addform" method="post" action="index.php">
    <input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
    <input type="hidden" name="view" value="cats" />

    <table class="table">
        <tr>
            <!-- главная ячейка -->
            <td valign="top">
                <div class="form-group">
                    <label><?php echo $_LANG['AD_TITLE_PARTITION'];?></label>
                    <input type="text" id="title" class="form-control" name="title" value="<?php echo htmlspecialchars(cmsCore::getArrVal($mod, 'title', ''));?>" />
                </div>
                    
                <div class="form-group">
                    <label><?php echo $_LANG['AD_TEMPLATE_PARTITION'];?></label>
                    <input type="text" class="form-control" name="tpl" value="<?php echo cmsCore::getArrVal($mod, 'tpl', '');?>" />
                </div>
                    
                <div class="form-group">
                    <label><?php echo $_LANG['AD_PARENT_PARTITION'];?></label>
                    <div class="parent_notice" style="color:red;margin:4px 0px;display:none"><?php echo $_LANG['AD_ANOTHER_PARENT'];?></div>

                    <select name="parent_id" size="12" id="parent_id" class="form-control" onchange="if($('option:selected',this).data('nsleft')>='<?php echo cmsCore::getArrVal($mod, 'NSLeft', 0); ?>' && $('option:selected',this).data('nsright')<='<?php echo cmsCore::getArrVal($mod, 'NSRight', 0); ?>'){ $('.parent_notice').show();$('#add_mod').prop('disabled', true); } else { $('.parent_notice').hide();$('#add_mod').prop('disabled', false); }">
                        <?php $rootid = cmsCore::c('db')->getNsRootCatId('cms_category'); ?>
                        <option value="<?php echo $rootid; ?>" <?php if (!isset($mod['parent_id']) || cmsCore::getArrVal($mod, 'parent_id', '') == $rootid) { echo 'selected="selected"'; }?>><?php echo $_LANG['AD_SECTION'];?></option>
                        <?php echo $inCore->getListItemsNS('cms_category', cmsCore::getArrVal($mod, 'parent_id', $rootid)); ?>
                    </select>
                </div>
                    
                <div class="form-group">
                    <label><?php echo $_LANG['AD_SECTION_DESCRIPT'];?></label>
                    <?php $inCore->insertEditor('description', cmsCore::getArrVal($mod, 'description', ''), '250', '100%'); ?>
                </div>
            </td>
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:cats.php

示例12: applet_arhive

function applet_arhive()
{
    $inCore = cmsCore::getInstance();
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    $GLOBALS['cp_page_title'] = $_LANG['AD_ARTICLES_ARCHIVE'];
    $cfg = $inCore->loadComponentConfig('content');
    $cfg_arhive = $inCore->loadComponentConfig('arhive');
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    cpAddPathway($_LANG['AD_ARTICLE_SITE'], 'index.php?view=tree');
    cpAddPathway($_LANG['AD_ARTICLES_ARCHIVE'], 'index.php?view=arhive');
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);
    if ($do == 'saveconfig') {
        if (!cmsCore::validateForm()) {
            cmsCore::error404();
        }
        $cfg['source'] = cmsCore::request('source', 'str', '');
        $inCore->saveComponentConfig('arhive', $cfg);
        cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
        cmsCore::redirect('?view=arhive&do=config');
    }
    if ($do == 'config') {
        $toolmenu = array();
        $toolmenu[0]['icon'] = 'folders.gif';
        $toolmenu[0]['title'] = $_LANG['AD_LIST_OF_ARTICLES'];
        $toolmenu[0]['link'] = '?view=arhive';
        cpToolMenu($toolmenu);
        cpAddPathway($_LANG['AD_SETTINGS'], 'index.php?view=arhive&do=config');
        ?>
<form action="index.php?view=arhive&do=saveconfig" method="post" name="optform" target="_self" id="form1">
    <input type="hidden" name="csrf_token" value="<?php 
        echo cmsUser::getCsrfToken();
        ?>
" />
    <table width="609" border="0" cellpadding="10" cellspacing="0" class="proptable">
        <tr>
            <td valign="top"><strong><?php 
        echo $_LANG['AD_SOURCE_MATERIALS'];
        ?>
</strong></td>
            <td width="100" valign="top">
                <select name="source" id="source" style="width:285px">
                    <option value="content" <?php 
        if ($cfg_arhive['source'] == 'content') {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $_LANG['AD_ARTICLE_SITE'];
        ?>
</option>
                    <option value="arhive" <?php 
        if ($cfg_arhive['source'] == 'arhive') {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $_LANG['AD_ARTICLES_ARCHIVE'];
        ?>
</option>
                    <option value="both" <?php 
        if ($cfg_arhive['source'] == 'both') {
            echo 'selected="selected"';
        }
        ?>
><?php 
        echo $_LANG['AD_CATALOG_AND_ARCHIVE'];
        ?>
</option>
                </select>
            </td>
        </tr>
    </table>
    <p>
        <input name="opt" type="hidden" value="saveconfig" />
        <input name="save" type="submit" id="save" value="<?php 
        echo $_LANG['SAVE'];
        ?>
" />
        <input name="back" type="button" id="back" value="<?php 
        echo $_LANG['CANCEL'];
        ?>
" onclick="window.location.href='index.php?view=arhive';" />
    </p>
</form>
<?php 
    }
    if ($do == 'list') {
        $toolmenu = array();
        $toolmenu[0]['icon'] = 'config.gif';
        $toolmenu[0]['title'] = $_LANG['AD_SETTINGS'];
        $toolmenu[0]['link'] = '?view=arhive&do=config';
        $toolmenu[1]['icon'] = 'delete.gif';
        $toolmenu[1]['title'] = $_LANG['AD_DELETE_SELECTED'];
        $toolmenu[1]['link'] = "javascript:checkSel('?view=arhive&do=delete&multiple=1');";
        cpToolMenu($toolmenu);
        //TABLE COLUMNS
        $fields = array();
//.........这里部分代码省略.........
开发者ID:vicktorwork,项目名称:cms1,代码行数:101,代码来源:arhive.php

示例13: cmsTagLine

if ($item) {
    $target = $component == 'blog_posts' ? 'blogpost' : $component;
    $item['tags'] = cmsTagLine("{$target}", $item_id, false);
}
if (!$item) {
    cmsCore::jsonOutput(array('error' => true, 'html' => ' Не получена запись для редактирования!'));
    cmsCore::halt();
}
//изображение статьи для формы редактирования статей
if ($component == 'content') {
    $item['image'] = file_exists(PATH . '/images/photos/medium/article' . $item['id'] . '.jpg') ? 'article' . $item['id'] . '.jpg' : '';
}
//html-код формы
$html = '';
ob_start();
$smarty = cmsPage::initTemplate('plugins', $template);
$smarty->assign('item', $item);
$smarty->assign('csrf_token', cmsUser::getCsrfToken());
if ($component == 'blog_posts') {
    //получаем код панелей bbcode и смайлов
    $bb_toolbar = cmsPage::getBBCodeToolbar('message', true, 'blogs', 'blog_post', $item['id']);
    $smilies = cmsPage::getSmilesPanel('message');
    $smarty->assign('smilies', $smilies);
    $smarty->assign('bb_toolbar', $bb_toolbar);
}
$smarty->display($template);
$html = ob_get_clean();
cmsCore::jsonOutput(array('error' => false, 'html' => $html));
?>

开发者ID:m-fatikhov,项目名称:icms1_front_editor_plugin,代码行数:29,代码来源:get_edit_form.php

示例14: if

                </tr>
            </table>
        
            <table cellspacing="0" cellpadding="5" id="opt_cat" style="display:none; background-color:#E0EAEF;position: absolute;right: 54px;top: 32px;">
                <tr>
                    <td width="16"><img src="/templates/<?php echo cmsCore::c('config')->template; ?>/images/icons/addcat.png" border="0"/></td>
                    <td width=""><a class="ajaxlink" href="javascript:void(0)" onclick="<?php echo cmsCore::getInstance()->component; ?>.addBlogCat(<?php echo $blog['id']; ?>);return false;"><?php echo $_LANG['NEW_CAT']; ?></a></td>
                </tr>
                <?php if ($cat_id > 0) { ?>
                    <tr>
                        <td width="16"><img src="/templates/<?php echo cmsCore::c('config')->template; ?>/images/icons/editcat.png" border="0"/></td>
                        <td width=""><a class="ajaxlink" href="javascript:void(0)" onclick="<?php echo cmsCore::getInstance()->component; ?>.editBlogCat(<?php echo $cat_id; ?>);return false;"><?php echo $_LANG['RENAME_CAT']; ?></a></td>
                    </tr>
                    <tr>
                        <td width="16"><img src="/templates/<?php echo cmsCore::c('config')->template; ?>/images/icons/deletecat.png" border="0"/></td>
                        <td width=""><a class="ajaxlink" href="javascript:void(0)" onclick="<?php echo cmsCore::getInstance()->component; ?>.deleteCat(<?php echo $cat_id; ?>, '<?php echo cmsUser::getCsrfToken(); ?>');return false;"><?php echo $_LANG['DEL_CAT']; ?></a></td>
                    </tr>
                <?php } ?>
            </table>
        <?php } else if ($is_writer) { ?>
            <table cellspacing="0" cellpadding="5">
                <tr>
                    <td width="16"><img src="/templates/<?php echo cmsCore::c('config')->template; ?>/images/icons/edit.png" border="0"/></td>
                    <td width=""><a href="<?php echo $blog['add_post_link']; ?>"><?php echo $_LANG['NEW_POST']; ?></a></td>
                </tr>
            </table>
	<?php } ?>
    </div>
<?php } ?>

<?php if ($blogcats) { ?>
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:31,代码来源:com_blog_view.php

示例15: if

<div class="float_bar">
<strong><?php echo $_LANG['RATING']; ?>: </strong><span id="karmapoints"><?php echo $this->rating($photo['rating']); ?></span> | <strong><?php echo $_LANG['HITS']; ?>: </strong> <?php echo $photo['hits']; ?> | <?php if (!$photo['published']) { ?><span id="pub_photo_wait" style="color:#F00;"><?php echo $_LANG['WAIT_MODERING']; ?></span><span id="pub_photo_date" style="display:none;"><?php echo $photo['pubdate']; ?></span><?php } else { ?><?php echo $photo['pubdate']; ?><?php } ?> | <a href="<?php echo cmsUser::getProfileURL($photo['login']); ?>"><?php echo $photo['nickname']; ?></a> <?php if ($is_author || $is_admin || $is_moder) { ?>| <a class="ajaxlink" href="javascript:void(0)" onclick="clubs.editPhoto(<?php echo $photo['id']; ?>);return false;"><?php echo $_LANG['EDIT']; ?></a> <?php if ($is_admin || $is_moder) { ?><?php if (!$photo['published']) { ?><span id="pub_photo_link">  | <a class="ajaxlink" href="javascript:void(0)" onclick="clubs.publishPhoto(<?php echo $photo['id']; ?>);return false;"><?php echo $_LANG['PUBLISH']; ?></a></span><?php } ?> | <a class="ajaxlink" href="javascript:void(0)" onclick="clubs.deletePhoto(<?php echo $photo['id']; ?>, '<?php echo cmsUser::getCsrfToken(); ?>');return false;"><?php echo $_LANG['DELETE']; ?></a><?php } ?><?php } ?>
</div>

<h1 class="con_heading"><?php echo $photo['title']; ?></h1>
<?php if ($photo['description']) { ?>
    <p class="photo_desc"><?php echo nl2br($photo['description']); ?> </p>
<?php } ?>
<table width="100%" cellspacing="0" cellpadding="3" border="0">
  <tbody>
    <tr>
      <td width="150px" valign="middle" align="center">
      <?php if ($photo['previd']) { ?>
        <cite><?php echo $_LANG['PREVIOUS']; ?></cite><br>
        <a href="/clubs/photo<?php echo $photo['previd']['id']; ?>.html#main"><img alt="{$photo.previd.title|escape:'html'}" src="/images/photos/small/<?php echo $photo['previd']['file']; ?>"></a>
      <?php } ?>
      </td>
      <td align="center" valign="top">
      	<?php if ($is_exists_original) { ?>
            <a href="/images/photos/<?php echo $photo['file']; ?>" class="photobox">
                <img src="/images/photos/medium/<?php echo $photo['file']; ?>" alt="<?php echo $this->escape($photo['title']); ?>" id="view_photo" />
            </a>
        <?php } else { ?>
            <img src="/images/photos/medium/<?php echo $photo['file']; ?>" alt="<?php echo $this->escape($photo['title']); ?>" id="view_photo" />
        <?php } ?>
      </td>
      <td width="150px" valign="middle" align="center">
      <?php if ($photo['nextid']) { ?>
      	<cite><?php echo $_LANG['NEXT']; ?></cite><br>
        <a href="/clubs/photo<?php echo $photo['nextid']['id']; ?>.html#main"><img alt="{$photo.nextid.title|escape:'html'}" src="/images/photos/small/<?php echo $photo['nextid']['file']; ?>"></a>
      <?php } ?>
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:31,代码来源:com_clubs_view_photo.php


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