本文整理汇总了PHP中string::clearBoth方法的典型用法代码示例。如果您正苦于以下问题:PHP string::clearBoth方法的具体用法?PHP string::clearBoth怎么用?PHP string::clearBoth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类string
的用法示例。
在下文中一共展示了string::clearBoth方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadEngine
function loadEngine()
{
if (self::$sections[0] == string::clearBoth(SYS_DIR)) {
self::$engine = 'admin';
} elseif (SYS_DIR == '/') {
self::$engine = 'admin';
}
if (!self::$engine) {
// load boot.ini
$ini = ini::parse(SYS_ROOT . 'conf/global/boot.ini');
if ($ini) {
self::$engine = arrays::returnValue($ini, self::$sections[0]);
}
}
if (!self::$engine) {
self::$engine = 'web';
}
define('ENGINE', self::$engine);
}
示例2: adminMenu
function adminMenu()
{
$menu = array();
$menu_tmpl = '';
$array = ini::parse(SYS_ROOT . 'conf/admin/menu.ini');
foreach ($array as $k => $v) {
$points_t = explode('::', $k);
$v['name'] = trim($points_t[1]);
if (self::$apps_excl) {
if (!isset(self::$apps_excl[$v['app']])) {
continue;
}
}
$points[trim($points_t[0])][] = $v;
}
foreach ($points as $k => $v) {
$point_tmpl = '';
foreach ($v as $d => $f) {
$class = '';
if ($f['separator'] == '1') {
$class = 'separator';
}
if (!strstr($f['link'], 'http://')) {
$f['link'] = SYS_DIR . string::clearBoth($f['link']) . '/';
}
$point_tmpl .= '<li class="' . $class . '"><a href="' . $f['link'] . '">' . $f['name'] . '</a></li>';
}
if ($point_tmpl) {
$point_class = '';
$menu_tmpl .= '<li class="' . $point_class . '"><a href="javascript:void(null)" class="navs">' . $k . '</a><ul class="sub_menu" style="display: none;">' . $point_tmpl . '</ul></li>';
}
}
s::set('admin_menu', $menu_tmpl);
}
示例3: addPoint
function addPoint()
{
$menu_id = params::get('menu_id');
$page_id = params::get('page_id');
if ($page_id == 0) {
$point_link = params::get('point_link');
if (strstr($point_link, 'http://') === false) {
$point_link = string::addSlashes(string::clearBoth(params::get('point_link')));
}
} else {
db::table('pages');
db::where('page_id', $page_id);
$point_link = db::get('page_folder');
}
$array = array('point_parent' => 0, 'point_name' => params::get('point_name'), 'point_link' => $point_link, 'point_order' => 0, 'point_pub' => '1', 'point_tmpl_link' => params::get('point_tmpl_link'), 'point_tmpl_act' => params::get('point_tmpl_act'), 'point_tmpl_inact' => params::get('point_tmpl_inact'), 'menu_id' => $menu_id, 'site_id' => ADMIN_SITE_ID);
db::table('menus_points');
db::smartInsert($array);
self::showPoints($menu_id);
}
示例4: getPointLink
function getPointLink($v, $menu_name)
{
$active = false;
if (URI_SELF == $v['point_link']) {
$active = true;
}
$inactive = false;
$count_this = explode('/', string::clearBoth($v['point_link']));
$count_inner = router::gets();
$count_this2 = count($count_this);
if ($count_this2 == 1) {
if ($count_this2 < count($count_inner) && $count_this[0] == $count_inner[0]) {
$inactive = true;
}
}
if ($active) {
if ($v['point_tmpl_act']) {
$v['menu_tmpl_link'] = $v['point_tmpl_act'];
} else {
$v['menu_tmpl_link'] = $v['menu_tmpl_act'];
}
} else {
if ($inactive) {
if (!empty($v['menu_tmpl_inact']) || !empty($v['point_tmpl_inact'])) {
if ($v['point_tmpl_inact']) {
$v['menu_tmpl_link'] = $v['point_tmpl_inact'];
} else {
$v['menu_tmpl_link'] = $v['menu_tmpl_inact'];
}
} else {
if ($v['point_tmpl_link']) {
$v['menu_tmpl_link'] = $v['point_tmpl_link'];
}
}
} else {
if ($v['point_tmpl_link']) {
$v['menu_tmpl_link'] = $v['point_tmpl_link'];
}
}
}
return $v;
}
示例5: edit
function edit()
{
events::observe('save', 'pages', 'savePage');
events::observer();
if (events::detect('save')) {
return true;
}
if (events::detect('restore')) {
self::restoreVersion(events::get('restore'));
}
admin::components('tabs', 'validator', 'upload');
if (settings::get('pages', 'redactor')) {
admin::components('redactor');
s::section('redactor');
}
$page_id = admin::get('id');
appPages::getPagesSelect(ADMIN_SITE_ID, $page_id);
appPages::getParentPages(ADMIN_SITE_ID, true);
appTemplates::getTmpls(ADMIN_SITE_ID);
db::table('pages');
db::where('page_id', $page_id);
$row = db::assoc();
s::set('page_link', '<a href="' . self::getUrl($row['page_folder']) . '">Посмотреть страницу на сайте</a>');
if ($row['page_dynamic'] == '1') {
$row['page_folder'] = '';
} else {
if ($row['page_folder'] != '/') {
$row['page_folder'] = string::clearBoth($row['page_folder']);
$arr = explode('/', $row['page_folder']);
$row['page_folder'] = arrays::lastValue($arr);
}
}
f::set('page_content', $row['page_content'], 0);
f::set($row);
s::set('page_id', $page_id);
db::table('pages_files');
db::where('page_id', $page_id);
$r = db::select();
while ($a = mysql_fetch_assoc($r)) {
$a['file_type'] = files::getFileIco($a['file_type']);
s::roll('page_files', $a);
}
/*
Load versions
*/
db::table('pages_versions');
db::where('page_id', $page_id);
db::order('version_date', 'DESC');
$res = db::select();
$versions = array();
while ($row = mysql_fetch_assoc($res)) {
$versions[$row['version_date']][$row['content_id']] = array('version_id' => $row['version_id'], 'content_id' => $row['content_id'], 'version_content' => $row['version_content']);
}
foreach ($versions as $k => $v) {
s::roll('versions', array('date' => dt::date2print('%H:%i:%s %d.%m.%Y', $k), 'version_date' => $k, 'id' => md5($k)));
foreach ($v as $d => $f) {
$f['version_content'] = htmlspecialchars('{non}' . $f['version_content'] . '{/non}');
s::roll('versions_' . md5($k), $f);
}
}
}
示例6: getError404
function getError404()
{
$err = false;
if (self::get('page_pub') == '0') {
$err = true;
}
// 404
if (!self::$page) {
$err = true;
} else {
if (PAGE_HANDLER) {
$err = false;
} else {
$arr = explode('/', string::clearBoth(self::$page['page_folder']));
$rarr = explode('/', string::clearBoth(URI_SELF));
if (count($arr) != count($rarr)) {
$err = true;
}
if (empty($arr[0]) && !empty($rarr[0])) {
$err = true;
}
}
}
return $err;
}