mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-08-22 14:55:18 -04:00
Use text::alternate() instead of hand-rolled even/odd code.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php defined("SYSPATH") or die("No direct script access.") ?>
|
||||
<ul>
|
||||
<? foreach ($comments as $i => $comment): ?>
|
||||
<li class="<?= ($i % 2 == 0) ? "g-even" : "g-odd" ?>">
|
||||
<? foreach ($comments as $comment): ?>
|
||||
<li class="<?= text::alternate("g-even", "g-odd") ?>">
|
||||
<img src="<?= $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true)) ?>"
|
||||
class="g-avatar"
|
||||
alt="<?= html::clean_attribute($comment->author_name()) ?>"
|
||||
|
||||
@@ -103,8 +103,8 @@
|
||||
<?= t("Actions") ?>
|
||||
</th>
|
||||
</tr>
|
||||
<? foreach ($comments as $i => $comment): ?>
|
||||
<tr id="g-comment-<?= $comment->id ?>" class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
|
||||
<? foreach ($comments as $comment): ?>
|
||||
<tr id="g-comment-<?= $comment->id ?>" class="<?= text::alternate("g-odd", "g-even") ?>">
|
||||
<td>
|
||||
<a href="#">
|
||||
<img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
<th> <?= t("Name") ?> </th>
|
||||
<th> <?= t("Value") ?></th>
|
||||
</tr>
|
||||
<? $i = 0; ?>
|
||||
<? foreach ($vars as $var): ?>
|
||||
<? if ($var->module_name == "gallery" && $var->name == "_cache") continue ?>
|
||||
<tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
|
||||
<tr class="<?= text::alternate("g-odd", "g-even") ?>">
|
||||
<td> <?= $var->module_name ?> </td>
|
||||
<td> <?= html::clean($var->name) ?> </td>
|
||||
<td>
|
||||
@@ -34,7 +33,6 @@
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<? $i++ ?>
|
||||
<? endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -46,14 +46,12 @@
|
||||
<th> <?= t("Active") ?> </th>
|
||||
<th> <?= t("Description") ?> </th>
|
||||
</tr>
|
||||
<? $i = 0 ?>
|
||||
<? foreach ($available as $module_name => $description): ?>
|
||||
<tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
|
||||
<tr class="<?= text::alternate("g-odd", "g-even") ?>">
|
||||
<? $data = array("name" => "provider"); ?>
|
||||
<td> <?= form::radio($data, $module_name, $module_name == $active) ?> </td>
|
||||
<td> <?= t($description) ?> </td>
|
||||
</tr>
|
||||
<? $i++ ?>
|
||||
<? endforeach ?>
|
||||
</table>
|
||||
<input type="submit" value="<?= t("Change")->for_html_attr() ?>" />
|
||||
|
||||
@@ -20,9 +20,8 @@
|
||||
<?= t("Action") ?>
|
||||
</th>
|
||||
</tr>
|
||||
<? $i = 0; ?>
|
||||
<? foreach ($task_definitions as $task): ?>
|
||||
<tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?> <?= log::severity_class($task->severity) ?>">
|
||||
<tr class="<?= text::alternate("g-odd", "g-even") ?> <?= log::severity_class($task->severity) ?>">
|
||||
<td class="<?= log::severity_class($task->severity) ?>">
|
||||
<?= $task->name ?>
|
||||
</td>
|
||||
@@ -36,7 +35,6 @@
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<? $i++ ?>
|
||||
<? endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
@@ -68,9 +66,8 @@
|
||||
<?= t("Action") ?>
|
||||
</th>
|
||||
</tr>
|
||||
<? $i = 0; ?>
|
||||
<? foreach ($running_tasks as $task): ?>
|
||||
<tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?> <?= $task->state == "stalled" ? "g-warning" : "" ?>">
|
||||
<tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "stalled" ? "g-warning" : "" ?>">
|
||||
<td class="<?= $task->state == "stalled" ? "g-warning" : "" ?>">
|
||||
<?= gallery::date_time($task->updated) ?>
|
||||
</td>
|
||||
@@ -108,7 +105,6 @@
|
||||
<? endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<? $i++ ?>
|
||||
<? endforeach ?>
|
||||
</table>
|
||||
</div>
|
||||
@@ -141,9 +137,8 @@
|
||||
<?= t("Action") ?>
|
||||
</th>
|
||||
</tr>
|
||||
<? $i = 0; ?>
|
||||
<? foreach ($finished_tasks as $task): ?>
|
||||
<tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?> <?= $task->state == "success" ? "g-success" : "g-error" ?>">
|
||||
<tr class="<?= text::alternate("g-odd", "g-even") ?> <?= $task->state == "success" ? "g-success" : "g-error" ?>">
|
||||
<td class="<?= $task->state == "success" ? "g-success" : "g-error" ?>">
|
||||
<?= gallery::date_time($task->updated) ?>
|
||||
</td>
|
||||
@@ -187,7 +182,6 @@
|
||||
</td>
|
||||
</tr>
|
||||
<? endforeach ?>
|
||||
<? $i++ ?>
|
||||
</table>
|
||||
</div>
|
||||
<? endif ?>
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
<th> <?= t("Version") ?> </th>
|
||||
<th> <?= t("Description") ?> </th>
|
||||
</tr>
|
||||
<? $i = 0 ?>
|
||||
<? foreach ($available as $module_name => $module_info): ?>
|
||||
<tr class="<?= ($i % 2 == 0) ? "g-odd" : "g-even" ?>">
|
||||
<tr class="<?= text::alternate("g-odd", "g-even") ?>">
|
||||
<? $data = array("name" => $module_name); ?>
|
||||
<? if ($module_info->locked) $data["disabled"] = 1; ?>
|
||||
<td> <?= form::checkbox($data, '1', module::is_active($module_name)) ?> </td>
|
||||
@@ -25,7 +24,6 @@
|
||||
<td> <?= $module_info->version ?> </td>
|
||||
<td> <?= t($module_info->description) ?> </td>
|
||||
</tr>
|
||||
<? $i++ ?>
|
||||
<? endforeach ?>
|
||||
</table>
|
||||
<input type="submit" value="<?= t("Update")->for_html_attr() ?>" />
|
||||
|
||||
Reference in New Issue
Block a user