public function searchAction()
 {
     $text = $_POST["text"];
     if (Text::startsWith($this->translateEngine->getLanguage(), "en", true)) {
         $domaines = Domaine::find("libelle LIKE '%" . $text . "%'");
         $rubriques = Rubrique::find("titre LIKE '%" . $text . "%' OR description LIKE '%" . $text . "%'");
         $exemples = Exemple::find("titre LIKE '%" . $text . "%' OR description LIKE '%" . $text . "%'");
     } else {
         $domaines = array();
         $rubriques = array();
         $exemples = array();
         $translations = $this->translateEngine->getTranslations();
         if ($text != "") {
             $arrayTranslations = $translations->filter(function ($object) use($text) {
                 if ($object->getName() == "domaine.libelle" && stristr($object->getText(), $text) !== false) {
                     return $object;
                 }
             });
             if (sizeof($arrayTranslations) > 0) {
                 $domaines = Domaine::find($this->_getCondition($arrayTranslations));
             }
             $arrayRubriques = $translations->filter(function ($object) use($text) {
                 if (Text::startsWith($object->getName(), "rubrique" && stristr($object->getText(), $text) !== false)) {
                     return $object;
                 }
             });
             if (sizeof($arrayRubriques) > 0) {
                 $rubriques = Rubrique::find($this->_getCondition($arrayRubriques));
             }
             $arrayExemples = $translations->filter(function ($object) use($text) {
                 if (Text::startsWith($object->getName(), "exemple")) {
                     if (stristr($object->getText(), $text) !== false) {
                         return $object;
                     }
                 }
             });
             if (sizeof($arrayExemples) > 0) {
                 $exemples = Exemple::find($this->_getCondition($arrayExemples));
             }
         }
     }
     $this->_searchResults($text, $domaines, $rubriques, $exemples);
 }
 public function showMainDomaine($id, $domaines)
 {
     $jquery = $this->controller->jquery;
     $grid = $jquery->semantic()->htmlGrid("my-Grid-main");
     foreach ($domaines as $domaine) {
         $col = $grid->addCol(4);
         $idDom = "ss-item-" . $domaine->getId();
         $col->addContent(new HtmlHeader("", 3, "<a href='#' id='" . $idDom . "'>" . $domaine->getLibelle() . "</a>", "page"));
         $rubrique = \Rubrique::findFirst(array("idDomaine = " . $domaine->getId(), "order" => "ordre"));
         if ($rubrique !== false) {
             $exemple = \Exemple::findFirst(array("idRubrique = " . $rubrique->getId(), "order" => "demo DESC"));
             if ($exemple !== false && $exemple->getDemo() > 0) {
                 $exec = "";
                 $col->setWidth(4 * $exemple->getDemo());
                 if ($exemple->getExecPHP()) {
                     $startPoint = '<hidden>';
                     $endPoint = '</hidden>';
                     ob_start();
                     $this->jquery = $jquery;
                     $php = str_ireplace([$startPoint, $endPoint], "", $exemple->getPhp());
                     eval($this->initPHP() . $php);
                     $exec = ob_get_clean();
                     $col->addContent($exec);
                 }
             }
         }
     }
     $jquery->getOnClick(".ui.header>a", "Index/content/", "#response");
     echo $grid;
 }
Пример #3
0
        };
        if (TRUE) {
        }
        include 'FILENAME';
        include_once 'FILENAME';
        if (FALSE) {
        } elseif (TRUE) {
        }
        isset($A);
        list($A, $B) = ['A', 'B'];
        TRUE or TRUE;
        new SELF();
        new STATIC();
        PARENT::HELLO();
        print 'HELLO';
        require 'FILENAME';
        require_once 'FILENAME';
        return $A;
        switch ($CASE) {
            case TRUE && TRUE:
                break;
            default:
        }
        unset($A);
        while (FALSE) {
        }
        TRUE xor TRUE;
    }
}
Exemple::reset();
$time = time();