public function getHREF() { $dir = $this->getUploadDir(); $dir = array_keys($dir); $dir = array_pop($dir); return AdminHREF::getDefaultAdminRouteUri('dataEdit', $this->getShortName()) . '/' . urlencode($dir) . '/?ref=' . urlencode(AdminHREF::getFullCurrentHREF()); }
public function getActionButtons() { $buttons = parent::getActionButtons(); $ref = urlencode(AdminHREF::getFullCurrentHREF()); $changePass = function ($row) use($ref) { $href = AdminHREF::getDefaultAdminRouteUri('dataEdit', 'UsersPasswords', $row['id']) . '/?ref=' . $ref; $text = '<i class="fa fa-lock gc"></i>'; return '<a title="Сменить пароль" href="' . $href . '">' . $text . '</a>'; }; $changeRoles = function ($row) use($ref) { $href = AdminHREF::getDefaultAdminRouteUri('dataEdit', 'UsersRoles', $row['id']) . '/?ref=' . $ref; $text = '<i class="fa fa-user-secret gc"></i>'; return '<a title="Роли пользователя" href="' . $href . '">' . $text . '</a>'; }; $loginUser = function ($row) use($ref) { $href = AdminHREF::getDefaultAdminRouteUri('loginuser', 'users', $row['id']); $text = '<i class="fa fa-sign-in gc"></i>'; return '<a title="Войти от имени пользователя" href="' . $href . '">' . $text . '</a>'; }; $buttons['Роли пользователя'] = $changeRoles; $buttons['Сменить пароль'] = $changePass; $buttons['Войти'] = $loginUser; return $buttons; }
<?php if (!empty($caption)) { ?> <div class="captionDiv"> <h4><?php echo $caption; ?> </h4> </div> <?php } ?> <div class="list-group"> <?php foreach ($values as $key => $value) { ?> <a class='list-group-item' href='<?php echo AdminHREF::getFullCurrentHREF() . '/' . $key; ?> '> <?php echo $value; ?> </a> <?php } ?> </div>
public function getActionButtons() { $buttons = []; $ref = urlencode(AdminHREF::getFullCurrentHREF()); $edit = function ($row) use($ref) { $href = AdminHREF::getDefaultAdminRouteUri('dataEdit', $this->getShortName(), $row['id']) . '/?ref=' . $ref; $text = '<i class="fa fa-pencil gc"></i>'; return '<a class="editHref" title="Редактировать" href="' . $href . '">' . $text . '</a>'; }; $delete = function ($row) use($ref) { $href = AdminHREF::getDefaultAdminRouteUri('dataDelete', $this->getShortName(), $row['id']) . '/?ref=' . $ref; $text = '<i class="fa fa-trash-o gc"></i>'; return '<a class="delHref confirm" title="Удалить" confirmText="Вы уверены в удалении товара?" href="' . $href . '">' . $text . '</a>'; }; if ($this->isModifyingAllowed()) { $buttons['Редактировать'] = $edit; } if ($this->isDeletionAllowed()) { $buttons['Удалить'] = $delete; } return $buttons; }
_loading); } }, onError: function (files, status, errMsg) { $('#<?php echo $uid; ?> _load').remove(); }, afterUploadAll: function () { $('#<?php echo $uid; ?> _load').remove(); var url = "<?php echo AdminHREF::getDefaultAdminRouteUri('ajaxUploadsContent', $model->getShortName(), $params['primary']) . '/?directoryIndex=' . urlencode($directoryIndex); ?> "; $.post(url, {ref: document.location.href}, function (data) { $('#<?php echo $uid; ?> _content').children().replaceWith(data); }); }, }); }); </script> <div id="<?php echo $uid; ?>
public static function goLogout() { Common::redirect(AdminHREF::getDefaultAdminRouteUri('logout')); }
foreach ($files as $file) { $descriptioning = Upload::getDescription($file); ?> <div class='upload'> <?php $class = 'otherUpload'; if (Admin::isImageFile($file)) { $class = 'imageUpload'; } elseif (Admin::isAudioFile($file)) { $class = 'audioUpload'; } ?> <?php 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)) {
public function getHREF() { return AdminHREF::getDefaultAdminRouteUri('fileman', 'Fileman'); }
public function getHREF() { return AdminHREF::getDefaultAdminRouteUri('data', $this->getShortName()); }
<div class="authFormNew"> <form role="form" action='<?php echo AdminHREF::getDefaultAdminRouteUri('auth'); ?> ?ref=<?php echo urlencode(AdminHREF::getFullCurrentHREF()); ?> ' method="post"> <?php if (!empty($embed)) { ?> <div class="alert alert-info"> Для оформления заказа войдите на сайт или зарегистрируйтесь </div> <?php } ?> <?php if (empty($embed)) { ?> <div class="form-group"> <h4 class="text-center"> <i class="fa fa-lock"></i> Вход на сайт </h4> </div> <?php
public function getHREF() { return AdminHREF::getDefaultAdminRouteUri('dataEdit', $this->getShortName(), Auth::instance()->get_user()) . '?ref=' . urlencode(AdminHREF::getFullCurrentHREF()); }
?> </h4> <p> <?php echo AdminHTML::renderField($columnName, $column, isset($post[$columnName]) ? $post[$columnName] : null, ['class' => 'form-control']); ?> </p> </div> <?php } ?> <?php $href = AdminHREF::getDefaultAdminRouteUri('data', $model->getShortName()); if (method_exists($model, 'getInsertBackHref')) { $href = $model->getInsertBackHref(); } ?> <a href="<?php echo $href; ?> " class='btn btn-default'> <i class="fa fa-mail-reply"></i> Вернуться к списку </a> <button type='submit' class='btn btn-warning fieldsSave'> <i class="fa fa-floppy-o"></i> Добавить
</a> </li> <?php } ?> <?php if ($pages > $spaces) { ?> <?php //last page $href = AdminHREF::getFullCurrentHREF([], [$getParam => $pages]); ?> <li<?php echo AdminHREF::isActiveHREF($href, $page == $pages) ? ' class="active" ' : ''; ?> > <a href="<?php echo $href; ?> ">Последняя →</a> </li> <?php } ?> <?php } ?>
<?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); }
if (!is_dir($application) and is_dir(DOCROOT . $application)) { $application = DOCROOT . $application; } if (!is_dir($modules) and is_dir(DOCROOT . $modules)) { $modules = DOCROOT . $modules; } if (!is_dir($system) and is_dir(DOCROOT . $system)) { $system = DOCROOT . $system; } define('APPPATH', realpath($application) . DIRECTORY_SEPARATOR); define('MODPATH', realpath($modules) . DIRECTORY_SEPARATOR); define('SYSPATH', realpath($system) . DIRECTORY_SEPARATOR); define('COMPOSERPATH', realpath($composer) . DIRECTORY_SEPARATOR); unset($application, $modules, $system, $composer); require APPPATH . 'bootstrap' . EXT; if (AdminHREF::getSubdomain() == 'dev') { define('DEV', true); define('PRODUCTION', false); } else { define('DEV', false); define('PRODUCTION', true); } if (PHP_SAPI == 'cli') { class_exists('Minion_Task') or die('Please enable the Minion module for CLI support.'); set_exception_handler(['Minion_Exception', 'handler']); Minion_Task::factory(Minion_CLI::options())->execute(); } else { $request = Request::factory(true, [], false)->execute()->send_headers(true)->body(); $request = \Zver\StringHelper::load($request)->trimSpaces(); //$error = $request->getClone() // ->getPosition('#kohana_error');
<div class="authFormNew"> <form role="form" action='<?php echo AdminHREF::getDefaultAdminRouteUri('register'); ?> ' method="post"> <div class="form-group"> <h4 class="text-center"> <i class="fa fa-lock"></i> Регистрация </h4> </div> <?php if (!empty($error)) { echo AdminHTML::renderMessage($error, 'danger'); } ?> <div class="form-group"> <label for="email" class="control-label"> Email: </label> <div> <input type="email" name="email" required class="form-control" id="email" placeholder="Введите имя пользователя..." value='<?php echo $email;
<nav class="navbar navbar-default" role="navigation"> <ul class="nav navbar-nav"> <?php if (!empty($items)) { foreach ($items as $item) { ?> <li<?php echo AdminHREF::isActiveHREF($item['href']) ? ' class="active" ' : ''; ?> > <a href="<?php echo $item['href']; ?> " <?php echo empty($item['target']) ? '' : ' target="' . $item['target'] . '"'; ?> > <?php if (!empty($item['icon'])) { echo $item['icon']; } ?> <?php echo $item['caption']; ?> </a>
} ?> <?php if (count($months) > 1) { ?> <ul class="nav nav-pills"> <?php foreach ($months as $month) { ?> <li role="presentation" class="<?php echo $month == $currentMonth ? 'active' : ''; ?> "> <a href="<?php echo AdminHREF::getFullCurrentHREF([], ['year' => $currentYear, 'month' => $month]); ?> "> <?php echo FieldString::translateMonthRuFromNumber($month); ?> </a> </li> <?php } ?> </ul> <?php } ?>
?> '> <?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>
<?php $filterParams = AdminHREF::getFilterParams(); if (!empty($filterParams)) { $filt = array_keys($filterParams); foreach ($filt as $key => &$f) { $f = '<span class="filter_tag">' . $f . '</span>'; } unset($f); echo AdminHTML::renderMessage('Задан фильтр по полям: ' . implode(' ', $filt) . '<a href="' . AdminHREF::getNoFilterParamsHREF() . '">Сбросить все фильтры</a>', 'info'); } ?> <?php echo Admin::showMessage(); ?> <table class="table table-striped table-bordered table-hover"> <?php $keys = array_keys($uniqueValues); ?> <?php $hiddenColumns = []; if (method_exists($model, 'getHiddenColumns')) { $hiddenColumns = $model->getHiddenColumns(); } ?>