/**
  * Méthode permettant d'afficher l'arbre à partir de celui passé en paramètre.
  *
  * @param ITree $tree
  * @param array $options
  * @param $key
  *
  * @return mixed|string
  */
 public function render(ITree $tree, array $options, $key)
 {
     $this->defaults($tree, $tree->getRoot());
     if ($key != null && !isset($options["baseId"])) {
         $options["id"] = $this->options["id"] . "_" . $key;
         $options["baseId"] = $this->options["id"];
     } elseif ($key != null && isset($options["baseId"])) {
         $options["id"] = $options["baseId"] . "_" . $key;
     }
     if ($key != null && isset($options["selected"])) {
         $options["selected"] = isset($options["selected"][$key]) ? $options["selected"][$key] : "";
     }
     $options = array_merge($this->options, $options);
     $build = function ($tree) use(&$build, &$options, $key) {
         $output = is_string($options['rootOpen']) ? $options['rootOpen'] : $options['rootOpen']($tree);
         $nodes = $tree instanceof ITreeViewerItem && $tree->isRoot() ? array($tree) : $tree;
         /** @var ITreeViewerItem $node */
         foreach ($nodes as $node) {
             $output .= is_string($options['childOpen']) ? $options['childOpen'] : $options['childOpen']($node, $node->getType(), $key);
             $output .= $options['nodeDecorator']($node);
             if (count($node->getChildren()) > 0) {
                 $output .= $build($node->getChildren());
             }
             $output .= is_string($options['childClose']) ? $options['childClose'] : $options['childClose']($node);
         }
         return $output . (is_string($options['rootClose']) ? $options['rootClose'] : $options['rootClose']($tree));
     };
     return html_entity_decode(sfOutputEscaper::unescape(get_component("eitreeviewer", "displaySelectMode", array("root" => $tree, "html" => $build($tree->getRoot()), "options" => $options, "key" => $key, "tree" => $this))), ENT_QUOTES, "UTF-8");
 }
示例#2
0
/**
 * Evaluates and returns a partial.
 * The syntax is similar to the one of include_partial
 *
 * <b>Example:</b>
 * <code>
 *  echo get_partial('mypartial', array('myvar' => 12345));
 * </code>
 *
 * @param  string $templateName  partial name
 * @param  array  $vars          variables to be made accessible to the partial
 *
 * @return string result of the partial execution
 * @see    include_partial
 */
function get_theme_partial($templateName, $vars = array())
{
    $context = sfContext::getInstance();
    $actionName = '_' . $templateName;
    $class = 'sfThemePartialView';
    $current_theme = $context->getConfiguration()->getPluginConfiguration('sfThemePlugin')->getThemeManager()->getCurrentTheme();
    $view = new $class($context, $current_theme, $actionName, '');
    $view->setPartialVars(true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($vars) : $vars);
    return $view->render();
}
 /**
  * Trim comment to 30 characters
  * 
  * @param string $comment
  * @return string
  */
 protected function trimComment($comment)
 {
     if (strlen($comment) > 30) {
         $escape = sfConfig::get('sf_escaping_strategy');
         if ($escape) {
             $comment = sfOutputEscaper::unescape($comment);
         }
         $comment = substr($comment, 0, 30) . '...';
         if ($escape) {
             $comment = sfOutputEscaper::escape(sfConfig::get('sf_escaping_method'), $comment);
         }
     }
     return $comment;
 }
示例#4
0
/**
 * Includes a navigation for paginated list
 *
 * @param sfPager $pager
 * @param string  $internal_uri
 * @param array   $options
 */
function op_include_pager_navigation($pager, $internal_uri, $options = array())
{
    $uri = url_for($internal_uri);
    if (isset($options['use_current_query_string']) && $options['use_current_query_string']) {
        $options['query_string'] = sfContext::getInstance()->getRequest()->getCurrentQueryString();
        $pageFieldName = isset($options['page_field_name']) ? $options['page_field_name'] : 'page';
        $options['query_string'] = preg_replace('/' . $pageFieldName . '=\\d\\&*/', '', $options['query_string']);
        unset($options['page_field_name']);
        unset($options['use_current_query_string']);
    }
    if (isset($options['query_string'])) {
        $options['link_options']['query_string'] = $options['query_string'];
        unset($options['query_string']);
    }
    $params = array('pager' => $pager, 'internalUri' => $internal_uri, 'options' => new opPartsOptionHolder($options));
    $pager = sfOutputEscaper::unescape($pager);
    if ($pager instanceof sfReversibleDoctrinePager) {
        include_partial('global/pagerReversibleNavigation', $params);
    } else {
        include_partial('global/pagerNavigation', $params);
    }
}
示例#5
0
        <td><?php 
        $fromDate = new DateTime($loan['from_date']);
        echo $fromDate->format('d/m/Y');
        ?>
</td>
        <td><?php 
        $toDate = new DateTime($loan['to_date']);
        echo $toDate->format('d/m/Y');
        ?>
</td>
        <td><?php 
        echo link_to(image_tag('blue_eyel.png'), url_for(array('module' => 'loan', 'action' => 'index', 'id' => $loan->getId())));
        ?>
</td>
        <?php 
        if (in_array($loan->getId(), sfOutputEscaper::unescape($rights))) {
            ?>
        <td><?php 
            echo link_to(image_tag('edit.png'), url_for(array('module' => 'loan', 'action' => 'edit', 'id' => $loan->getId())));
            ?>
</td>
        <td><?php 
            echo link_to(image_tag('remove.png'), url_for(array('module' => 'loan', 'action' => 'delete', 'id' => $loan->getId())), array('method' => 'delete', 'confirm' => __('Are you sure?')));
            ?>
        </td>
        <?php 
        } else {
            ?>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <?php 
示例#6
0
        </td>
        <td class="right">
            <?php 
    if ($paragraph->getIsPhoto()) {
        ?>
                <?php 
        echo image_tag($paragraph->getPathPhotoRu());
        ?>
            <?php 
    } else {
        ?>
            <p<?php 
        echo sfOutputEscaper::unescape($paragraph->getParagraphStyle());
        ?>
><?php 
        echo sfOutputEscaper::unescape($paragraph->getParagraphRuBr());
        ?>
</p>
            <?php 
    }
    ?>
        </td>
      </tr>
    <?php 
}
// $paragraph
?>

    <tr id="add_paragraph_before" <?php 
if ($ll == 0) {
    echo 'style="display: none;"';
<?php

if (isset($objects)) {
    foreach ($objects as $object) {
        if (sfOutputEscaper::unescape($object) instanceof EiFonction) {
            echo sfOutputEscaper::unescape($object);
        } else {
            $object->printVersion();
        }
    }
}
示例#8
0
         <?php 
     } else {
         ?>
           <?php 
         echo $change->getOldValue(true);
         ?>
         <?php 
     }
     ?>
       </td>
       <td>
         <?php 
     if (ncChangeLogConfigHandler::shouldEscapeValues()) {
         ?>
           <?php 
         echo sfOutputEscaper::unescape($change->getNewValue(true));
         ?>
         <?php 
     } else {
         ?>
           <?php 
         echo $change->getNewValue(true);
         ?>
         <?php 
     }
     ?>
       </td>
     </tr>
   <?php 
 }
 ?>
});
</script>
<div class="container">
  <?php 
foreach ($institutions as $institution) {
    ?>
    <h2><?php 
    echo $institution->getFormatedName();
    ?>
</h2>
    <div class="treelist">
    <?php 
    $w = new sfWidgetCollectionList(array('choices' => array(), 'is_choose' => $is_choose));
    $root = $tree = new Collections();
    foreach ($institution->Collections as $item) {
        $it = sfOutputEscaper::unescape($item);
        $anc = $tree->getFirstCommonAncestor($it);
        $anc->addChild($it);
        $tree = $it;
    }
    echo $w->displayTree($root, '', array(), '', $sf_user);
    ?>

    </div>
  <?php 
}
?>
  <?php 
if ($sf_user->isAtLeast(Users::MANAGER)) {
    ?>
    <div class='new_link'><a <?php 
示例#10
0
$t->is(sfOutputEscaper::unescape('&lt;strong&gt;escaped!&lt;/strong&gt;'), '<strong>escaped!</strong>', '::unescape() returns an unescaped string if the value to unescape is a string');
$t->is(sfOutputEscaper::unescape('&lt;strong&gt;&eacute;chapp&eacute;&lt;/strong&gt;'), '<strong>échappé</strong>', '::unescape() returns an unescaped string if the value to unescape is a string');
$t->diag('::unescape() unescapes arrays');
$input = sfOutputEscaper::escape('esc_entities', array('foo' => '<strong>escaped!</strong>', 'bar' => array('foo' => '<strong>escaped!</strong>')));
$output = sfOutputEscaper::unescape($input);
$t->ok(is_array($output), '::unescape() returns an array if the input is a sfOutputEscaperArrayDecorator object');
$t->is($output['foo'], '<strong>escaped!</strong>', '::unescape() unescapes all elements of the original array');
$t->is($output['bar']['foo'], '<strong>escaped!</strong>', '::unescape() is recursive');
$t->diag('::unescape() unescapes objects');
$object = new OutputEscaperTestClass();
$input = sfOutputEscaper::escape('esc_entities', $object);
$output = sfOutputEscaper::unescape($input);
$t->isa_ok($output, 'OutputEscaperTestClass', '::unescape() returns the original object when a sfOutputEscaperObjectDecorator object is passed');
$t->is($output->getTitle(), '<strong>escaped!</strong>', '::unescape() unescapes all methods of the original object');
$t->is($output->title, '<strong>escaped!</strong>', '::unescape() unescapes all properties of the original object');
$t->is($output->getTitleTitle(), '<strong>escaped!</strong>', '::unescape() is recursive');
$t->isa_ok(sfOutputEscaperIteratorDecorator::unescape(sfOutputEscaper::escape('esc_entities', new DirectoryIterator('.'))), 'DirectoryIterator', '::unescape() unescapes sfOutputEscaperIteratorDecorator objects');
$t->diag('::unescape() does not unescape object marked as being safe');
$t->isa_ok(sfOutputEscaper::unescape(sfOutputEscaper::escape('esc_entities', new sfOutputEscaperSafe(new OutputEscaperTestClass()))), 'OutputEscaperTestClass', '::unescape() returns the original value if it is marked as being safe');
sfOutputEscaper::markClassAsSafe('OutputEscaperTestClass');
$t->isa_ok(sfOutputEscaper::unescape(sfOutputEscaper::escape('esc_entities', new OutputEscaperTestClass())), 'OutputEscaperTestClass', '::unescape() returns the original value if the object class is marked as being safe');
$t->isa_ok(sfOutputEscaper::unescape(sfOutputEscaper::escape('esc_entities', new OutputEscaperTestClassChild())), 'OutputEscaperTestClassChild', '::unescape() returns the original value if one of the object parent class is marked as being safe');
$t->diag('::unescape() do nothing to resources');
$fh = fopen(__FILE__, 'r');
$t->is(sfOutputEscaper::unescape($fh), $fh, '::unescape() do nothing to resources');
$t->diag('::unescape() unescapes mixed arrays');
$object = new OutputEscaperTestClass();
$input = array('foo' => 'bar', 'bar' => sfOutputEscaper::escape('esc_entities', '<strong>bar</strong>'), 'foobar' => sfOutputEscaper::escape('esc_entities', $object));
$output = array('foo' => 'bar', 'bar' => '<strong>bar</strong>', 'foobar' => $object);
$t->is(sfOutputEscaper::unescape($input), $output, '::unescape() unescapes values with some escaped and unescaped values');
示例#11
0
/**
 * Set the op_mobile_header slot
 *
 * @param string $title
 * @param string $subtitle
 */
function op_mobile_page_title($title, $subtitle = '')
{
    $params = array('title' => sfOutputEscaper::unescape($title), 'subtitle' => sfOutputEscaper::unescape($subtitle));
    slot('op_mobile_header', get_partial('global/partsPageTitle', $params));
}
 /**
  * Before checking cache key - saves passed tags
  *
  * @see parent::checkCacheKey()
  * @param  array  $parameters An array of parameters
  * @return string The cache key
  */
 public function checkCacheKey(array &$parameters)
 {
     $tagsKey = 'sf_cache_tags';
     $this->temporaryContentTags = null;
     if (isset($parameters[$tagsKey])) {
         $tags = true === sfConfig::get('sf_escaping_strategy') ? sfOutputEscaper::unescape($parameters[$tagsKey]) : $parameters[$tagsKey];
         unset($parameters[$tagsKey]);
         if ($tags) {
             $this->temporaryContentTags = $tags;
         }
     }
     return parent::checkCacheKey($parameters);
 }
?>
" method="post" enctype="multipart/form-data">
                            <table width="800" border="0" align="center" cellpadding="0" cellspacing="6" style="border-radius: 10px;border: 1px solid #D3D3D3;">
                                <tr align="right">
                                    <td colspan="2" align="left" class="blue">Datos del Pago</td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <?php 
echo $form->renderGlobalErrors();
?>

                                    </td>
                                </tr>
                                <?php 
echo sfOutputEscaper::unescape($form['tipo_tdc']->renderRow());
?>

                                <?php 
echo $form['vence']->renderRow();
?>

                                <?php 
echo $form['tdc']->renderRow();
?>

                                <?php 
echo $form['banco']->renderRow();
?>

                                <?php 
示例#14
0
        <?php 
        } else {
            ?>
          <?php 
            echo $loan->getToDateFormatted();
            ?>
        <?php 
        }
        ?>
      </td>
      <td><?php 
        echo link_to(image_tag('blue_eyel.png'), 'loan/view?id=' . $loan->getId(), 'class=view_loan');
        ?>
</td>
      <?php 
        if (in_array($loan->getId(), sfOutputEscaper::unescape($rights)) || $sf_user->isA(Users::ADMIN)) {
            ?>
        <td><?php 
            echo link_to(image_tag('edit.png'), 'loan/edit?id=' . $loan->getId(), 'class=edit_loan');
            ?>
</td>
      <?php 
        } else {
            ?>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <?php 
        }
        ?>
    </tr>
    <?php 
<div class="page">

  <div class="warn_message">
    <p>
      <?php 
echo __('The record that you are trying to delete has children. If you delete it, every children will be deleted too!');
?>
    </p>
    <br />
    <span class="remove_confirm">
      <?php 
echo image_tag('remove.png');
?>
      <?php 
echo link_to("Delete it anyway", sfOutputEscaper::unescape($link_delete));
?>
    </span>
    <?php 
echo link_to("Cancel", sfOutputEscaper::unescape($link_cancel));
?>
    <br /><br />
  </div>
</div>
</td>
                                    </tr>
                                <?php 
}
?>

                                <tr>
                                    <td colspan="2">
                                        <?php 
echo $form->renderGlobalErrors();
?>

                                    </td>
                                </tr>
                                <?php 
echo sfOutputEscaper::unescape($form['authorizer_id']->renderRow());
?>

                                <?php 
echo $form['customer_name']->renderRow();
?>

                                <?php 
echo $form['customer_id']->renderRow();
?>

                                <?php 
echo $form['card_number']->renderRow();
?>

                                <?php 
示例#17
0
        echo ei_icon('ei_scenario');
        ?>
                    <?php 
        echo $scenText;
        ?>
                    </a> 
                </li> <?php 
        $dt = $ei_campaign_graph->getEiDataSet();
        ?>
                <?php 
        if (!is_null($dt)) {
            ?>
   
                <li class="active">
                     <?php 
            if ($dt instanceof sfOutputEscaperIteratorDecorator && !count(sfOutputEscaper::unescape($dt)->getId()) > 0) {
                ?>
                    <?php 
            } else {
                ?>
 
                     
                    <a href="#" class="tooltipObjTitle troncObjName"    data-placement="top" data-toggle="tooltip"
                       data-original-title="<?php 
                echo $dt;
                ?>
">  
                        <?php 
                echo ei_icon('ei_dataset');
                ?>
                    <?php 
<?php

$options->setDefault('button', __('Send'));
$options->setDefault('return_button', __('戻る'));
$options->setDefault('url', url_for(sfContext::getInstance()->getRouting()->getCurrentInternalUri()));
$options->setDefault('method', 'post');
$options->setDefault('mark_required_field', true);
?>

<?php 
if (isset($options['body'])) {
    echo sfOutputEscaper::unescape($options['body']);
}
?>

<form action="<?php 
echo $options['url'];
?>
" method="<?php 
echo $options['method'];
?>
">
<?php 
$forms = $options['form'] instanceof sfForm ? array($options['form']) : $options['form'];
?>

<?php 
include_customizes($id, 'formTop');
?>

<?php 
示例#19
0
function _call_component($moduleName, $componentName, $vars)
{
    $context = sfContext::getInstance();
    $controller = $context->getController();
    if (!$controller->componentExists($moduleName, $componentName)) {
        // cannot find component
        throw new sfConfigurationException(sprintf('The component does not exist: "%s", "%s".', $moduleName, $componentName));
    }
    // create an instance of the action
    $componentInstance = $controller->getComponent($moduleName, $componentName);
    // load component's module config file
    require $context->getConfigCache()->checkConfig('modules/' . $moduleName . '/config/module.yml');
    // pass unescaped vars to the component
    $componentInstance->getVarHolder()->add(sfOutputEscaper::unescape($vars));
    // dispatch component
    $componentToRun = 'execute' . ucfirst($componentName);
    if (!method_exists($componentInstance, $componentToRun)) {
        if (!method_exists($componentInstance, 'execute')) {
            // component not found
            throw new sfInitializationException(sprintf('sfComponent initialization failed for module "%s", component "%s".', $moduleName, $componentName));
        }
        $componentToRun = 'execute';
    }
    if (sfConfig::get('sf_logging_enabled')) {
        $context->getEventDispatcher()->notify(new sfEvent(null, 'application.log', array(sprintf('Call "%s->%s()' . '"', $moduleName, $componentToRun))));
    }
    // run component
    if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) {
        $timer = sfTimerManager::getTimer(sprintf('Component "%s/%s"', $moduleName, $componentName));
    }
    $retval = $componentInstance->{$componentToRun}($context->getRequest());
    if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) {
        $timer->addTime();
    }
    return sfView::NONE == $retval ? null : $componentInstance->getVarHolder()->getAll();
}
示例#20
0
            ?>
              <?php 
        }
        ?>
            </td>
            <td>
              <?php 
        echo $item->getDescription();
        ?>
            </td>
            <td class="">
              <?php 
        echo link_to(image_tag('blue_eyel.png', array("title" => __("View"))), 'loan/view?id=' . $item->getId());
        ?>
              <?php 
        if (in_array($item->getId(), sfOutputEscaper::unescape($rights)) || $sf_user->isAtLeast(Users::ADMIN)) {
            ?>
              <?php 
            echo link_to(image_tag('edit.png', array('title' => __('Edit loan'))), 'loan/edit?id=' . $item->getId());
            ?>
              <?php 
        }
        ?>
            </td>
          </tr>
          <tr class="hidden details details_rid_<?php 
        echo $item->getId();
        ?>
" >
            <td colspan="8"></td>
          </tr>
<tests>
    <?php 
$prefix = 'http://' . $sf_request->getHost();
?>
    <?php 
if (isset($objects)) {
    ?>
    <?php 
    foreach ($objects as $object) {
        if (sfOutputEscaper::unescape($object) instanceof EiFonction) {
            $fonction = sfOutputEscaper::unescape($object);
            $kal_fonction = $fonction->getKalFonction();
            ?>
                <test>
                    <url>
                        <?php 
            echo str_replace('&', '&amp;', $prefix . url_for('@generateFunctionXMLLink?profile_id=' . $profile_id . '&profile_ref=' . $profile_ref . '&function_id=' . $fonction->getId() . '&login='******'&pwd=' . $pwd . '&sf_format=xml'));
            ?>
                    </url>
                    <url_xml>
                        <?php 
            echo $prefix . $sf_request->getPathInfoPrefix() . "/eifonction/generateXML?function_id=" . $fonction->getId() . "&amp;profile_id=" . $profile_id . "&amp;profile_ref=" . $profile_ref . '&amp;login='******'&amp;pwd=' . $pwd . '&amp;sf_format=xml';
            ?>
                        
                    </url_xml>
                    <url_xsl>
                        <?php 
            echo $prefix . $sf_request->getPathInfoPrefix() . "/eifonction/genererXSL/" . $login . '/' . $pwd . '/' . $kal_fonction->function_id . "/" . $kal_fonction->function_ref . "/" . $profile_id . "/" . $profile_ref . ".xml";
            ?>
                    </url_xsl>
?>
    </ul>
    
    <div class="jobs-container">
      
      <div class="actions">
        <a href="#" id="addViewAllJob" class="btn">Select all jobs</a>
        <a href="#" id="removeViewAllJob" class="btn">Unselect all jobs</a>
      </div>

      <div class="jobs">
        <?php 
foreach ($form['builds'] as $jobName => $widget) {
    ?>
        <div class="job <?php 
    isset($view_by_jobs[$jobName]) && (print implode(' ', sfOutputEscaper::unescape($view_by_jobs[$jobName])));
    ?>
">
          <?php 
    echo $widget['job_name']->renderError();
    ?>
          <?php 
    echo $widget['job_name']->renderLabel();
    ?>
          <?php 
    echo $widget['job_name']->render();
    ?>

          <div class="parameters">
            <?php 
    if (isset($widget['parameters'])) {
示例#23
0
 
        <?php 
    foreach ($list_notices as $name => $fonctions) {
        ?>
            <tr>
                <th colspan="2"><h2 class="img_function_name"><?php 
        echo $name;
        ?>
</h2></th>
        </tr> 
        <?php 
        foreach ($fonctions as $id_fonction => $noticeVersion) {
            ?>
 
            <?php 
            if (sfOutputEscaper::unescape($noticeVersion) != null) {
                ?>
                <tr> 
                    <td class="desc_img_notice">
                        <!-- Traitement des paramètres variables dans la notice -->
                        <?php 
                echo html_entity_decode(MyFunction::parseDescImg($noticeVersion['description'], $id_fonction, $profileParams));
                ?>
                    </td> 
                </tr> 
                <?php 
            } else {
                ?>
                <tr> 
                    <td class="desc_img_notice">
                        <h6>No Notice Version define for this environment and language</h6>
        </table>
      <?php 
} else {
    ?>
        &nbsp;
      <?php 
}
?>
  </td>
  <td class="right">
      <?php 
if ($paragraph->getIsPhoto()) {
    ?>
          <?php 
    echo image_tag($paragraph->getPathPhotoRu());
    ?>
      <?php 
} else {
    ?>
      <p<?php 
    echo sfOutputEscaper::unescape($paragraph->getParagraphStyle());
    ?>
><?php 
    echo $paragraph->getRawValue()->getParagraphRuBr();
    ?>
</p>
      <?php 
}
?>
  </td>
</tr>
示例#25
0
echo __('Widget');
?>
</th>
    </tr>
    <?php 
foreach ($widget as $category => $list) {
    ?>
    <tr>
      <td><?php 
    echo $category;
    ?>
</td>
      <td><ul>
      <?php 
    foreach ($list as $name) {
        ?>
          <li><?php 
        echo sfOutputEscaper::unescape($name);
        ?>
</li>
      <?php 
    }
    ?>
      </ul></td>
    </tr>
    <?php 
}
?>
  </tbdoy>
</table>
?>
</th>
      <th><?php 
echo __("Identifiers");
?>
</th>
    </tr>
  </thead>
  <?php 
foreach ($identifications as $identification) {
    ?>
  <tbody id="refIdent" class="spec_ident_data">
    <tr class="spec_ident_data">
      <td class="datesNum">
        <?php 
    echo sfOutputEscaper::unescape($identification->getNotionDateMasked());
    ?>
      </td>
      <td>
        <?php 
    echo $identification->getNotionConcerned();
    ?>
      </td>
      <td>
        <?php 
    echo $identification->getValueDefined();
    ?>
      </td>
      <td>
        <?php 
    echo $identification->getDeterminationStatus();