• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP getDef函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: check_for_csrf

/**
 * check for csrfs
 * @param  string $action action to pass to check_nonce
 * @param  string $file   file to pass to check_nonce
 * @param  bool   $die    if false return instead of die
 * @return 
 */
function check_for_csrf($action, $file = "", $die = true)
{
    // check for csrf
    if (!getDef('GSNOCSRF', true) || GSNOCSRF == FALSE) {
        $nonce = $_REQUEST['nonce'];
        if (!check_nonce($nonce, $action, $file)) {
            if ($die) {
                die("CSRF detected!");
            }
            return true;
        }
    }
}
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:20,代码来源:security_functions.php


示例2: plugin_info_update

/**
 * update plugin_info with additional info from api
 */
function plugin_info_update()
{
    global $plugin_info;
    foreach ($plugin_info as $key => $plugin) {
        $api_data = json_decode(get_api_details('plugin', $key . '.php', getDef('GSNOPLUGINCHECK', true)));
        // on api success
        if (is_object($api_data) && $api_data->status == 'successful') {
            $apiver = $api_data->version;
            $apipath = $api_data->path;
            $apiname = $api_data->name;
            $plugin_info[$key]['name'] = $apiname;
            // $plugin_info[$key]['apiname'] = $apiname;
            $plugin_info[$key]['apipath'] = $apipath;
            $plugin_info[$key]['apiver'] = $apiver;
        }
    }
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:20,代码来源:plugins.php


示例3: check_for_csrf

/**
 * check for csrfs
 * @param  string $action action to pass to check_nonce
 * @param  string $file   file to pass to check_nonce
 * @param  bool   $die    if false return instead of die
 * @return bool   returns true if csrf check fails
 */
function check_for_csrf($action, $file = "", $die = true)
{
    // check for csrf
    if (!getDef('GSNOCSRF', true)) {
        $nonce = $_REQUEST['nonce'];
        if (!check_nonce($nonce, $action, $file)) {
            exec_action('csrf');
            // @hook csrf a csrf was detected
            if (requestIsAjax()) {
                $error = i18n_r("CSRF", "CRSF Detected!");
                echo "<div>";
                // jquery bug will not parse 1 html element so we wrap it
                include 'template/error_checking.php';
                echo "</div>";
                die;
            }
            if ($die) {
                die(i18n_r("CSRF", "CRSF Detected!"));
            }
            return true;
        }
    }
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:30,代码来源:security_functions.php


示例4: i18n_r

     $htmleditor = '';
 }
 # check to see if passwords are changing
 if (isset($_POST['sitepwd'])) {
     $pwd1 = $_POST['sitepwd'];
 }
 if (isset($_POST['sitepwd_confirm'])) {
     $pwd2 = $_POST['sitepwd_confirm'];
 }
 // do password checking
 if ($pwd1 != $pwd2 || $adding === true && (empty($pwd1) || $pwd1 !== $pwd2)) {
     # passwords do not match if changing or adding users passwords
     $error = i18n_r('PASSWORD_NO_MATCH');
     $password = '';
 } else {
     if ($pwd1 != '' && strlen($pwd1) < getDef('GSPASSLENGTHMIN')) {
         # password cannot be shorter than GSPASSLENGTH
         $error = i18n_r('PASSWORD_TOO_SHORT');
         $password = '';
     } else {
         if ($pwd1 != '') {
             # password changed
             $newpassword = $pwd1;
             // set new password
             exec_action('profile-password-changed');
             // @hook profile-password-changed a users password was changed
             $password = passhash($newpassword);
             // set new password
         }
     }
 }
开发者ID:CodeCharming,项目名称:GetSimpleCMS,代码行数:31,代码来源:profile.php


示例5: getDef

// @hook header backend before html head closes
?>

<noscript>
	<style>
		.tab{ display:block; clear:both;}
		.tab fieldset legend{ display: block; }
		#cm_themeselect, #cm_themeselect_label { display:none;}
		#theme_filemanager ul ul {
			display: block;
		}
	</style>
</noscript>

</head>
<?php 
$headerclass = getDef('GSHEADERCLASS', true) ? getDef('GSHEADERCLASS') : '';
?>
<body <?php 
filename_id();
echo ' class="' . $bodyclass . '"';
?>
 >
	<div class="header <?php 
echo $headerclass;
?>
" id="header" >
		<div class="wrapper clearfix">
 <?php 
exec_action('header-body');
// @hook header-body backend header body wrapper html
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:header.php


示例6: find_accesskey

echo find_accesskey(i18n_r('MENU_MANAGER'));
?>
" <?php 
check_menu('menu-manager');
?>
><?php 
i18n('MENU_MANAGER');
?>
</a></li>
	<?php 
exec_action("pages-sidebar");
// @hook pages-sidebar sidebar list html output
?>
</ul>

<p id="js_submit_line" ></p>

<?php 
if (get_filename_id() === 'edit') {
    ?>
	<?php 
    if (getDef('GSAUTOSAVE')) {
        ?>
	<p id="autosavestatus"><?php 
        echo sprintf(i18n_r("AUTOSAVE_STATUS"), getDef('GSAUTOSAVE'));
        ?>
</p>
	<p id="autosavenotify"></p>
	<?php 
    }
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:sidebar-pages.php


示例7: i18n_r

} else {
    echo '<tr><td>SimpleXML Module</td><td><span class="OKmsg" >' . i18n_r('INSTALLED') . ' - ' . i18n_r('OK') . '</span></td></tr>';
}
if (server_is_apache()) {
    echo '<tr><td>Apache web server</td><td><span class="OKmsg" >' . $_SERVER['SERVER_SOFTWARE'] . ' - ' . i18n_r('OK') . '</span></td></tr>';
    if (function_exists('apache_get_modules')) {
        if (!in_arrayi('mod_rewrite', apache_get_modules())) {
            echo '<tr><td>Apache Mod Rewrite</td><td><span class="WARNmsg" >' . i18n_r('NOT_INSTALLED') . ' - ' . i18n_r('WARNING') . '</span></td></tr>';
        } else {
            echo '<tr><td>Apache Mod Rewrite</td><td><span class="OKmsg" >' . i18n_r('INSTALLED') . ' - ' . i18n_r('OK') . '</span></td></tr>';
        }
    } else {
        echo '<tr><td>Apache Mod Rewrite</td><td><span class="OKmsg" >' . i18n_r('INSTALLED') . ' - ' . i18n_r('OK') . '</span></td></tr>';
    }
} else {
    if (!getDef('GSNOAPACHECHECK') || GSNOAPACHECHECK == false) {
        echo '<tr><td>Apache web server</td><td><span class="ERRmsg" >' . $_SERVER['SERVER_SOFTWARE'] . ' - <b>' . i18n_r('ERROR') . '</b></span></td></tr>';
    }
}
?>
			</table>
			<p class="hint"><?php 
echo sprintf(i18n_r('REQS_MORE_INFO'), "http://get-simple.info/docs/requirements");
?>
</p>
			<?php 
if ($kill != '') {
    ?>
				<p><?php 
    i18n('KILL_CANT_CONTINUE');
    ?>
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:install.php


示例8: cl

}
?>
<h1 class="sitename"><a href="<?php 
echo $SITEURL;
?>
" target="_blank" ><?php 
echo cl($SITENAME);
?>
 <i class="icon fa fa-external-link"></i></a></h1>
<ul class="nav <?php 
echo $plugin_class;
?>
">

<?php 
$tabs = explode(',', getDef('GSTABS'));
// $tabs  = array_keys($sidemenudefinition); // debug all
$current = get_filename_id();
// if current tab is not in GSTABS, then set its parent tab as current
if (!in_array($current, $tabs)) {
    if (isset($sidemenudefinition[$current]) && !empty($sidemenudefinition[$current])) {
        $current = $sidemenudefinition[$current];
    }
}
if ($tabs) {
    foreach ($tabs as $tab) {
        if (empty($tab)) {
            continue;
        }
        $tabtitle = i18n_r('TAB_' . uppercase($tab));
        $class = $tab == $current ? ' current' : '';
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:include-nav.php


示例9: i18n

<?php 
}
?>
	<li style="float:right;" id="sb_filesize" ><small><?php 
i18n('MAX_FILE_SIZE');
?>
: <strong><?php 
echo toBytes(ini_get('upload_max_filesize')) / 1024 / 1024;
?>
MB</strong></small></li>
</ul>


<?php 
# show normal upload form if Uploadify is turned off
if (getDef('GSNOUPLOADIFY', true)) {
    ?>
	<form class="uploadform" action="upload.php?path=<?php 
    echo $path;
    ?>
" method="post" enctype="multipart/form-data">
		<p><input type="file" name="file[]" id="file" style="width:220px;" multiple /></p>
		<input type="hidden" name="hash" id="hash" value="<?php 
    echo $SESSIONHASH;
    ?>
" />
		<input type="submit" class="submit" name="submit" value="<?php 
    i18n('UPLOAD');
    ?>
" />
	</form>
开发者ID:elephantcode,项目名称:elephantcode,代码行数:31,代码来源:sidebar-files.php


示例10: strip_content

/**
 * strip shortcodes based on pattern
 * @since  3.3.6
 * @param  str $str     input string
 * @param  string $pattern regex pattern to strip
 * @return str          new string
 */
function strip_content($str, $pattern = '/[({]%.*?%[})]/')
{
    if (getDef('GSCONTENTSTRIPPATTERN', true)) {
        $pattern = getDef('GSCONTENTSTRIPPATTERN');
    }
    return preg_replace($pattern, '', $str);
}
开发者ID:CodeCharming,项目名称:GetSimpleCMS,代码行数:14,代码来源:basic.php


示例11: exec_action

    exec_action('common');
    // @hook common common.php has completed loading resoruces, base not yet loaded
    // debugLog('calling common_callout');
    if (function_exists('common_callout')) {
        common_callout();
    }
    // @callout common_callout callout after common loaded, before templating
}
/**
 * debug plugin global arrays
 */
// debugLog($live_plugins);
// debugLog($plugin_info);
// debugLog($plugins);
// debugLog($pluginHooks);
if (isset($load['login']) && $load['login'] && getDef('GSALLOWLOGIN', true)) {
    require_once GSADMININCPATH . 'login_functions.php';
}
// do the template rendering
if (GSBASE) {
    require_once GSADMINPATH . 'base.php';
}
// common methods that are required before dependancy includes
/**
 * Debug Console Log
 * @since 3.1
 * @param $txt string
 */
function debugLog($mixed = null)
{
    global $GS_debug;
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:common.php


示例12: genStdThumb

/**
 * Generate standard thumbnails
 * @param  string $path path to image
 * @param  string $name file name
 * @uses   GD
 */
function genStdThumb($subpath, $file)
{
    // set thumbnail width from GSIMAGEWIDTH
    if (!getDef('GSIMAGEWIDTH')) {
        $width = 200;
        //New width of image
    } else {
        $width = getDef('GSIMAGEWIDTH');
    }
    generate_thumbnail($file, $subpath, 'thumbnail.' . $file, $width);
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:17,代码来源:template_functions.php


示例13: changedataAjaxSave

    }
    // if ajax we are done
    changedataAjaxSave($url, $oldslug);
    // redirect user back to edit page or redirectto
    if (isset($_POST['redirectto']) && $_POST['redirectto'] != '') {
        $redirect_url = $_POST['redirectto'];
    } else {
        $redirect_url = 'edit.php';
    }
    if ($pageIsNew) {
        $redirect_url .= "?id=" . $url . "&upd=edit-success&type=new";
    }
    // new page
    if ($slugHasChanged) {
        $redirect_url .= "?id=" . $url . "&old=" . $oldslug . "&upd=edit-success&type=edit";
    } else {
        $redirect_url .= "?id=" . $url . "&upd=edit-success&type=edit";
    }
    // update
    if ($draft) {
        $redirect_url .= "&upd-draft";
    }
    // add nodraft arg if we are force editing a live page
    if (getDef('GSUSEDRAFTS', true) && !$draft) {
        $redirect_url .= '&nodraft';
    }
    redirect($redirect_url);
} else {
    // nothing submitted
    redirect('pages.php');
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:changedata.php


示例14: find_accesskey

    echo find_accesskey(i18n_r('ASK_DELETE_ALL'));
    ?>
" class="confirmation"  ><?php 
    i18n('ASK_DELETE_ALL');
    ?>
</a>
					<?php 
    exec_action(get_filename_id() . '-edit-nav');
    ?>
				</div>
				<div id="filter-search">
					<form><input type="text" autocomplete="off" class="text" id="q" placeholder="<?php 
    echo strip_tags(lowercase(i18n_r('FILTER')));
    ?>
..." /> &nbsp; <a href="<?php 
    echo getDef('GSDEFAULTPAGE');
    ?>
" class="cancel"><?php 
    i18n('CANCEL');
    ?>
</a></form>
				</div>
				<?php 
    exec_action(get_filename_id() . '-body');
    ?>
				
				<table id="editpages" class="highlight paginate">
					<thead>
						<tr><th><?php 
    i18n('PAGE_TITLE');
    ?>
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:31,代码来源:backups.php


示例15: explode

    $widepages = explode(',', getDef('GSWIDEPAGES'));
    // get ids of pages that are wide
    $widepagecss = '';
    if ($width == '0' or $width == '') {
        $width = 'none';
    }
    // allow for no max-width
    // set max width for wide pages using custom wide width
    foreach ($widepages as $pageid) {
        $widepagecss .= "#{$pageid} .wrapper {max-width: {$width_wide};}\n";
    }
    include 'css-wide.php';
}
// include custom theme/admin.css if exists
if (file_exists(GSTHEMESPATH . getDef('GSCSSCUSTOMFILE')) && getDef('GSCSSCUSTOMENABLE', true)) {
    include GSTHEMESPATH . getDef('GSCSSCUSTOMFILE');
}
// You can include your own css here
exec_action('style-save');
// @hook style-save called after css files are included before cache is saved
// save cache
$ob_get_contents = ob_get_contents();
save_file($cachefile, cssCompress($ob_get_contents));
ob_end_flush();
/**
* Convert a hexa decimal color code to its RGB equivalent
*
* @param string $hexStr (hexadecimal color value)
* @param boolean $returnAsString (if set true, returns the value separated by the separator character. Otherwise returns associative array)
* @param string $seperator (to separate RGB values. Applicable only if second parameter is true.)
* @return array or string (depending on second parameter. Returns False if invalid hex color value)
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:31,代码来源:style.php


示例16: get_page_meta_desc

/**
 * Get Page Meta Description
 *
 * @since 2.0
 * @uses $metad
 * @uses strip_decode
 *
 * @param bool $echo Optional, default is true. False will 'return' value
 * @return string Echos or returns based on param $echo
 */
function get_page_meta_desc($echo = true)
{
    $metad = getPageGlobal('metad');
    $desc = '';
    if ($metad != '') {
        $desc = encode_quotes(strip_decode($metad));
    } else {
        if (getDef('GSAUTOMETAD', true)) {
            // use content excerpt, NOT filtered
            $desc = strip_decode($content);
            if (getDef('GSCONTENTSTRIP', true)) {
                $desc = strip_content($desc);
            }
            $desc = cleanHtml($desc, array('style', 'script'));
            // remove unwanted elements that strip_tags fails to remove
            $desc = getExcerpt($desc, 160);
            // grab 160 chars
            $desc = strip_whitespace($desc);
            // remove newlines, tab chars
            $desc = encode_quotes($desc);
            $desc = trim($desc);
        }
    }
    $str = exec_filter('metad', $desc);
    // @filter metad (str) meta description in get_page_meta_desc
    return echoReturn($str, $echo);
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:37,代码来源:theme_functions.php


示例17: find_accesskey

echo find_accesskey(i18n_r('MENU_MANAGER'));
?>
" <?php 
check_menu('menu-manager');
?>
><?php 
i18n('MENU_MANAGER');
?>
</a></li>
	<?php 
exec_action("pages-sidebar");
// @hook pages-sidebar sidebar list html output
?>
</ul>

<p id="js_submit_line" ></p>

<?php 
if (get_filename_id() === 'edit') {
    ?>
	<?php 
    if (getDef('GSAUTOSAVE', true)) {
        ?>
	<p id="autosavestatus"><?php 
        echo sprintf(i18n_r("AUTOSAVE_STATUS"), (int) getDef('GSAUTOSAVEINTERVAL'));
        ?>
</p>
	<p id="autosavenotify"></p>
	<?php 
    }
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:31,代码来源:sidebar-pages.php


示例18: floor

        $labelAlphas .= '.label_' . $i . '_' . floor($alpha * 100) . ' {background-color: ' . getRGBA($defaultcolors['label_' . $i], $alpha) . "!important ;}\n";
    }
    $labelAlphas .= "\n";
}
// include main css file css.php
include GSCSSMAINFILE;
// output label alphas
echo "/* label alphas */\n";
echo $labelAlphas;
// if GSTYLEWIDE ( default )
if (isset($_GET['s']) and in_array('wide', explode(',', $_GET['s']))) {
    $width = getDef('GSWIDTH');
    // get page width
    $width_wide = getDef('GSWIDTHWIDE');
    // get wide page width
    $widepages = explode(',', getDef('GSWIDEPAGES'));
    // get ids of pages that are wide
    $widepagecss = '';
    if ($width == '0' or $width == '') {
        $width = 'none';
    }
    // allow for no max-width
    // set max width for wide pages using custom wide width
    foreach ($widepages as $pageid) {
        $widepagecss .= "#{$pageid} .wrapper {max-width: {$width_wide};}\n";
    }
    include 'css-wide.php';
}
// include custom theme/admin.css if exists
if (file_exists(GSTHEMESPATH . GSCSSCUSTOMFILE) && $useadmincss) {
    include GSTHEMESPATH . GSCSSCUSTOMFILE;
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:31,代码来源:style.php


示例19: getPublishedPageHead

function getPublishedPageHead($editing = true, $path = '')
{
    global $id, $draftExists, $pageExists;
    echo '<h3 class="floated">' . ($editing ? i18n_r('PAGE_EDIT_MODE') : i18n_r('CREATE_NEW_PAGE')) . '</h3>';
    if (getDef('GSUSEDRAFTS', true) && $pageExists && getDef('GSSDRAFTSPUBLISHEDTAG', true)) {
        echo '<div class="title label label-ok unselectable">' . i18n_r('LABEL_PUBLISHED') . '</div>';
    }
    echo '<!-- pill edit navigation -->', "\n", '<div class="edit-nav clearfix" >';
    if ($editing) {
        echo '<a class="pageview" href="' . $path . '" target="_blank" accesskey="' . find_accesskey(i18n_r('VIEW')) . '" >' . i18n_r('VIEW') . '</a>';
        if ($path != '') {
            echo '<a class="pageclone" href="pages.php?id=' . $id . '&amp;action=clone&amp;nonce=' . get_nonce("clone", "pages.php") . '" >' . i18n_r('CLONE') . '</a>';
        }
    }
    exec_action(get_filename_id() . '-edit-nav');
    echo "\n</div>";
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:17,代码来源:edit.php


示例20: msgOK

    }
}
# create default 403.xml page
$init = GSDATAOTHERPATH . GSHTTPPREFIX . '403.xml';
$temp = GSADMININCPATH . 'tmp/tmp-403.xml';
if (!file_exists($init)) {
    if (copy($temp, $init)) {
        $message .= msgOK(sprintf(i18n_r('COPY_SUCCESS'), 'tmp/403.xml'));
    } else {
        $message .= msgError(sprintf(i18n_r('COPY_FAILURE'), 'tmp/403.xml'));
    }
}
/* create new folders */
foreach ($create_dirs as $dir) {
    if (!file_exists($dir)) {
        if (getDef('GSCHMOD')) {
            $chmod_value = GSCHMOD;
        } else {
            $chmod_value = 0755;
        }
        $status = mkdir($dir, $chmod_value);
        if ($status) {
            $message .= msgOK(sprintf(i18n_r('FOLDER_CREATED'), $dir));
        } else {
            $error .= msgError(i18n_r('ERROR_CREATING_FOLDER') . "<br /> - {$dir}");
        }
    }
}
# remove the pages.php plugin if it exists.
if (file_exists(GSPLUGINPATH . 'pages.php')) {
    unlink(GSPLUGINPATH . 'pages.php');
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:31,代码来源:update.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getDefVal函数代码示例发布时间:2022-05-15
下一篇:
PHP getDebugBacktrace函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap