コード例 #1
0
 /**
  * Listens to the response.filter_content event and adds the
  * editor drop-down menu to the response
  */
 public function addAdminMenuHtml(sfEvent $event, $content)
 {
     // See if admin_menu_html should be autoinsert in content
     if (!sfSympalConfig::get('add_admin_menu_html')) {
         return $content;
     }
     // See if the editor was disabled
     if (!sfConfig::get('sympal.editor_menu', true)) {
         return $content;
     }
     $statusCode = $event->getSubject()->getStatusCode();
     if ($statusCode == 404 || $statusCode == 500) {
         return $content;
     }
     $this->configuration->loadHelpers(array('SympalAdmin'));
     $content = str_replace('</body>', get_sympal_admin_menu() . '</body>', $content);
     return $content;
 }
コード例 #2
0
 public function addEditorHtml(sfEvent $event, $content)
 {
     $this->configuration->loadHelpers(array('Admin'));
     $content = str_replace('</body>', get_sympal_admin_menu() . '</body>', $content);
     return $content;
 }