Exemplo 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 {
        ?>
<td>
  <ul class="sf_admin_td_actions">
<?php 
foreach ($this->configuration->getValue('list.object_actions') as $name => $params) {
    $params['params'] = UIHelper::addClasses($params, 'sf_button_inline ui-state-default ui-priority-secondary');
    if ('_delete' == $name) {
        ?>
    <?php 
        echo $this->addCredentialCondition('[?php echo $helper->linkToDelete($' . $this->getSingularName() . ', ' . $this->asPhp($params) . ') ?]', $params);
        ?>

<?php 
    } elseif ('_edit' == $name) {
        ?>
    <?php 
        echo $this->addCredentialCondition('[?php echo $helper->linkToEdit($' . $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);
        ?>
Exemplo n.º 3
0
<td>
  <ul class="sf_admin_td_actions fg-buttonset fg-buttonset-single">
  <?php 
foreach ($this->configuration->getValue('list.object_actions') as $name => $params) {
    ?>
    <?php 
    if (!key_exists('ui-icon', $params)) {
        $params['ui-icon'] = '';
    }
    $params['params'] = UIHelper::addClasses($params, 'fg-button-mini');
    ?>

    <?php 
    if (isset($params['condition'])) {
        ?>
        [?php if ( <?php 
        echo (isset($params['condition']['invert']) && $params['condition']['invert'] ? '!' : '') . '$' . $this->getSingularName() . '->' . $params['condition']['function'];
        ?>
( <?php 
        echo isset($params['condition']['params']) ? $params['condition']['params'] : '';
        ?>
 ) ): ?] 
    <?php 
    }
    ?>
        
    
    <?php 
    if ('_delete' == $name) {
        ?>
      <?php 
<ul class="sf_admin_actions">
<?php 
foreach (array('new', 'edit') as $action) {
    if ('new' == $action) {
        ?>
[?php if ($form->isNew()): ?]
<?php 
    } else {
        ?>
[?php else: ?]
<?php 
    }
    foreach ($this->configuration->getValue($action . '.actions') as $name => $params) {
        $params['params'] = UIHelper::addClasses($params, 'ui-state-default');
        if ('_list' == $name) {
            ?>
  <?php 
            echo $this->addCredentialCondition('[?php echo $helper->linkToList(' . $this->asPhp($params) . ') ?]', $params);
            ?>

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

<?php 
        } elseif ('_save_and_add' == $name) {
            ?>
  <?php