Skip to content
This repository has been archived by the owner on May 1, 2019. It is now read-only.

Commit

Permalink
Merge pull request #384 from localheinz/fix/alternative-syntax-in-vie…
Browse files Browse the repository at this point in the history
…w-scripts

Fix: Use alternative syntax in view scripts
  • Loading branch information
Ocramius committed Feb 17, 2015
2 parents 4bf2466 + f515390 commit 707b642
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 39 deletions.
12 changes: 3 additions & 9 deletions module/User/view/scn-social-auth/user/login.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
<p>
There is no sign-up form anymore! Just log in with your GitHub account. All your information will be provided by GitHub.
</p>
<?php
$socialSignIn = true;
foreach ($this->options->getEnabledProviders() as $provider) {
if ($socialSignIn) {
$socialSignIn = false;
}
echo '<p>' . $this->socialSignInButton($provider) . '</p>';
}
?>
<?php foreach ($this->options->getEnabledProviders() as $provider): ?>
<p><?php echo $this->socialSignInButton($provider); ?></p>
<?php endforeach; ?>
</div>
49 changes: 19 additions & 30 deletions module/User/view/zfc-user/user/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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([
'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>
<?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')) . '");'); ?>

0 comments on commit 707b642

Please sign in to comment.