本文整理汇总了PHP中Admin::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin::getConfig方法的具体用法?PHP Admin::getConfig怎么用?PHP Admin::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin
的用法示例。
在下文中一共展示了Admin::getConfig方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchString
public static function getSearchString()
{
$getParam = Admin::getConfig('searchQueryParam');
if (!empty($_GET[$getParam])) {
$string = mb_eregi_replace('\\s+', ' ', $_GET[$getParam]);
$string = mb_eregi_replace('\\s+$', '', $string);
$string = mb_eregi_replace('^\\s+', '', $string);
$string = mb_eregi_replace('^\\s+', '', $string);
$string = mb_eregi_replace('[^\\d_\\. ,:\\-\\(\\)\\+\\w]+', '', $string);
if (!empty($string)) {
return $string;
}
}
return '';
}
示例2:
<script src="/<?php
echo Admin::getConfig('sharedDir');
?>
/js/image-picker/image-picker.min.js"></script>
<script src="/<?php
echo Admin::getConfig('sharedDir');
?>
/js/summernote/dist/summernote.js"></script>
<script src="/<?php
echo Admin::getConfig('sharedDir');
?>
/js/tag-it-master/js/tag-it.min.js"></script>
<script src="/<?php
echo Admin::getConfig('sharedDir');
?>
/js/jquery.switcher/switcher.min.js"></script>
<script src="/<?php
echo Admin::getConfig('sharedDir');
?>
/js/script.js"></script>
</head>
<body>
<?php
if (!empty($content)) {
echo $content;
}
?>
</body>
</html>
示例3: getRootDir
public static function getRootDir()
{
return DOCROOT . Admin::getConfig('sharedDir') . DIRECTORY_SEPARATOR . Admin::getConfig('uploadsDir') . DIRECTORY_SEPARATOR . 'public' . DIRECTORY_SEPARATOR;
}
示例4: array_keys
?>
'>
<?php
$pagination = '';
$content = AdminHTML::renderNoneFound();
$data = $model->getData();
$uniqueValues = [];
if (!empty($data)) {
$dataFirstKey = array_keys($data)[0];
$dataKeys = array_keys($data[$dataFirstKey]);
foreach ($dataKeys as $dataKey) {
$uniqueValues[$dataKey] = Model_Admin::getDistinctSubArrayKeyValues($data, $dataKey);
}
Model_Admin::filterData($data, $model);
$countData = count($data);
$perPage = intval(Admin::getConfig('itemsPerPage'));
$pages = ceil($countData / $perPage);
$page = AdminHREF::getPage();
if ($page > $pages) {
$page = $pages;
}
$content = View::factory('Admin/Data/List', ['data' => array_slice($data, ($page - 1) * $perPage, $perPage), 'uniqueValues' => $uniqueValues, 'model' => $model]);
$pagination = View::factory('Admin/Data/Pagination', ['pages' => $pages, 'page' => $page, 'countData' => $countData, 'perPage' => $perPage]);
}
?>
<?php
echo $pagination, $content, $pagination;
?>
</form>
示例5: action_ajaxeditor
public function action_ajaxeditor()
{
if (!empty($_FILES['imageupload']['name'])) {
if (!$_FILES['imageupload']['error']) {
$name = md5($_FILES['imageupload']['name']);
$ext = pathinfo($_FILES['imageupload']['name'], PATHINFO_EXTENSION);
$filename = $name . '.' . $ext;
$destinationDir = Admin::getConfig('sharedDir') . DIRECTORY_SEPARATOR . Admin::getConfig('uploadsDir') . DIRECTORY_SEPARATOR . 'editorUploads' . DIRECTORY_SEPARATOR;
if (!file_exists($destinationDir)) {
mkdir($destinationDir, 0755, true);
}
$destination = $destinationDir . $filename;
if (move_uploaded_file($_FILES["imageupload"]["tmp_name"], $destination)) {
echo AdminHREF::getFullHost() . '/' . $destination;
}
}
}
die;
}
示例6: urlencode
if ($model->isDeletionAllowed()) {
$delHref = AdminHREF::getDefaultAdminRouteUri('ajaxUploadDelete', $model->getShortName(), $params['primary']) . '/?directoryIndex=' . urlencode($directoryIndex) . '&file=' . urlencode(basename($file));
$deletion = '<button ' . 'type="button" ' . 'class="ajaxUploadsDelete" ' . 'confirmText="Вы уверены в удалении?" ' . 'href="' . $delHref . '">' . '<i class="fa fa-trash-o"></i> ' . 'Удалить' . '</button>';
}
?>
<?php
if ($model->isModifyingAllowed()) {
$descriptioning = View::factory('Admin/Data/Edit/Upload/descriptionForm', ['file' => $file, 'reference' => $reference, 'modelName' => $model->getShortName()]);
$makeFirst = View::factory('Admin/Data/Edit/Upload/makeFirstForm', ['reference' => $reference, 'file' => $file, 'modelName' => $model->getShortName()]);
}
?>
<?php
$iconFile = Admin::getFileExtension($file) . '.png';
$iconPath = Admin::getConfig('sharedDir') . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'exts' . DIRECTORY_SEPARATOR;
if (!file_exists(DOCROOT . $iconPath . $iconFile)) {
$iconFile = 'file.png';
}
$icon = '/' . mb_eregi_replace('\\\\', '/', $iconPath . $iconFile);
?>
<a target='blank'
title='<?php
echo basename($file);
?>
'
class='<?php
echo $class;
?>
'
示例7: intval
<?php
$spaces = intval(Admin::getConfig('paginationLinksCount'));
if (!is_numeric($spaces) || $spaces < 2) {
$spaces = 2;
}
if ($spaces % 2 !== 0) {
++$spaces;
}
$getParam = Admin::getConfig('pageQueryParam');
?>
<nav class="navbar navbar-default adminPagination" role="navigation">
<ul class="nav navbar-nav">
<li>
<?php
$countCaption = '';
if ($countData > 0) {
$countCaption = 'Объектов: ' . $countData;
if ($pages > 1) {
$countCaption = $countCaption . ', страниц: ' . $pages;
}
} else {
$countCaption = 'Объектов не найдено';
}
?>
<a><?php
echo $countCaption;
?>
</a>
</li>
示例8: natcasesort
<?php
$unfiltered = [];
if (method_exists($model, 'getUnfilteredColumns')) {
$unfiltered = $model->getUnfilteredColumns();
}
if (in_array($key, $unfiltered) || count($values) < 2) {
echo $key;
} else {
$prefix = Admin::getConfig('filterQueryPrefix');
$values = array_unique($values);
natcasesort($values);
$values = array_combine(array_values($values), $values);
$selected = null;
$filterParams = AdminHREF::getFilterParams();
if (isset($filterParams[$key])) {
$selected = $filterParams[$key];
}
$attrs = ['multiple' => 'multiple', 'class' => 'sumoselect', 'placeholder' => $key];
echo Form::select($prefix . AdminHREF::$prefixSeparator . $key . '[]', $values, $selected, $attrs);
}
示例9: getPreviewsDir
private static function getPreviewsDir()
{
$sharedDir = Admin::getConfig('sharedDir');
$previewDir = Admin::getConfig('previewsDir');
return DOCROOT . $sharedDir . DIRECTORY_SEPARATOR . $previewDir . DIRECTORY_SEPARATOR;
}