コード例 #1
0
    echo $this->partial('exhibits/block-form.php', array('block' => $block));
}
?>
        <div class="add-block">
            <h2><?php 
echo __('New Block');
?>
</h2>
            <div class="layout-select">
                <h4><?php 
echo __('Select layout');
?>
</h3>
                <div class="layout-thumbs">
                <?php 
$layouts = ExhibitLayout::getLayouts();
foreach ($layouts as $layout) {
    $layout_id = html_escape($layout->id);
    echo '<div class="layout" id="' . $layout_id . '">';
    echo '<img src="' . html_escape($layout->getIconUrl()) . '">';
    echo '<span class="layout-name">' . $layout->name . '</span>';
    echo '<input type="radio" name="new-block-layout" value="' . $layout_id . '">';
    echo '</div>';
}
foreach ($layouts as $layout) {
    echo '<div class="' . html_escape($layout->id) . ' layout-description">';
    echo $layout->description;
    echo '</div>';
}
?>
                <a class="add-link big button" href="#"><?php 
コード例 #2
0
 /**
  * Get a specific layout by ID.
  *
  * @param string $id Layout internal ID
  * @param boolean $fallback Whether to return the fallback layout if the
  *  given ID isn't recognized. If false, null will be returned for an
  *  invalid layout ID.
  * @return ExhibitLayout|null
  */
 public static function getLayout($id, $fallback = true)
 {
     $layouts = self::getLayoutArray();
     if (!isset($layouts[$id])) {
         if ($fallback) {
             $originalId = $id;
             $id = self::FALLBACK_LAYOUT;
         } else {
             return null;
         }
     }
     $layout = new ExhibitLayout($id);
     $layout->setMetadata($layouts[$id]);
     return $layout;
 }
 /**
  * Get the layout object for this page's layout.
  *
  * @return ExhibitLayout
  */
 public function getLayout()
 {
     return ExhibitLayout::getLayout($this->layout);
 }