예제 #1
0
<?php

$prefix = Helper_Image::render(WEBROOT_PATH . 'img/startpage/TMPNAME', Helper_Image::STARTPAGE, false);
$dataJS = array();
foreach ($sections as $key => $section) {
    $dataJS[$key]['sectionName'] = Helper_Text::clean($section['title']);
    $dataJS[$key]['aUrl'] = Helper_Html::link(array('controller' => 'index', 'action' => 'section', 'param1' => $section['title']));
    $dataJS[$key]['imgUrl'] = str_replace('TMPNAME', $section['id'] . '.jpg', $prefix);
}
?>

<div class="startpage" style="display: none">
	<a href="<?php 
echo $dataJS[0]['aUrl'];
?>
">
		<div class="rotatorCont">
			<img src="<?php 
echo $dataJS[0]['imgUrl'];
?>
&w=1024&h=575" />
		</div>
		<span><?php 
echo $dataJS[0]['sectionName'];
?>
</span>
	</a>
</div>

<br style="clear: both" />
예제 #2
0
 <tr>
<?php 
foreach ($data[0] as $column => $tmp) {
    echo "<th>{$column}</th>";
}
echo '<th></th>';
?>
</tr>

 <?php 
foreach ($data as $row) {
    echo '<tr  ' . $statusClass[$row['id']] . '>';
    foreach ($row as $key => $val) {
        echo "<td>";
        if ($key == 'img') {
            echo Helper_Image::render($val, Helper_Image::ADMINPREVIEW);
        } elseif ($key == 'title' && isset($prefixUrl)) {
            echo '<a 
	 						href="' . Helper_Html::link(array('controller' => 'admin', 'action' => $prefixUrl, 'param1' => $row['id'])) . '" 
	 						title="' . $prefixUrlTitle . '">
 						' . $val . '</a>';
        } elseif ($key == 'created' || $key == 'updated') {
            echo Helper_Time::relativeTime($val);
        } elseif ($key == 'text') {
            echo htmlspecialchars($val);
        } else {
            echo $val;
        }
        echo "</td>";
    }
    echo '<td><a href="' . Helper_Html::link(array('controller' => 'admin', 'action' => 'edit', 'param1' => $prefix, 'param2' => $row['id'])) . '">edit</a>';