Example #1
0
 function testRenderableOuterTags()
 {
     $t = new Tag();
     $actual = $t->html([$t->head(), $t->body(a::c1ass('container'), [$t->header(['style' => 'width: 1px solid #000;'], a::id('my-header'), $t->h1('header'))], new Panel('Test', 'inside content'))]);
     $expected = '<html><head></head><body class="container"><header style="width: 1px solid #000;"' . ' id="my-header"><h1>header</h1></header><div class="panel panel-default"><div class="panel-heading">' . '<h3 class="panel-title">Test</h3></div><div class="panel-body">inside content</div></div></body></html>';
     $this->assertEquals($expected, $actual);
 }
Example #2
0
 protected function content()
 {
     $t = (new Layout())->getTag();
     /** @var User $user */
     $user = $this->user;
     $dataToggle = "data-toggle";
     $dataRel = "data-rel";
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     return $this->setContent(get_called_class(), '', $t->div(a::c1ass('content'), $t->div(a::c1ass('row'), $t->div(a::c1ass('col-md-3'), $t->div(a::c1ass('panel widget light-widget panel-bd-top'), $t->div(a::c1ass('panel-heading no-title')), $t->div(a::c1ass('panel-body'), $t->div(a::c1ass('text-center vd_info-parent'), $t->img(a::alt('Your Avatar '), a::src(asset('img/profile-icon.png')))), $t->h2(a::c1ass('font-semibold mgbt-xs-5'), $user->getFullName()), $t->h4($user->getPosition()), $t->p(a::c1ass('mgtp-20 font-x13'), trans('layout.details')), $t->div(a::c1ass('font-x13'), $t->table(a::c1ass('table table-striped table-hover'), $t->tr($t->td('Status'), $t->td($t->span(a::c1ass('label label-' . $this->getStatusColor($user)), $user->getStatus()))), $t->tr($t->td('E-mail'), $t->td($t->a(a::href('mailto:' . $user->getEmail()), $user->getEmail()))), $t->tr($t->td(trans('menu.member.info', ['date' => ''])), $t->td($user->getCreated()->format('d.m.Y') . ' r.'))))))), $t->div(a::c1ass('col-md-9'), $t->div(a::c1ass('tabs widget'), $t->ul(a::c1ass('nav nav-tabs widget'), $t->li(a::c1ass('active'), $t->a(a::$dataToggle('tab'), a::href('#activity-tab'), trans('menu.activity'))), $t->li($t->a(a::$dataToggle('tab'), a::href('#groups-tab'), trans('menu.groups'))), $t->li($t->a(a::$dataToggle('tab'), a::href('#projects-tab'), trans('menu.projects')))), $this->renderEditButton($t, $user), $t->div(a::c1ass('tab-content'), $t->div(a::id('activity-tab'), a::c1ass('tab-pane active'), $t->div(a::c1ass('col-md-12 pd-5'), $t->h3(a::c1ass('mgbt-xs-15 font-semibold'), $t->i(a::c1ass('fa fa-globe mgr-10 profile-icon')), trans('menu.activity')), $t->div($t->div(a::c1ass('content-list'), $t->div(a::$dataRel('scroll'), new ActivitiesList($user->getActivities())))))), $t->div(a::id('groups-tab'), a::c1ass('tab-pane'), $t->div(a::c1ass('col-md-12 pd-5'), $t->h3(a::c1ass('mgbt-xs-15 font-semibold'), $t->i(a::c1ass('fa fa-users mgr-10 profile-icon')), trans('menu.groups')))), $t->div(a::id('projects-tab'), a::c1ass('tab-pane'), $t->div(a::c1ass('col-md-12 pd-5'), $t->h3(a::c1ass('mgbt-xs-15 font-semibold'), $t->i(a::c1ass('fa fa-folder mgr-10 profile-icon')), trans('menu.projects'))))))))));
 }
Example #3
0
 private function renderForm(Tag $t)
 {
     $dataMinlength = 'data-minlength';
     $dataMatch = "data-match";
     $dataMatchError = "data-match-error";
     $dataMinlengthError = "data-minlength-error";
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @noinspection PhpUndefinedFunctionInspection */
     /** @noinspection PhpUndefinedClassConstantInspection */
     return $t->div(a::c1ass('login-box-body'), [$t->p(a::c1ass('login-box-msg ' . $this->getClasses()), $this->getInfoMessage()), $t->form(a::c1ass('form-signin'), a::action('/auth/login'), a::method('POST'), [$t->div(a::c1ass('form-group has-feedback hidden register'), [$t->input(a::type('text'), a::c1ass('form-control'), a::placeholder(trans('placeholder.fullName')), a::id('inputFullName'), a::name('fullName'), a::autofocus('autofocus')), $t->span(a::c1ass('glyphicon glyphicon-user form-control-feedback')), $t->div(a::c1ass('help-block with-errors'))]), $t->div(a::c1ass('form-group has-feedback'), [$t->input(a::type('email'), a::c1ass('form-control'), a::placeholder(trans('placeholder.email')), a::id('inputEmail'), a::name('email'), a::required('required'), a::autofocus('autofocus')), $t->span(a::c1ass('glyphicon glyphicon-envelope form-control-feedback')), $t->div(a::c1ass('help-block with-errors'))]), $t->div(a::c1ass('form-group has-feedback'), [$t->input(a::type('password'), a::id('inputPassword'), a::name('password'), a::c1ass('form-control'), a::placeholder(trans('placeholder.password')), a::required('required'), a::$dataMinlength('8'), a::$dataMinlengthError(trans('auth.minimum.8.chars'))), $t->span(a::c1ass('glyphicon glyphicon-lock form-control-feedback')), $t->div(a::c1ass('help-block with-errors'))]), $t->div(a::c1ass('form-group has-feedback hidden register'), [$t->input(a::type('password'), a::id('inputRetypePassword'), a::name('retypedPassword'), a::c1ass('form-control'), a::placeholder(trans('placeholder.retype.password')), a::$dataMatch('#inputPassword'), a::$dataMatchError(trans('auth.password.doesnt.match'))), $t->span(a::c1ass('glyphicon glyphicon-lock form-control-feedback')), $t->div(a::c1ass('help-block with-errors'))]), $t->div(a::c1ass('row'), [$t->div(a::c1ass('col-xs-8'), [$t->div(a::c1ass('checkbox icheck'), [$t->label([$t->input(a::type('checkbox')), ' ' . trans('auth.remember.me')])])]), $t->div(a::c1ass('col-xs-4'), [$t->button(a::type('submit'), a::c1ass('btn btn-success btn-block btn-flat'), trans('auth.signin'))])]), $t->input(a::type("hidden"), a::name("_token"), a::value(csrf_token()))]), $t->div(a::c1ass('social-auth-links text-center'), [$t->p(trans('select.or')), $t->a(a::href('#'), a::c1ass("btn btn-block btn-social btn-facebook btn-flat"), [$t->i(a::c1ass("fa fa-facebook")), trans('auth.signin.facebook')]), $t->a(a::href('#'), a::c1ass("btn btn-block btn-social btn-google-plus btn-flat"), [$t->i(a::c1ass("fa fa-google-plus")), trans('auth.signin.google')]), $t->p(a::style('padding: 15px;'), trans('select.or')), $t->div(a::style('padding-bottom: 20px;'), $t->a(a::id('registerBtn'), a::c1ass('btn btn-block bg-gray color-palette btn-flat pull-left'), trans('auth.register')), $t->a(a::id('cancel'), a::c1ass('btn bg-gray color-palette btn-flat hidden pull-right'), a::style('text-align: right'), trans('auth.cancel')))])]);
 }
Example #4
0
 /**
  * @param Tag $t
  * @return mixed
  */
 private function aside($t)
 {
     /** @noinspection PhpUndefinedMethodInspection */
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     return $t->aside(a::c1ass('main-sidebar'), $t->section(a::c1ass('sidebar'), a::style('height: auto;'), $t->div(a::c1ass('user-panel'), $t->div(a::c1ass('pull-left image'), $this->getImageFromData($t)), $t->div(a::c1ass('pull-left info'), $t->p($this->getLoggedUser()->getFullName()), $t->a(a::href("#"), $t->i(a::c1ass('fa fa-circle text-success')), 'Online'))), $t->form(a::c1ass('sidebar-form'), a::method('get'), a::action('#'), $t->div(a::c1ass('input-group'), $t->input(a::c1ass('form-control'), a::type('text'), a::placeholder('Search...'), a::name('q')), $t->span(a::c1ass('input-group-btn'), $t->button(a::id('search-btn'), a::c1ass('btn btn-flat'), a::name('search'), a::type('submit'), $t->i(a::c1ass('fa fa-search')))))), $t->ul(a::c1ass('sidebar-menu'), $t->li(a::c1ass('header'), 'MAIN NAVIGATION'), $this->renderMenu($t))));
 }
Example #5
0
 /**
  * @param User $user
  * @param string $token
  * @return string
  */
 public function accountActivation($user, $token)
 {
     $t = new Tag();
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     return $t->div(a::id('content'), a::style('width: 710px; text-align: left;'), $t->p($t->b(trans('email.welcome') . ' ' . $user->getFirstName())), $t->p(trans('email.your.account.has.been.created', ['solvreUrl' => solvreUrl()])), $t->span(trans('email.please.activate.account.by.link')), $t->span(a::style('word-wrap: break-word;'), trans('email.activation.link'), URL::to('/activate', array($token))), $t->br());
 }
Example #6
0
 private function needing()
 {
     $t = new Tag();
     // CASE 1
     /** @noinspection PhpUndefinedClassInspection */
     /** @method div( assoc_array $htmlAttributes, string $content ) */
     /** @var string (last argument) */
     $t->div(['class' => 'test'], 'my content');
     // CASE 2
     /** @noinspection PhpUndefinedClassInspection */
     /** @method div( assoc_array $htmlAttributes, array_of_string ... $content ) */
     $t->div(['class' => 'test'], ['my content', 'my second content'], [' another content']);
     // CASE 3
     /** @noinspection PhpUndefinedClassInspection */
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @method div( assoc_array $htmlAttributes, Renderable ... $content ) */
     $t->span(['class' => 'test'], new Panel('my title', 'my content'), new Panel('my second title', 'my second content'));
     // CASE 4
     /** @noinspection PhpUndefinedClassInspection */
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @method div( assoc_array $htmlAttributes, mixed ... $content ) */
     /** @var mixed = array_of_string|Renderable */
     $t->div(['class' => 'test'], ['some content', 'another content'], new Panel('my second title', 'my second content'));
     // CASE 5
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent ) */
     /** @var mixed_content = string|Renderable */
     /** @var mixed = assoc_array|array_of_mixed_content|Renderable */
     $t->div(['class' => 'test'], ['id' => 'test content'], ['some content', new Panel('my first panel title', 'my first content')], new Panel('my second title', 'my second content'));
     // ###################### Attributes ################################
     // CASE 1
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|string (last argument) */
     $t->div(a::c1ass('test'), a::id('test-content'), 'my content');
     // CASE 2
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|array_of_string */
     $t->div(a::c1ass('test'), a::id('test-content'), ['my content ', 'my second content '], ['else content']);
     // CASE 3
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|Renderable */
     $t->span(a::c1ass('test'), a::id('test-content'), new Panel('my title', 'my content'), new Panel('my second title', 'my second content'));
     // CASE 4
     /** @noinspection PhpUndefinedClassInspection, PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|array_of_string|Renderable */
     $t->div(a::c1ass('test'), a::id('test-content'), ['some content', 'another content'], new Panel('my second title', 'my second content'));
     // CASE 5
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed_content = string|Renderable */
     /** @var mixed = Attribute|array_of_mixed_content|Renderable */
     $t->div(a::c1ass('test'), a::id('test-content'), ['some content', new Panel('my first panel title', 'my first content')], new Panel('my second title', 'my second content'));
     // ###################### Attributes And Assoc ################################
     // CASE 1
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|assoc_array|string (last argument) */
     $t->div(a::c1ass('test'), ['id' => 'test-content'], 'my content');
     // CASE 2
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|assoc_array|array_of_string */
     $t->div(a::c1ass('test'), ['id' => 'test-content'], ['my content ', 'my second content '], ['another content']);
     // CASE 3
     /** @noinspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|assoc_array|Renderable */
     $t->span(a::c1ass('test'), ['id' => 'test-content'], new Panel('my title', 'my content'), new Panel('my second title', 'my second content'));
     // CASE 4
     /** @noinspection PhpUndefinedClassInspection, PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed = Attribute|assoc_array|array_of_string|Renderable */
     $t->div(a::c1ass('test'), ['id' => 'test-content'], ['some content', 'another content'], new Panel('my second title', 'my second content'));
     // CASE 5
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed_content = string|Renderable */
     /** @var mixed = Attribute|assoc_array|array_of_mixed_content|Renderable */
     $t->div(a::c1ass('test'), ['id' => 'test-content'], ['some content', new Panel('my first panel title', 'my first content')], new Panel('my second title', 'my second content'));
     // CASE 6
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent) */
     /** @var mixed_content = string|Renderable */
     /** @var mixed = Attribute|Attributes|assoc_array|array_of_mixed_content|string|Renderable*/
     $t->div(a::c1ass('test'), ['id' => 'test-content'], ['some content', new Panel('my first panel title', 'my first content')], new Panel('my second title', 'my second content'), 'aqua');
     // CASE 6
     /** @noinspection PhpUndefinedClassInspection PhpMethodParametersCountMismatchInspection */
     /** @method div( mixed ... $htmlAttributesOrContent ) */
     /** @var mixed = {attribute|content} */
     /** @var attribute = {Attribute|Attributes|assoc_array} */
     /** @var content = {string|array_of_string|array_of_mixed_content|Renderable} */
     /** @var mixed_content = {string|Renderable} */
     $t->div(a::c1ass('test'), ['id' => 'test-content'], ['some content', ' test'], new Panel('my second title', 'my second content'), 'aqua');
 }