Example #1
0
 /**
  * Replace code before <!--BEGIN--> and after <!--END--> by the html main container's code
  *
  * @param $content string
  * @return string updated content
  */
 protected function parseContainer($content)
 {
     $i = strpos($content, '<!--BEGIN-->');
     if ($i !== false) {
         $i += 12;
         $j = strrpos($content, '<!--END-->', $i);
         $short_class = Namespaces::shortClassName(get_class(reset($this->objects)));
         $short_form_id = strtolower($short_class) . '_edit';
         $this->form_id = $short_form_id . '_' . $this->nextFormCounter();
         $action = SL . $short_class . '/write';
         $content = substr($content, 0, $i) . $this->replaceSectionByForm(substr($content, $i, $j - $i), $action) . substr($content, $j);
     }
     return parent::parseContainer($content);
 }