예제 #1
0
 /**
  * DOCUMENT ME
  * @param sfWebRequest $request
  * @return mixed
  */
 public function executeRename(sfWebRequest $request)
 {
     $page = $this->retrievePageForEditingByIdParameter();
     $this->flunkUnless($page);
     $this->flunkUnless($page->userHasPrivilege('edit'));
     $form = new aRenameForm($page);
     $form->bind($request->getParameter('aRenameForm'));
     if ($form->isValid()) {
         $values = $form->getValues();
         // The slugifier needs to see pre-encoding text
         $page->updateLastSlugComponent($values['title']);
         $title = htmlentities($values['title'], ENT_COMPAT, 'UTF-8');
         $page->setTitle($title);
     }
     // Valid or invalid, redirect. You have to work hard to come up with an invalid title
     return $this->redirect($page->getUrl());
 }
예제 #2
0
<?php 
$page = aTools::getCurrentPage();
?>

<?php 
if ($edit) {
    ?>

  <form method="POST" action="<?php 
    echo url_for('a/rename') . '?' . http_build_query(array('id' => $page->id));
    ?>
" id="a-breadcrumb-rename-form" class="epc-form a-breadcrumb-form rename">

	<?php 
    $form = new aRenameForm($page);
    ?>
	<?php 
    echo $form->renderHiddenFields();
    ?>
	
	<?php 
    echo $form['title']->render(array('id' => 'a-breadcrumb-rename-title'));
    ?>

	  <ul id="a-breadcrumb-rename-controls" class="a-form-controls a-breadcrumb-controls rename" style="display:none;">
			<li>
				<input type="submit" class="a-btn a-submit" value="<?php 
    echo __('Rename', null, 'apostrophe');
    ?>
" />