Exemplo n.º 1
0
 /**
  * Retrieve all component ids from template html code (need to check user input)
  * @param string $themeName
  * @param string $layoutName
  * @param string $templateName
  * @return array
  */
 public function getComponentIdListByTemplate($themeName, $layoutName, $templateName)
 {
     $key = $layoutName . '->' . $layoutName . '->' . $templateName;
     if (!($idList = @$this->models['components'][$key])) {
         $idList = array();
         if (!($html = $this->themeStorage->retrieveHtml($themeName, $layoutName, $templateName))) {
             return $idList;
         }
         $handler = $this->handlerClassName;
         $handler::addComponentsDirectory(APPPATH . 'src/Core/Service/Theme/Component', 'Core\\Service\\Theme\\Component');
         $handler::processHtml($html, function ($component, $componentName, $node) use(&$idList) {
             $idList[] = $node->getAttribute('id');
         });
         $this->models['components'][$key] = $idList;
     }
     return $idList;
 }
Exemplo n.º 2
0
 /**
  * Uninstall theme
  * @param Theme $theme
  * @return void
  */
 public function uninstall(Theme $theme)
 {
     $this->storage->delete($theme->getName());
 }
Exemplo n.º 3
0
 /**
  * Retrieve html code of installed theme
  * This is pure html code
  *
  * @param $themeName
  * @param $layoutName
  * @param $templateName
  * @return string
  */
 public function get($themeName, $layoutName, $templateName)
 {
     return $this->storage->retrieveHtml($themeName, $layoutName, $templateName);
 }