/**
  * The main navigation component for the sfTwitterBootstrap plugin
  */
 public function executeHeader()
 {
     $this->items = sfTwitterBootstrap::getItems();
     $this->categories = sfTwitterBootstrap::getCategories();
     $this->user_actions = sfTwitterBootstrap::getUserActions();
     $this->called_from_component = true;
     // BC check
     if (sfConfig::get('sf_error_404_module') == $this->getContext()->getModuleName() && sfConfig::get('sf_error_404_action') == $this->getContext()->getActionName()) {
         sfTwitterBootstrap::setProperty('include_path', false);
         // we don't render the breadcrumbs when we are in a 404 error module/action
         $this->module_link = null;
         $this->action_link = null;
     } else {
         if (!sfTwitterBootstrap::routeExists($this->module_link = $this->getContext()->getModuleName(), $this->getContext())) {
             // if we cannot sniff the module link, we set it to null and later simply output is as a string in the breadcrumbs
             $this->module_link = null;
             // but before we do that, one last check - it's possible that the module name is different from the object name and that's the reason we can't sniff it
             foreach (sfTwitterBootstrap::getAllItems() as $name => $item) {
                 if ($name == $this->getContext()->getModuleName()) {
                     $this->module_link = $item['url'];
                     break;
                 }
             }
         }
         $this->module_link_name = sfTwitterBootstrap::getModuleName($this->getContext());
         if ($this->getContext()->getActionName() != 'index') {
             $this->action_link = $this->getContext()->getRouting()->getCurrentInternalUri();
             $this->action_link_name = sfTwitterBootstrap::getActionName($this->getContext());
         } else {
             $this->action_link = null;
         }
     }
 }
 public function linkToSaveAndAdd($object, $params)
 {
     if (!$object->isNew()) {
         return '';
     }
     $icon = '';
     if (sfTwitterBootstrap::getProperty('use_icons_in_button', false)) {
         $icon = '<i class="icon-ok icon-white"></i> ';
     }
     return '<button class="btn btn-primary mlm" type="submit" name="_save_and_add">' . $icon . __($params['label'], array(), 'sf_admin') . '</button>';
 }
示例#3
0
        </p>
<?php 
}
// if user is authenticated
?>
      </div>
    </div>
</div>

<?php 
if ($sf_user->isAuthenticated() && sfTwitterBootstrap::getProperty('include_path')) {
    ?>
<ul class='breadcrumb mbs'>
  <li>
    <?php 
    echo link_to(__(sfTwitterBootstrap::getProperty('breadcrumb_root_name')), sfTwitterBootstrap::getProperty('dashboard_url'));
    ?>
  </li>
  <?php 
    if ($sf_context->getModuleName() != 'sfTwitterBootstrap' && $sf_context->getActionName() != 'dashboard') {
        ?>
    <li><span class="divider">/</span>
    <?php 
        echo null !== $module_link ? link_to(__($module_link_name), $module_link) : ucfirst(__($module_link_name));
        ?>
    <?php 
        if (null != $action_link) {
            ?>
<span class="divider">/</span>
      <?php 
            echo link_to(ucfirst(__($action_link_name)), $action_link);
示例#4
0
?>

<div class="mod login">
  <div class="inner">
    <div class="hd center"></div>
    <div class="bd">
      <form action="<?php 
echo url_for('@sf_guard_signin');
?>
" method="post" class="form-horizontal">
        <?php 
echo $form->renderHiddenFields();
?>
        <fieldset class="loginFieldset">
          <legend><?php 
echo sfTwitterBootstrap::getProperty('site');
?>
</legend>
          <div class="control-group <?php 
echo $form['username']->hasError() ? 'error' : '';
?>
">
            <?php 
echo $form['username']->renderRow();
?>
          </div>
          <div class="control-group <?php 
echo $form['password']->hasError() ? 'error' : '';
?>
">
            <?php 
        ?>

<?php 
    } elseif ('_show' == $name) {
        ?>
    <?php 
        echo $this->addCredentialCondition('[?php echo $helper->linkToShow($' . $this->getSingularName() . ', ' . $this->asPhp($params) . ') ?]', $params);
        ?>

<?php 
    } else {
        ?>
    <li class="sf_admin_action_<?php 
        echo $params['class_suffix'];
        ?>
">
      <?php 
        if (sfTwitterBootstrap::getProperty('use_icons_in_button', false)) {
            $params['label'] = isset($params['icon']) ? '<i class="' . $params['icon'] . '"></i> ' . $params['label'] : $params['label'];
        }
        echo $this->addCredentialCondition($this->getLinkToAction($name, $params, true), $params);
        ?>

    </li>
<?php 
    }
}
?>
  </ul>
</td>
<?php

use_helper('I18N');
/** @var Array of menu items */
$items = $sf_data->getRaw('items');
?>

<div class="bd">
  <ul class="dash-icon-list">
    <?php 
foreach ($items as $key => $item) {
    ?>
      <?php 
    if (sfTwitterBootstrap::hasPermission($item, $sf_user)) {
        ?>
        <li>
          <div class="icon">
            <a href="<?php 
        echo url_for($item['url']);
        ?>
" title="<?php 
        echo __($item['name']);
        ?>
">
              <?php 
        echo image_tag($item['image'], array('alt' => __($item['name'])));
        ?>
              <h5><?php 
        echo __($item['name']);
        ?>
</h5>
 /**
  * Executes the index action, which shows a list of all available modules
  *
  */
 public function executeDashboard()
 {
     $this->items = sfTwitterBootstrap::getItems();
     $this->categories = sfTwitterBootstrap::getCategories();
 }
include_partial('flashes');
if (count($items)) {
    ?>
  <?php 
    include_partial('dash_list', array('items' => $items));
}
?>

<?php 
if (count($categories)) {
    ?>
  <?php 
    foreach ($categories as $name => $category) {
        ?>
    <?php 
        if (sfTwitterBootstrap::hasPermission($category, $sf_user)) {
            ?>
    <div class="mod dash">
        <div class="inner">
          <div class="hd">
              <h3 class="plm"><?php 
            echo __(isset($category['name']) ? $category['name'] : $name);
            ?>
</h3>
         </div>
         <?php 
            include_partial('dash_list', array('items' => $category['items']));
            ?>
       </div>
    </div>
    <?php 
<?php

if ($this->configuration->hasFilterForm()) {
    ?>
[?php use_stylesheets_for_form($filters) ?]
[?php use_javascripts_for_form($filters) ?]
[?php if ($filters->hasGlobalErrors()): ?]
    [?php echo $filters->renderGlobalErrors() ?]
[?php endif; ?]
<?php 
}
?>

  <div class="sf_admin_list">
    <?php 
if (sfTwitterBootstrap::getProperty('display_top_pagination', false)) {
    ?>
      [?php include_partial('<?php 
    echo $this->getModuleName();
    ?>
/pagination', array('pager' => $pager)) ?]
    <?php 
}
?>

    <table class="table table-bordered table-striped mbn">
      <thead>
        <tr>
<?php 
if ($this->configuration->getValue('list.batch_actions')) {
    ?>
         <?php 
         echo __(isset($category['name']) ? $category['name'] : $name);
         ?>
         </a>
     <?php 
     } else {
         ?>
     <li class="dropdown">
         <a data-toggle="dropdown" href="#" class="dropdown-toggle" >
             <?php 
         echo __(isset($category['name']) ? $category['name'] : $name);
         ?>
             <b class="caret"></b>
         </a>
         <?php 
         if (isset($category['items']) && sfTwitterBootstrap::hasItemsMenu($category['items'])) {
             ?>
         <ul class="dropdown-menu">
         <?php 
             include_partial('sfTwitterBootstrap/menu_list', array('items' => $category['items'], 'items_in_menu' => true));
             ?>
         </ul>
         <?php 
         }
         ?>
     <?php 
     }
     ?>
     </li>
  <?php 
 }
      <?php 
            }
            ?>
      <li <?php 
            echo $item['in_menu'] ? 'class="item"' : 'class="item-menu"';
            ?>
>
        <a href="<?php 
            echo url_for($item['url']);
            ?>
" title="<?php 
            echo __($item['name']);
            ?>
">
          <?php 
            if (sfTwitterBootstrap::getProperty('resize_mode') == 'thumbnail') {
                ?>
            <?php 
                echo image_tag(substr($item['image'], 0, strrpos($item['image'], '/')) . '/small/' . substr($item['image'], strrpos($item['image'], '/') + 1), array('alt' => $item['name'], 'width' => '16', 'height' => '16'));
                ?>
          <?php 
            } else {
                ?>
            <?php 
                echo image_tag($item['image'], array('alt' => $item['name'], 'width' => '16', 'height' => '16'));
                ?>
          <?php 
            }
            ?>
          <span><?php 
            echo __($item['name']);