Ejemplo n.º 1
0
<ul class="sf_admin_actions_form">
<?php 
foreach ($this->configuration->getValue('show.actions') as $name => $params) {
    //$params['params'] = UIHelper::addClasses($params,'ui-state-default');
    if (!key_exists('ui-icon', $params)) {
        $params['ui-icon'] = '';
    }
    $params['params'] = UIHelper::addClasses($params);
    if ('_list' == $name) {
        ?>
  <?php 
        echo $this->addCredentialCondition('[?php echo $helper->linkToList(' . $this->asPhp($params) . ') ?]', $params);
        ?>

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

<?php 
    } elseif ('_delete' == $name) {
        ?>
  <?php 
        echo $this->addCredentialCondition('[?php echo $helper->linkToDelete($form->getObject(), ' . $this->asPhp($params) . ') ?]', $params);
        ?>

<?php 
    } else {
        ?>
Ejemplo n.º 2
0
            <?php elseif ('_edit' == $name): ?>
              <?php echo $this->addCredentialCondition('[?php echo $helper->linkToEdit($'.$this->getSingularName().', '.$this->asPhp($params).') ?]', $params) ?>
        
            <?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 
        $params['label'] .= UIHelper::addIcon($params);
        ?>
        <?php 
        echo $this->addCredentialCondition($this->getLinkToAction($name, $params, true), $params);
        ?>
      </li>
    <?php 
    }
    ?>
    
    <?php 
    if (isset($params['condition'])) {
        ?>
      [?php endif; ?]
    <?php 
    }
Ejemplo n.º 3
0
 /**
  * Adds an UI icon
  *
  * @param string $type Icon type
  * @return string
  * @static
  */
 public static function getIcon($type)
 {
     if (is_null(self::$icons)) {
         self::$icons = sfConfig::get('app_sf_admin_theme_jroller_plugin_icons', array());
     }
     return array_key_exists($type, self::$icons) ? self::$icons[$type] : '';
 }
Ejemplo n.º 4
0
echo $this->getUrlForAction('list');
?>
?'.$extend_url.'page='.$pager->getNextPage()) ?]"[?php if ($pager->getPage() == $pager->getLastPage()) echo ' class="ui-state-disabled"' ?]>
                  <?php 
echo UIHelper::addIconByConf('next');
?>
                </a>
              </td>

              <td class="button">
                <a href="[?php echo url_for('@<?php 
echo $this->getUrlForAction('list');
?>
?'.$extend_url.'page='.$pager->getLastPage()) ?]"[?php if ($pager->getPage() == $pager->getLastPage()) echo ' class="ui-state-disabled"' ?]>
                  <?php 
echo UIHelper::addIconByConf('last');
?>
                </a>
              </td>
              [?php endif; ?]
            </tr>
          </tbody>
        </table>
      </td>
      <td class="right">
        [?php
      	echo __('View %1% - %2% of %3%',
          array(
            '%1%' => $first,
            '%2%' => ($last > $pager->getNbResults()) ? $pager->getNbResults() : $last,
            '%3%' => $pager->getNbResults()
Ejemplo n.º 5
0
 public static function getState($cloudAccountId, $instanceID)
 {
     $account = CloudAccountHelper::findAndDecrypt($cloudAccountId);
     $data = self::executeAction('describeInstances', $account, $instanceID);
     if ($data['status'] == 'OK') {
         if (!empty($data['message']['Reservations'][0]['Instances'][0]['State']['Name'])) {
             return UIHelper::getLabel($data['message']['Reservations'][0]['Instances'][0]['State']['Name']);
         } else {
             return UIHelper::getLabel('NA');
         }
     } else {
         if ($data['status'] == 'error') {
             return UIHelper::getLabel($data['status']);
         } else {
             return UIHelper::getLabel('NA');
         }
     }
 }