/** * Prepare HTML DOM link (a href) to user with him name or guest name without link * @param int $userId * @param string $onEmpty * @param string $controllerAction * @return string */ public static function parseUserLink($userId = null, $onEmpty = 'guest', $controllerAction = 'profile/show') { $nick = self::parseUserNick($userId, $onEmpty); // new name is not found, lets return default if ($nick === $onEmpty || (int) $userId < 1) { return $nick; } return Url::link([$controllerAction, (int) $userId], $nick); }
$data = (new EntityCommentData($comment, false))->make(); ?> <ul class="media-list"> <li class="media"> <ul class="list-inline list-info"> <li><i class="fa fa-calendar"></i> <?php echo Date::humanize($data['date']); ?> </li> <li><i class="fa fa-user"></i> <?php if ((int) $data['user']['id'] > 0) { ?> <?php echo Url::link(['profile/show', $data['user']['id']], $data['user']['name']); ?> <?php } else { ?> <?php echo $data['user']['name']; ?> <?php } ?> </li> </ul> </li> <li class="media"> <span class="pull-left">
<?php use Ffcms\Core\Helper\Url; /** @var \Apps\ActiveRecord\ContentTag $records */ ?> <?php foreach ($records as $row) { echo Url::link(['content/tag', $row['tag']], $row['tag'], ['class' => 'label label-default']) . ' '; }
<hr /> <p class="alert alert-warning"><?php echo __('This social account: %profile% used first time in our website. Please, complete form below', ['profile' => $model->profileLink]); ?> </p> <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post', 'action' => '']); ?> <?php echo $form->start(); ?> <?php echo $form->field('login', 'text', ['class' => 'form-control'], __('Enter your username for future use on the site')); echo $form->field('email', 'text', ['class' => 'form-control'], __('Enter your e-mail for an account')); echo $form->field('password', 'password', ['class' => 'form-control'], __('Enter a password for your account. It should be longer than 3 characters')); echo $form->field('repassword', 'password', ['class' => 'form-control'], __('Repeat your password to be sure it correct')); ?> <div class="col-md-9 col-md-offset-3"> <?php echo $form->submitButton(__('Register and sign in'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['user/login'], __('Cancel'), ['class' => 'btn btn-default']); ?> </div> <?php echo $form->finish();
var first_msg = []; window.jQ.push(function(){ $(function(){ var userListDom = $('#msg-user').clone(); var dialogPanelDom = $('#dialog-title').clone(); var myMsgDom = $('#msg-owner').clone(); var remMsgDom = $('#msg-remote').clone(); // load users with active dialog $.fn.loadDialogUsers = function() { $.getJSON(script_url+'/api/profile/listmessagedialog/'+dialog_offset+'/'+new_dialog+'/?lang='+script_lang, function(response){ if (response.status === 1) { if (response.data.length < 1) { $('#msg-layout').after('<p><?php echo __('You have no active dialogs. Find users to message with: %u%', ['u' => Url::link(['profile/index', 'all'], __('user list'))]); ?> </p>'); $('#msg-layout').remove(); return false; } var userMap = ''; $('.media-person').removeClass(cssUserList.active); $.each(response.data, function(key, row){ var itemClass = cssUserList.default; if (row.user_id == active_dialog_id) { itemClass += ' '+cssUserList.active; } if (row.user_block == true) { itemClass += ' '+cssUserList.blocked; }
<?php echo Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name') . '(id' . $profile->user_id . ')' : $profile->nick); ?> </h3> <p><?php echo __('Registered'); ?> : <?php echo Date::convertToDatetime($profile->created_at, Date::FORMAT_TO_DAY); ?> </p> <?php if (\App::$User->identity() !== null && $profile->user_id !== \App::$User->identity()->getId()) { ?> <?php echo Url::link(['profile/messages', null, null, ['newdialog' => $profile->user_id]], '<i class="fa fa-pencil-square-o"></i> ' . __('New message'), ['class' => 'btn btn-info']); ?> <?php } ?> </div> <div class="col-md-2"> <div class="h3 pull-right"> <?php $markLabel = 'badge'; if ($profile->rating > 0) { $markLabel = 'alert-success'; } elseif ($profile->rating < 0) { $markLabel = 'alert-danger'; } ?>
echo __('Feedback message #%id%', ['id' => $post->id]); ?> </h1> <?php if (\App::$User->isAuth()) { echo $this->render('feedback/_authTabs'); } else { echo "<hr />"; } ?> <?php if ((int) $post->closed === 0 && \App::$User->isAuth()) { $user = App::$User->identity(); if ($user->getId() === (int) $post->user_id) { echo '<div class="pull-right">' . Url::link(['feedback/close', $post->id, $post->hash], __('Close request'), ['class' => 'btn btn-danger']) . '</div>'; } } ?> <div class="row"> <div class="col-md-12"> <div class="panel panel-info"> <div class="panel-heading"> <strong><?php echo $post->name; ?> (<?php echo $post->email; ?> )</strong>,
?> <h2><?php echo __('List of blocked users'); ?> </h2> <hr /> <?php if ($records !== null && $records->count() > 0) { ?> <?php $items = []; foreach ($records as $row) { $userProfile = $row->getUser()->getProfile(); $userNick = \Ffcms\Core\Helper\Simplify::parseUserNick($userProfile->user_id, __('No name')); $items[] = [['text' => Url::link(['profile/show', $row->target_id], $userNick, ['target' => '_blank']), 'html' => true], ['text' => $row->comment], ['text' => Date::convertToDatetime($row->created_at, Date::FORMAT_TO_DAY)], ['text' => Url::link(['profile/unblock', $row->target_id], '<i class="fa fa-times"></i>'), 'html' => true, 'property' => ['class' => 'text-center']]]; } ?> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => __('User')], ['text' => __('Comment')], ['text' => __('Add date')], ['text' => __('Actions')]]], 'tbody' => ['items' => $items]]); ?> <div class="text-center"> <?php echo $pagination->display(['class' => 'pagination pagination-centered']); ?> </div> <?php } else { ?>
} return; } foreach ($records as $profile) { ?> <div class="row" style="padding-top: 10px;"> <div class="col-md-2"> <div class="text-center"><img src="<?php echo $profile->getAvatarUrl('small'); ?> " class="img-responsive img-circle img-thumbnail"/></div> </div> <div class="col-md-8"> <h3> <?php echo Url::link(['profile/show', $profile->user_id], Str::likeEmpty($profile->nick) ? __('No name') : $profile->nick); ?> </h3> <p><?php echo __('Registered'); ?> : <?php echo Date::convertToDatetime($profile->created_at, Date::FORMAT_TO_DAY); ?> </p> </div> <div class="col-md-2"> <h3 class="pull-right"> <?php $markLabel = 'badge'; if ($profile->rating > 0) {
<div class="col-md-9"> <pre> if (<?php echo $model->reg_cond == 0 ? '!' : null; ?> preg_match('<?php echo $model->reg_exp; ?> ', $input)) { // validation passed } else { // validation failed } </pre> </div> </div> <?php } ?> <div class="col-md-9 col-md-offset-3"> <?php echo $form->submitButton(__('Save'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['profile/fieldlist'], __('Cancel'), ['class' => 'btn btn-default']); ?> </div> <?php echo $form->finish();
use Ffcms\Core\Helper\Type\Str; use Ffcms\Core\Helper\Url; $this->title = __('Profile list'); $this->breadcrumbs = [Url::to('main/index') => __('Main'), Url::to('application/index') => __('Applications'), __('Profile')]; ?> <?php echo $this->render('profile/_tabs'); ?> <h1><?php echo __('Profile list'); ?> </h1> <hr /> <?php $items = []; foreach ($records as $profile) { $items[] = [['text' => $profile->id], ['text' => $profile->User()->login . '/' . $profile->User()->email], ['text' => $profile->nick], ['text' => Str::startsWith('0000-', $profile->birthday) ? __('None') : Date::convertToDatetime($profile->birthday)], ['text' => ($profile->rating > 0 ? '+' : null) . $profile->rating], ['text' => Url::link(['profile/update', $profile->id], '<i class="fa fa-pencil fa-lg"></i> ') . Url::link(['user/delete', $profile->User()->id], '<i class="fa fa-trash-o fa-lg"></i>'), 'html' => true, 'property' => ['class' => 'text-center']]]; } ?> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => 'id'], ['text' => 'login/email'], ['text' => __('Nickname')], ['text' => __('Birthday')], ['text' => __('Rating')], ['text' => __('Actions')]]], 'tbody' => ['items' => $items]]); ?> <div class="text-center"> <?php echo $pagination->display(['class' => 'pagination pagination-centered']); ?> </div>
?> </h1> <hr /> <?php $items = []; foreach ($records as $role) { $permissions = explode(';', $role->permissions); $permissionsLabel = null; foreach ($permissions as $perm) { $labelMark = null; if (Str::startsWith('admin/', $perm)) { $labelMark = 'label-warning'; } elseif ($perm === 'global/all') { $labelMark = 'label-danger'; } else { $labelMark = 'label-default'; } $permissionsLabel .= '<span class="label ' . $labelMark . '">' . $perm . '</span> '; } $items[] = [['text' => $role->id], ['text' => $role->name], ['text' => $permissionsLabel, 'html' => true], ['text' => Url::link(['user/groupupdate', $role->id], '<i class="fa fa-pencil fa-lg"></i>'), 'property' => ['class' => 'text-center'], 'html' => true]]; } ?> <div class="pull-right"><?php echo Url::link(['user/groupupdate', '0'], __('Add group'), ['class' => 'btn btn-primary']); ?> </div> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => 'id'], ['text' => __('Name')], ['text' => __('Permissions')], ['text' => __('Actions')]], 'property' => ['id' => 'thead_main']], 'tbody' => ['items' => $items]]);
<h1><?php echo __('Feedback requests'); ?> </h1> <?php echo $this->render('feedback/_authTabs'); ?> <?php if ($records->count() < 1) { echo '<p class="alert alert-warning">' . __('No requests is founded') . '</p>'; return; } $items = []; foreach ($records as $item) { $items[] = [['text' => $item->id], ['text' => Url::link(['feedback/read', $item->id, $item->hash], Text::cut($item->message, 0, 40)), 'html' => true], ['text' => (int) $item->closed === 1 ? '<span class="label label-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', 'html' => true, '!secure' => true], ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)], ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)]]; } ?> <?php echo \Ffcms\Core\Helper\HTML\Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Message')], ['text' => __('Status')], ['text' => __('Created')], ['text' => __('Updated')]]], 'tbody' => ['items' => $items]]); ?> <div class="text-center"> <?php echo $pagination->display(['class' => 'pagination pagination-centered']); ?> </div>
?> <h1><?php echo __('Feedback list'); ?> </h1> <hr /> <?php if ($records === null || $records->count() < 1) { echo '<p class="alert alert-warning">' . __('Feedback requests is empty now!') . '</p>'; return; } $items = []; foreach ($records as $item) { /** @var \Apps\ActiveRecord\FeedbackPost $item*/ $items[] = [['text' => $item->id . ((int) $item->readed !== 1 ? ' <i class="fa fa-bell alert-info"></i>' : null), 'html' => true], ['text' => Url::link(['feedback/read', $item->id], Text::snippet($item->message, 40, false)), 'html' => true], ['text' => $item->getAnswers()->count()], ['text' => $item->email], ['text' => (int) $item->closed === 1 ? '<span class="label label-danger">' . __('Closed') . '</span>' : '<span class="label label-success">' . __('Opened') . '</span>', 'html' => true, '!secure' => true], ['text' => Date::convertToDatetime($item->updated_at, Date::FORMAT_TO_HOUR)], ['text' => Url::link(['feedback/read', $item->id], '<i class="fa fa-list fa-lg"></i> ') . Url::link(['feedback/delete', 'post', $item->id], '<i class="fa fa-trash-o fa-lg"></i>'), 'html' => true, 'property' => ['class' => 'text-center']]]; } ?> <div class="table table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Text')], ['text' => __('Answers')], ['text' => __('Author')], ['text' => __('Status')], ['text' => __('Date')], ['text' => __('Actions')]]], 'tbody' => ['items' => $items]]); ?> </div> <p><i class="fa fa-bell alert-info"></i> = <?php echo __('New request or new answer in feedback topic'); ?> </p> <div class="text-center">
$class = 'label-danger'; $tooltip = __('Location: %loc%. Required permissions: +rw', ['loc' => $dir]); } echo '<span class="label ' . $class . '" data-toggle="tooltip" title="' . $tooltip . '">' . $dir . '</span> '; } ?> <hr /> <?php echo __('All directories and files in this list required to be readable and writable.'); ?> <hr /> <?php echo \Ffcms\Core\Helper\Url::link(['main/cache'], __('Clear cache'), ['class' => 'btn btn-warning']); ?> <?php echo \Ffcms\Core\Helper\Url::link(['main/sessions'], __('Clear sessions'), ['class' => 'btn btn-info']); ?> </div> </div> </div> <div class="col-md-4"> <div class="panel panel-default"> <div class="panel-heading"> <?php echo __('FFCMS News'); ?> <a href="https://ffcms.org" class="label label-success" target="_blank"><?php echo __('Official website'); ?> </a> </div>
<?php use Ffcms\Core\Helper\Date; use Ffcms\Core\Helper\HTML\Table; use Ffcms\Core\Helper\Url; /** @var \Apps\ActiveRecord\FeedbackPost|\Apps\ActiveRecord\FeedbackAnswer $record */ /** @var \Apps\Model\Admin\Feedback\FormAnswerAdd|null $model */ $this->title = __('Feedback delete'); $this->breadcrumbs = [Url::to('main/index') => __('Main'), Url::to('application/index') => __('Applications'), Url::to('feedback/index') => __('Feedback'), __('Delete message')]; echo $this->render('feedback/_tabs'); ?> <h1><?php echo __('Delete feedback message'); ?> </h1> <hr /> <div class="table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'tbody' => ['items' => [[['text' => __('Sender')], ['text' => $record->name . ' (' . $record->email . ')']], [['text' => __('Date')], ['text' => Date::convertToDatetime($record->created_at, Date::FORMAT_TO_HOUR)]], [['text' => __('Message')], ['text' => $record->message]]]]]); ?> </div> <form action="" method="post"> <input type="submit" name="deleteFeedback" value="<?php echo __('Delete'); ?> " class="btn btn-danger" /> <?php echo Url::link(['feedback/index'], __('Cancel'), ['class' => 'btn btn-default']); ?> </form>
echo $post->id; ?> " class="show-wall-response"> <?php echo __('Answers'); ?> (<span id="wall-post-response-count-<?php echo $post->id; ?> ">0</span>) </a> <?php if ($post->target_id === $viewer->id || $post->sender_id === $viewer->id) { ?> <?php echo Url::link(['profile/walldelete', $post->id], __('Delete'), ['class' => 'pull-right']); ?> <?php } ?> </div> <div id="wall-answer-dom-<?php echo $post->id; ?> " class="hidden"></div> </div> </div> <?php } } ?>
$pathProperty['disabled'] = ''; } else { echo $form->field('dependId', 'select', ['class' => 'form-control', 'options' => $model->categoryList(), 'optionsKey' => true], __('Select owner category for this category')); } ?> <?php echo $form->field('path', 'text', $pathProperty, __('Enter category path slug for URI building')); echo $form->field('configs.showDate', 'checkbox', null, __('Display dates of content in this category?')); echo $form->field('configs.showRating', 'checkbox', null, __('Display rating for items in this category?')); echo $form->field('configs.showCategory', 'checkbox', null, __('Display current category for content?')); echo $form->field('configs.showSimilar', 'checkbox', null, __('Show the similar content items for this category? This option introduce additional system load and memory usage.')); echo $form->field('configs.showAuthor', 'checkbox', null, __('Display information about content authors in this category?')); echo $form->field('configs.showViews', 'checkbox', null, __('Display information about content view count in this category?')); echo $form->field('configs.showComments', 'checkbox', null, __('Display comment list and comment form in this category?')); echo $form->field('configs.showPoster', 'checkbox', null, __('Display content poster from gallery in this category?')); echo $form->field('configs.showTags', 'checkbox', null, __('Display tag list, based on keywords data?')); echo $form->field('configs.showRss', 'checkbox', null, __('Allow display RSS 2.0 feed for this category?')); ?> <div class="col-md-9 col-md-offset-3"> <?php echo $form->submitButton(__('Save'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['content/categories'], __('Cancel'), ['class' => 'btn btn-default']); ?> </div> <?php echo $form->finish();
<h1><?php echo __('User list'); ?> </h1> <hr /> <?php $items = []; foreach ($records as $user) { $items[] = [1 => ['text' => $user->id], 2 => ['text' => $user->email], 3 => ['text' => $user->login], 4 => ['text' => $user->getRole()->name], 5 => ['text' => Date::convertToDatetime($user->created_at, Date::FORMAT_TO_DAY)], 6 => ['text' => Url::link(['user/update', $user->id], '<i class="fa fa-pencil fa-lg"></i>') . Url::link(['user/delete', $user->id], ' <i class="fa fa-trash-o fa-lg"></i>'), 'html' => true, 'property' => ['class' => 'text-center']], 'property' => ['class' => 'checkbox-row' . ($user->approve_token != '0' ? ' alert-warning' : null)]]; } ?> <div class="pull-right"> <?php echo Url::link(['user/invite'], __('Send invite'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['user/update', '0'], __('Add user'), ['class' => 'btn btn-primary']); ?> </div> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Email')], ['text' => __('Login')], ['text' => __('Role')], ['text' => __('Register date')], ['text' => __('Actions')]]], 'tbody' => ['items' => $items], 'selectableBox' => ['attachOrder' => 1, 'form' => ['method' => 'GET', 'class' => 'form-horizontal', 'action' => Url::to('user/delete')], 'selector' => ['type' => 'checkbox', 'name' => 'selected[]', 'class' => 'massSelectId'], 'buttons' => [['type' => 'submit', 'class' => 'btn btn-danger', 'value' => __('Delete selected')]]]]); ?> <div class="text-center"> <?php echo $pagination->display(['class' => 'pagination pagination-centered']); ?> </div>
<span class="label label-info">/<?php echo $row->path; ?> </span> </div> </div> </td> <td class="text-center"> <?php echo Url::link(['content/categoryupdate', 0, null, ['parent' => $row->id]], '<i class="fa fa-plus"></i>', ['class' => 'label label-default']); ?> <?php echo Url::link(['content/categoryupdate', $row->id], '<i class="fa fa-cogs"></i>', ['class' => 'label label-default']); ?> <?php if ($row->id > 1) { ?> <?php echo Url::link(['content/categorydelete', $row->id], '<i class="fa fa-trash-o"></i>', ['class' => 'label label-default']); ?> <?php } ?> </td> </tr> <?php } ?> </tbody> </table> </div>
<div class="container body-container"> <!-- head logo and search panel --> <div class="row header-block"> <!-- Image logo --> <div class="col-md-1 hidden-sm hidden-xs col-xs-0"> <img alt="Website logo" src="<?php echo \App::$Alias->currentViewUrl; ?> /assets/img/logo.png" class="img-responsive" style="padding-top: 5px;"> </div> <!-- text logo --> <div class="col-md-7"> <div class="site-name"> <?php echo \Ffcms\Core\Helper\Url::link(['/'], 'FFCMS Demo'); ?> </div> <p>This is a test description of new website.</p> </div> <!-- Search/language panel --> <div class="col-md-4"> <!-- search panel --> <form method="get" action="<?php echo \Ffcms\Core\Helper\Url::to('search/index'); ?> " style="padding-top: 20px;"> <div class="input-group"> <input id="search-line" type="text" class="form-control" placeholder="<?php echo __('search query...'); ?>
?> <?php echo $this->render('user/_tabs'); ?> <h1><?php echo $this->title; ?> </h1> <hr /> <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post', 'action' => '']); echo $form->start(); ?> <?php echo $form->field('name', 'text', ['class' => 'form-control'], __('Set the name of the group')); echo $form->field('permissions', 'checkboxes', ['options' => $model->getAllPermissions()]); ?> <div class="col-md-offset-3 col-md-9"> <?php echo $form->submitButton(__('Save'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['user/grouplist'], __('Cancel'), ['class' => 'btn btn-default']); ?> </div> <?php echo $form->finish();
<h1><?php echo __('Delete comments and answers'); ?> </h1> <hr /> <?php echo __('Are you sure to delete this comments or answers?'); ?> <?php $items = []; foreach ($records as $item) { $message = Str::sub(\App::$Security->strip_tags($item->message), 0, 50); $author = Simplify::parseUserNick($item->user_id, $item->guest_name); if ((int) $item->user_id > 0) { $author = Url::link(['user/update', (int) $item->user_id], $author); } $items[] = [['text' => $item->id], ['text' => $message], ['text' => $author, 'html' => true], ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)]]; } ?> <div class="table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Message')], ['text' => __('Author')], ['text' => __('Date')]]], 'tbody' => ['items' => $items]]); ?> </div> <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post']); echo $form->start(); ?>
?> <h1><?php echo __('Widget turn on/off'); ?> </h1> <hr /> <?php echo Table::display(['table' => ['class' => 'table table-bordered'], 'thead' => ['titles' => [['text' => __('Param')], ['text' => __('Value')]]], 'tbody' => ['items' => [[['text' => __('Name')], ['text' => $widget->getLocaleName()]], [['text' => __('System name')], ['text' => $widget->sys_name]], [['text' => __('Last update')], ['text' => Date::convertToDatetime($widget->updated_at, DATE::FORMAT_TO_SECONDS)]], [['text' => __('Status')], ['text' => (int) $widget->disabled === 0 ? 'On' : 'Off'], 'property' => ['class' => (int) $widget->disabled === 0 ? 'alert-success' : 'alert-danger']]]]]); ?> <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post', 'action' => '', 'enctype' => 'multipart/form-data']); ?> <?php echo $form->start(); ?> <div class="col-md-12"> <?php echo $form->submitButton(__('Switch'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['widget/index'], __('Cancel'), ['class' => 'btn btn-default']); ?> </div> <?php echo $form->finish();
#comments-list"><?php echo __('Comments'); ?> : <span itemprop="commentCount" id="comment-count-<?php echo $item['id']; ?> ">0</span></a> </span> <span class="pull-right"> <?php if ((int) $catConfigs['showTags'] === 1 && $item['tags'] !== null && Obj::isArray($item['tags'])) { ?> <span class="spaced"><i class="fa fa-tags hidden-xs"></i> <?php foreach ($item['tags'] as $tag) { echo Url::link(['content/tag', $tag], $tag, ['class' => 'label label-default']) . " "; } ?> </span> <meta itemprop="keywords" content="<?php implode(',', $item['tags']); ?> "> <?php } ?> </span> </div> </article> <script> contentItemList['path'][<?php
/** * Build bootstrap navbar * @param array $elements * @return NULL|string */ public static function display($elements) { // check if elements passed well if (!Obj::isArray($elements) || count($elements['items']) < 1) { return null; } // set default bootstrap properties if not defined $elements['property']['class'] = Str::concat(' ', 'nav', $elements['property']['class']); $elements['nav']['class'] = Str::concat(' ', 'navbar', $elements['nav']['class']); if ($elements['container'] === null) { $elements['container'] = 'container-fluid'; } // set mobile collapse id for toggle $mobCollapseId = $elements['collapseId']; if (Str::likeEmpty($mobCollapseId)) { $mobCollapseId = Str::randomLatin(mt_rand(6, 12)) . mt_rand(1, 99); } // set element id for toggle $ulId = 1; // prepare array's for left, right and static elements $itemsLeft = []; $itemsRight = []; $itemsStatic = null; foreach ($elements['items'] as $item) { if (Obj::isString($item)) { // sounds like a static object w/o render request $itemsStatic .= $item; } else { if ($item['type'] === 'dropdown') { // build bootstrap dropdown properties $item['dropdown'] = ['class' => 'dropdown-toggle', 'data-toggle' => 'dropdown', 'href' => '#']; $item['property']['class'] = Str::concat(' ', 'dropdown', $item['property']['class']); } else { $item['type'] = 'link'; } // set item with position if ($item['position'] !== null && $item['position'] === 'right') { // right position item $itemsRight[] = $item; } else { // left pos item $itemsLeft[] = $item; } } } // build html dom for left and right elements $leftBuild = null; $rightBuild = null; if (count($itemsLeft) > 0) { $mainElemLeft = $elements['property']; // todo: fix me!! $mainElemLeft['id'] .= $ulId; $ulId++; $leftBuild = Listing::display(['type' => 'ul', 'property' => $mainElemLeft, 'activeOrder' => $elements['activeOrder'], 'items' => $itemsLeft]); } if (count($itemsRight) > 0) { $mainElemRight = $elements['property']; // todo: fix me!! $mainElemRight['class'] .= ' navbar-right'; $mainElemRight['id'] .= $ulId; $ulId++; $rightBuild = Listing::display(['type' => 'ul', 'property' => $mainElemRight, 'activeOrder' => $elements['activeOrder'], 'items' => $itemsRight]); } // generate output dom of bootstrap navbar $dom = new Dom(); $body = $dom->div(function () use($leftBuild, $rightBuild, $itemsStatic) { return $leftBuild . $itemsStatic . $rightBuild; }, ['class' => 'collapse navbar-collapse', 'id' => $mobCollapseId]); // drow <nav @properties>@next</nav> return $dom->nav(function () use($dom, $elements, $mobCollapseId, $body) { // drow <div @container>@next</div> return $dom->div(function () use($dom, $elements, $mobCollapseId, $body) { // drow <div @navbar-header>@next</div> $header = $dom->div(function () use($dom, $elements, $mobCollapseId) { // drow <button @collapse>@next</button> $collapseButton = $dom->button(function () use($dom) { $toggleItem = $dom->span(function () { return 'Toggle menu'; }, ['class' => 'sr-only']); $toggleIcon = null; for ($i = 0; $i < 3; $i++) { $toggleIcon .= $dom->span(function () { return null; }, ['class' => 'icon-bar']); } return $toggleItem . $toggleIcon; }, ['type' => 'button', 'class' => 'navbar-toggle collapsed', 'data-toggle' => 'collapse', 'data-target' => '#' . $mobCollapseId]); // drow <div @brand>@brandtext<?div> $brand = null; if (isset($elements['brand'])) { if (isset($elements['brand']['link'])) { $brand = Url::link($elements['brand']['link'], $elements['brand']['text'], ['class' => 'navbar-brand']); } else { $brand = (new Dom())->span(function () use($elements) { return $elements['brand']['text']; }, ['class' => 'navbar-brand']); } } return $collapseButton . $brand; }, ['class' => 'navbar-header']); // return header and body concat return $header . $body; }, $elements['container']); }, $elements['nav']); }
<?php use Ffcms\Core\Helper\Url; /** @var object $this */ $this->title = __('Route removed'); ?> <h1><?php echo __('Congratulations!'); ?> </h1> <hr /> <p><?php echo __('Route is successful deleted! Wait 5 second to update configurations'); ?> </p> <?php echo Url::link(['main/routing'], __('Reload'), ['class' => 'btn btn-primary']); ?> <script> setTimeout(function () { window.location.replace("<?php echo Url::to('main/routing'); ?> "); }, 5000); </script>
?> <?php echo $this->render('comments/_tabs'); ?> <h1><?php echo __('Edit comment/answer'); ?> </h1> <hr /> <?php $form = new Form($model, ['class' => 'form-horizontal', 'method' => 'post']); echo $form->start(); ?> <?php echo $form->field('guestName', 'text', ['class' => 'form-control'], __('Guest name for this comment or answer if defined')); echo $form->field('message', 'textarea', ['class' => 'form-control wysi-comments', 'html' => true], __('Comment message text')); ?> <?php echo $form->submitButton(__('Save'), ['class' => 'btn btn-primary']); ?> <?php echo Url::link(['comments/read', $model->getCommentId()], __('Back'), ['class' => 'btn btn-warning']); ?> <?php echo $form->finish();
<?php echo __('From'); ?> : <?php echo $answer->name . '(' . $answer->email . ')' . ((int) $answer->user_id > 0 ? Url::link(['user/update', $answer->user_id], '[id' . $answer->user_id . ']') : null); ?> , <?php echo Date::convertToDatetime($answer->created_at, Date::FORMAT_TO_HOUR); ?> <span class="pull-right"> <?php echo Url::link(['feedback/update', 'answer', $answer->id], __('Edit'), ['class' => 'label label-primary']); ?> <?php echo Url::link(['feedback/delete', 'answer', $answer->id], __('Delete'), ['class' => 'label label-danger']); ?> </span> </div> <div class="panel-body"> <?php echo Str::replace("\n", "<br />", $answer->message); ?> </div> </div> <?php } } ?> <?php
<?php if ($records === null || $records->count() < 1) { echo '<p class="alert alert-warning">' . __('Answers is not founded') . '</p>'; return; } $items = []; $moderateIsFound = false; foreach ($records as $item) { $commentObject = $item->getCommentPost(); $message = Text::cut(\App::$Security->strip_tags($item->message), 0, 75); $moderate = (bool) $item->moderate; if ($moderate) { $moderateIsFound = true; } $items[] = [1 => ['text' => $item->id], 2 => ['text' => ($moderate ? '<i class="fa fa-exclamation text-warning"></i> ' : null) . Url::link(['comments/read', $commentObject->id, null, ['#' => '#answer-' . $item->id]], $message), 'html' => true], 3 => ['text' => Simplify::parseUserLink((int) $item->user_id, $item->guest_name, 'user/update'), 'html' => true], 4 => ['text' => '<a href="' . App::$Alias->scriptUrl . $commentObject->pathway . '" target="_blank">' . Str::sub($commentObject->pathway, 0, 20) . '...</a>', 'html' => true], 5 => ['text' => Date::convertToDatetime($item->created_at, Date::FORMAT_TO_HOUR)], 6 => ['text' => Url::link(['comments/read', $commentObject->id], '<i class="fa fa-list fa-lg"></i>') . ' ' . Url::link(['comments/delete', 'answer', $item->id], '<i class="fa fa-trash-o fa-lg"></i>'), 'html' => true, 'property' => ['class' => 'text-center']], 'property' => ['class' => 'checkbox-row' . ($moderate !== false ? ' alert-warning' : null)]]; } $moderateAccept = false; if ($moderateIsFound) { $moderateAccept = ['type' => 'submit', 'class' => 'btn btn-warning', 'value' => __('Publish'), 'formaction' => Url::to('comments/publish', 'answer')]; } ?> <div class="table-responsive"> <?php echo Table::display(['table' => ['class' => 'table table-bordered table-hover'], 'thead' => ['titles' => [['text' => '#'], ['text' => __('Answer')], ['text' => __('Author')], ['text' => __('Page')], ['text' => __('Date')], ['text' => __('Actions')]]], 'tbody' => ['items' => $items], 'selectableBox' => ['attachOrder' => 1, 'form' => ['method' => 'GET', 'class' => 'form-horizontal', 'action' => Url::to('comments/delete', 'answer')], 'selector' => ['type' => 'checkbox', 'name' => 'selected[]', 'class' => 'massSelectId'], 'buttons' => [['type' => 'submit', 'class' => 'btn btn-danger', 'value' => __('Delete selected'), 'formaction' => Url::to('comment/delete', 'answer')], $moderateAccept]]]); ?> </div> <div class="text-center"> <?php