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


PHP getDef函数代码示例

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


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


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