-
Notifications
You must be signed in to change notification settings - Fork 159
Fix: Use alternative syntax in view scripts #384
Changes from all commits
14fd892
704a6fe
455bedc
e8acdfe
facbce4
fd60c80
f515390
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
</div> | ||
</div> | ||
<?php foreach ($this->flashMessenger()->getMessages() as $message): ?> | ||
<h3 class="zf-green"><?php echo $message ?></h3> | ||
<h3 class="zf-green"><?php echo $this->escapeHtml($message); ?></h3> | ||
<?php endforeach; ?> | ||
|
||
<ul class="nav nav-tabs"> | ||
|
@@ -22,50 +22,39 @@ | |
<br /> | ||
<div class="tab-content"> | ||
<div class="tab-pane active" id="modules"> | ||
<?php | ||
if (empty($modules)) { | ||
<?php if (0 === count($modules)): ?> | ||
<div class="alert alert-block">No modules have been submitted yet</div> | ||
<?php else: ?> | ||
<?php foreach ($modules as $module): ?> | ||
<?php echo $this->moduleView([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this helper require so many parameters? Isn't it easier to pass in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I plan to resolve next! 😉 |
||
'owner' => $module->getOwner(), | ||
'name' => $module->getName(), | ||
'created_at' => $module->getCreatedAt(), | ||
'url' => $module->getUrl(), | ||
'photo_url' => $module->getPhotoUrl(), | ||
'description' => $module->getDescription(), | ||
], 'remove'); | ||
?> | ||
<div class="alert alert-block">No modules have been submitted yet</div> | ||
<?php | ||
} | ||
/* @var ZfModule\Entity\Module[] $modules */ | ||
foreach ($modules as $module) { | ||
echo $this->moduleView([ | ||
'owner' => $module->getOwner(), | ||
'name' => $module->getName(), | ||
'created_at' => $module->getCreatedAt(), | ||
'url' => $module->getUrl(), | ||
'photo_url' => $module->getPhotoUrl(), | ||
'description' => $module->getDescription(), | ||
], 'remove'); | ||
} | ||
?> | ||
<?php endforeach; ?> | ||
<?php endif; ?> | ||
</div> | ||
<div class="tab-pane" id="repositories"> | ||
<div class="well" style="text-align:center">Synchronizing with GitHub <img src="<?php echo $this->basePath('/img/ajax-loader.gif') ?>" alt="loading" /></div> | ||
<div class="well" style="text-align:center">Synchronizing with GitHub <img src="<?php echo $this->basePath('/img/ajax-loader.gif'); ?>" alt="loading" /></div> | ||
</div> | ||
|
||
<div class="tab-pane" id="organizations"> | ||
<?php echo $this->userOrganizations() ?> | ||
<?php echo $this->userOrganizations(); ?> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-4"> | ||
<div class="sidebar" style="text-align: center"> | ||
<h3 style="text-align:center">Hello, <?php echo $this->zfcUserDisplayName() ?>!</h3> | ||
<h3 style="text-align:center">Hello, <?php echo $this->zfcUserDisplayName(); ?>!</h3> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. don't know but is this output safe or need escaped? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd escape it, but probably out of the scope of this PR. However, will fix it right away! 😉 |
||
<?php /* @var User\Entity\User $identity */ ?> | ||
<?php $identity = $this->zfcUserIdentity(); ?> | ||
<img class="thumbnail" src="<?php echo $identity->getPhotoUrl(); ?>" alt="<?php echo $this->zfcUserDisplayName() ?>"/> | ||
<br/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<?php | ||
$url = $this->url('zf-module'); | ||
$this->inlineScript()->appendScript(<<<EOT | ||
$("#repositories").load("$url"); | ||
EOT | ||
); | ||
<?php $this->inlineScript()->appendScript('$("#repositories").load("' . $this->escapeJs($this->url('zf-module')) . '");'); ?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Ocramius
Escaping for now, would like to re-iterate on this and use the
FlashMessenger
directly, as suggested!Also, I would like to use http://getbootstrap.com/components/#alerts, what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be done in a different MR then (with screenshots 'n stuff, so someone with better taste than me can deal with it :-) )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like to do this if @localheinz agrees - as i allready implemented this on a diff project (personal) 😼 :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ins0
Sure, go ahead!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ins0
If you do, please have a look at places where classes are missing:
which results in
vs.
which would result in
💡 Just as an idea, in Getting Real from 37signals, there's a chapter The Blank State - I think we could improve on that.