├── .gitignore ├── documentation ├── html │ ├── fonts │ │ ├── Harabara.eot │ │ ├── Harabara.ttf │ │ └── Harabara.woff │ ├── footer.html │ └── extra-styles.css └── filters │ └── traits.php ├── Ajax ├── semantic │ ├── html │ │ ├── base │ │ │ ├── ClassModifier.php │ │ │ ├── constants │ │ │ │ ├── Sens.php │ │ │ │ ├── Side.php │ │ │ │ ├── Direction.php │ │ │ │ ├── CheckboxType.php │ │ │ │ ├── VerticalAlignment.php │ │ │ │ ├── Emphasis.php │ │ │ │ ├── RevealType.php │ │ │ │ ├── SegmentType.php │ │ │ │ ├── HeaderSize.php │ │ │ │ ├── Size.php │ │ │ │ ├── StepStatus.php │ │ │ │ ├── TextAlignment.php │ │ │ │ ├── Style.php │ │ │ │ ├── Social.php │ │ │ │ ├── icons │ │ │ │ │ ├── Message.php │ │ │ │ │ ├── Currency.php │ │ │ │ │ ├── Technologies.php │ │ │ │ │ ├── Media.php │ │ │ │ │ ├── PaymentOptions.php │ │ │ │ │ ├── UserTypes.php │ │ │ │ │ ├── LayoutAdjustment.php │ │ │ │ │ ├── Animals.php │ │ │ │ │ ├── Rating.php │ │ │ │ │ ├── Map.php │ │ │ │ │ ├── GenderSexuality.php │ │ │ │ │ ├── Shapes.php │ │ │ │ │ ├── Audio.php │ │ │ │ │ ├── Tables.php │ │ │ │ │ ├── TextEditor.php │ │ │ │ │ ├── Objects.php │ │ │ │ │ ├── ItemSelection.php │ │ │ │ │ ├── ComputerFilesystem.php │ │ │ │ │ ├── WebContent.php │ │ │ │ │ ├── UserActions.php │ │ │ │ │ ├── Pointers.php │ │ │ │ │ └── Brands.php │ │ │ │ ├── Wide.php │ │ │ │ ├── Variation.php │ │ │ │ ├── emojis │ │ │ │ │ ├── People.php │ │ │ │ │ └── Nature.php │ │ │ │ ├── Color.php │ │ │ │ ├── Transition.php │ │ │ │ └── State.php │ │ │ ├── traits │ │ │ │ ├── TableElementTrait.php │ │ │ │ ├── AttachedTrait.php │ │ │ │ ├── TextAlignmentTrait.php │ │ │ │ ├── HasTimeoutTrait.php │ │ │ │ ├── LabeledIconTrait.php │ │ │ │ └── IconTrait.php │ │ │ ├── HtmlSemSingleElement.php │ │ │ └── HtmlSemCollection.php │ │ ├── templates │ │ │ ├── tplDropdownMenu.php │ │ │ └── tplDropdown.php │ │ ├── views │ │ │ ├── HtmlCard.php │ │ │ ├── HtmlItems.php │ │ │ └── HtmlCardGroups.php │ │ ├── content │ │ │ ├── view │ │ │ │ ├── HtmlItem.php │ │ │ │ ├── ContentPartTrait.php │ │ │ │ └── HtmlViewGroups.php │ │ │ ├── HtmlAccordionMenuItem.php │ │ │ ├── HtmlShapeItem.php │ │ │ ├── HtmlMenuItem.php │ │ │ ├── HtmlAccordionItem.php │ │ │ ├── HtmlStepItem.php │ │ │ ├── HtmlGridCol.php │ │ │ ├── HtmlListItem.php │ │ │ └── InternalPopup.php │ │ ├── elements │ │ │ ├── HtmlLoader.php │ │ │ ├── html5 │ │ │ │ ├── HtmlDatalist.php │ │ │ │ ├── HtmlImg.php │ │ │ │ └── HtmlLink.php │ │ │ ├── HtmlContainer.php │ │ │ ├── HtmlFlag.php │ │ │ ├── HtmlRail.php │ │ │ ├── HtmlLabelGroups.php │ │ │ ├── HtmlImage.php │ │ │ ├── HtmlSegmentGroups.php │ │ │ ├── HtmlDivider.php │ │ │ ├── HtmlIconGroups.php │ │ │ └── HtmlEmoji.php │ │ ├── modules │ │ │ ├── checkbox │ │ │ │ ├── HtmlRadio.php │ │ │ │ └── HtmlCheckbox.php │ │ │ ├── HtmlRating.php │ │ │ ├── HtmlSticky.php │ │ │ └── HtmlToast.php │ │ └── collections │ │ │ ├── form │ │ │ ├── HtmlFormRadio.php │ │ │ ├── traits │ │ │ │ ├── TextFieldsTrait.php │ │ │ │ └── CheckboxTrait.php │ │ │ ├── HtmlFormTextarea.php │ │ │ └── HtmlFormCheckbox.php │ │ │ ├── menus │ │ │ ├── HtmlIconMenu.php │ │ │ ├── HtmlLabeledIconMenu.php │ │ │ ├── HtmlAccordionMenu.php │ │ │ └── HtmlPaginationMenu.php │ │ │ └── table │ │ │ └── ActiveRow.php │ ├── components │ │ ├── search │ │ │ ├── ISearch.php │ │ │ ├── AbstractSearchResult.php │ │ │ ├── SearchCategory.php │ │ │ ├── SearchCategories.php │ │ │ └── SearchResult.php │ │ ├── Rating.php │ │ ├── Shape.php │ │ ├── Tab.php │ │ ├── Progress.php │ │ ├── Dimmer.php │ │ ├── Sticky.php │ │ ├── Accordion.php │ │ ├── Checkbox.php │ │ ├── validation │ │ │ ├── CustomRule.php │ │ │ ├── AjaxRule.php │ │ │ └── languages │ │ │ │ └── fr.js │ │ ├── Modal.php │ │ ├── Search.php │ │ ├── Visibility.php │ │ ├── Popup.php │ │ ├── SimpleSemExtComponent.php │ │ ├── Slider.php │ │ ├── Dropdown.php │ │ ├── Form.php │ │ └── jsTemplates │ │ │ └── tplCheckedList.php │ ├── widgets │ │ ├── datatable │ │ │ └── PositionInTable.php │ │ ├── business │ │ │ ├── user │ │ │ │ └── UserModel.php │ │ │ └── BusinessForm.php │ │ └── dataelement │ │ │ └── DeInstanceViewer.php │ └── traits │ │ └── SemanticHtmlViewsTrait.php ├── bootstrap │ ├── html │ │ ├── templates │ │ │ ├── tplInputgroup.php │ │ │ ├── tplCarouselControl.php │ │ │ ├── tplCarouselItem.php │ │ │ ├── tplPanel.php │ │ │ ├── tplProgressbar.php │ │ │ ├── tplDropdown.php │ │ │ ├── tplCarousel.php │ │ │ ├── tplSplitbutton.php │ │ │ ├── tplModal.php │ │ │ └── tplNavbar.php │ │ ├── base │ │ │ ├── CssNavbar.php │ │ │ ├── CssSize.php │ │ │ ├── CssButton.php │ │ │ ├── HtmlElementAsContent.php │ │ │ ├── HtmlNavElement.php │ │ │ └── HtmlBsDoubleElement.php │ │ ├── HtmlInputRadio.php │ │ ├── HtmlInputCheckbox.php │ │ ├── HtmlBadge.php │ │ ├── content │ │ │ ├── HtmlTabContentItem.php │ │ │ ├── HtmlTabContent.php │ │ │ ├── HtmlCarouselControl.php │ │ │ ├── HtmlCarouselItem.php │ │ │ └── HtmlTabItem.php │ │ ├── HtmlLink.php │ │ ├── HtmlGlyphButton.php │ │ ├── HtmlLabel.php │ │ ├── HtmlSplitbutton.php │ │ ├── HtmlGlyphicon.php │ │ ├── HtmlInput.php │ │ └── HtmlListgroup.php │ └── components │ │ ├── js │ │ └── Draggable.php │ │ ├── Popover.php │ │ ├── Splitbutton.php │ │ ├── Scrollspy.php │ │ ├── Dropdown.php │ │ └── Collapse.php ├── common │ ├── html │ │ ├── HtmlContentOnly.php │ │ ├── html5 │ │ │ ├── HtmlUtils.php │ │ │ ├── HtmlLinkTrait.php │ │ │ ├── HtmlList.php │ │ │ ├── HtmlOption.php │ │ │ ├── HtmlTextarea.php │ │ │ ├── HtmlImg.php │ │ │ └── HtmlInput.php │ │ ├── traits │ │ │ ├── BaseHooksTrait.php │ │ │ └── NavElementTrait.php │ │ ├── BaseWidget.php │ │ ├── HtmlSingleElement.php │ │ └── PropertyWrapper.php │ ├── components │ │ ├── GenericComponent.php │ │ └── SimpleExtComponent.php │ └── JsCode.php ├── ui │ ├── components │ │ ├── Menu.php │ │ ├── Tabs.php │ │ ├── Spinner.php │ │ ├── Selectmenu.php │ │ ├── Progressbar.php │ │ ├── Slider.php │ │ ├── Buttonset.php │ │ ├── DialogButton.php │ │ └── Dialog.php │ └── properties │ │ └── Animation.php ├── php │ ├── symfony │ │ ├── JquerySemantic.php │ │ ├── JqueryBootstrap.php │ │ └── Jquery_.php │ ├── cakephp │ │ ├── JsUtilsComponent.php │ │ └── _JsUtils.php │ ├── ubiquity │ │ └── UIService.php │ ├── laravel │ │ └── JsUtils.php │ ├── yii │ │ └── JsUtils.php │ └── phalcon │ │ └── JsUtils.php ├── lib │ ├── CDNJQuery.php │ ├── CDNCoreCss.php │ └── CDNBase.php ├── service │ ├── JQueryAjaxEffect.php │ ├── AjaxTransition.php │ ├── JReflection.php │ └── AjaxCall.php ├── config │ ├── DefaultConfig.php │ └── Config.php └── Semantic.php ├── CONTRIBUTING.md ├── .scrutinizer.yml ├── .github └── issue_template.md └── composer.json /.gitignore: -------------------------------------------------------------------------------- 1 | .project 2 | *.buildpath 3 | .settings/* 4 | doxygeneJquery 5 | doc/* 6 | .idea/ 7 | -------------------------------------------------------------------------------- /documentation/html/fonts/Harabara.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpMv/phpMv-UI/HEAD/documentation/html/fonts/Harabara.eot -------------------------------------------------------------------------------- /documentation/html/fonts/Harabara.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpMv/phpMv-UI/HEAD/documentation/html/fonts/Harabara.ttf -------------------------------------------------------------------------------- /documentation/html/fonts/Harabara.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phpMv/phpMv-UI/HEAD/documentation/html/fonts/Harabara.woff -------------------------------------------------------------------------------- /Ajax/semantic/html/base/ClassModifier.php: -------------------------------------------------------------------------------- 1 | 3 | %input% 4 | %items% 5 | '; 6 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplInputgroup.php: -------------------------------------------------------------------------------- 1 | 3 | %addonLeft% 4 | 5 | %addonRight% 6 | '; 7 | -------------------------------------------------------------------------------- /Ajax/semantic/html/templates/tplDropdown.php: -------------------------------------------------------------------------------- 1 | 3 | %input% 4 | %content% 5 | <%mTagName% class="%mClass%"> 6 | %items% 7 | 8 | '; 9 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/base/CssNavbar.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | %caption% 6 | '; 7 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Sens.php: -------------------------------------------------------------------------------- 1 | 4 | %imageAlt% 5 | 8 | '; 9 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Direction.php: -------------------------------------------------------------------------------- 1 | 3 | %header% 4 | %collapseBegin% 5 |
6 | %content% 7 |
8 | %footer% 9 | %collapseEnd% 10 | '; 11 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Emphasis.php: -------------------------------------------------------------------------------- 1 | 4 | %caption% 5 | '; 6 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/SegmentType.php: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Rating.php: -------------------------------------------------------------------------------- 1 | uiName="rating"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Shape.php: -------------------------------------------------------------------------------- 1 | uiName="shape"; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/TextAlignment.php: -------------------------------------------------------------------------------- 1 | mask="$('%identifier%').draggable({ handle: '.modal-header' });"; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Style.php: -------------------------------------------------------------------------------- 1 | _template='%wrapContentBefore%%content%%wrapContentAfter%'; 9 | $this->setContent($content); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlUtils.php: -------------------------------------------------------------------------------- 1 | '; 8 | } 9 | 10 | public static function stylesheetInclude($url){ 11 | return ''; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Wide.php: -------------------------------------------------------------------------------- 1 | uiName="tab"; 12 | } 13 | public function setDebug($value=true) { 14 | return $this->setParam("debug", $value); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Variation.php: -------------------------------------------------------------------------------- 1 | 3 | <%tagName% id="%identifier%" class="%class%" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 4 | %btnCaption% 5 | 6 | 7 | 10 | '; 11 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/emojis/People.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 10 | 13 | 14 | 15 | %leftControl% 16 | %rightControl% 17 | '; 18 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/PaymentOptions.php: -------------------------------------------------------------------------------- 1 | uiName = "menu"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/ui/components/Tabs.php: -------------------------------------------------------------------------------- 1 | uiName = "tabs"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/ui/components/Spinner.php: -------------------------------------------------------------------------------- 1 | uiName = "spinner"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Popover.php: -------------------------------------------------------------------------------- 1 | uiName="popover"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/UserTypes.php: -------------------------------------------------------------------------------- 1 | uiName = "selectmenu"; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/php/symfony/JquerySemantic.php: -------------------------------------------------------------------------------- 1 | true,"defer"=>true],$router); 11 | $this->container=$container; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Ajax/php/symfony/JqueryBootstrap.php: -------------------------------------------------------------------------------- 1 | true,"defer"=>true],$router); 11 | $this->container=$container; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/LayoutAdjustment.php: -------------------------------------------------------------------------------- 1 | 3 | <%tagName% id="split-%identifier%" class="%class%">%btnCaption% 4 | <%tagName% id="%identifier%" class="%class%" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 5 | 6 | 7 | 10 | '; 11 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlAccordionMenuItem.php: -------------------------------------------------------------------------------- 1 | content->setActive($value); 13 | return $this; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Ajax/semantic/components/search/AbstractSearchResult.php: -------------------------------------------------------------------------------- 1 | fromDatabaseObject($object, $function); 11 | } 12 | } 13 | return $this; 14 | } 15 | 16 | abstract protected function fromDatabaseObject($object, $function); 17 | } 18 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Progress.php: -------------------------------------------------------------------------------- 1 | uiName="progress"; 12 | } 13 | 14 | public function setOnChange($jsCode) { 15 | return $this->params["onChange"]=$jsCode; 16 | } 17 | 18 | public function setText($values) { 19 | return $this->params["text"]=$values; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Ajax/ui/components/Progressbar.php: -------------------------------------------------------------------------------- 1 | params = array( 18 | "value" => 50 19 | ); 20 | $this->uiName = "progressbar"; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/Animals.php: -------------------------------------------------------------------------------- 1 | setProperty("type", "radio"); 15 | $this->setProperty("class", ""); 16 | if (isset($label)) { 17 | $this->setLabel($label, false); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/Rating.php: -------------------------------------------------------------------------------- 1 | jquery=new _JsUtils(); 17 | if(isset($semantic)){ 18 | $this->jquery->semantic(new Semantic()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/checkbox/HtmlRadio.php: -------------------------------------------------------------------------------- 1 | setType($checkboxType); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlInputCheckbox.php: -------------------------------------------------------------------------------- 1 | setProperty("type", "checkbox"); 15 | $this->setProperty("class", ""); 16 | if (isset($label)) { 17 | $this->setLabel($label, false); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlLinkTrait.php: -------------------------------------------------------------------------------- 1 | setProperty("href", $value); 12 | } 13 | 14 | public function getHref() { 15 | return $this->getProperty("href"); 16 | } 17 | 18 | public function setTarget($value="_self") { 19 | return $this->setProperty("target", $value); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlBadge.php: -------------------------------------------------------------------------------- 1 | content=$caption; 18 | $this->setProperty("class", "badge"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Ajax/lib/CDNJQuery.php: -------------------------------------------------------------------------------- 1 | data=$this->data ["JQuery"]; 13 | } 14 | 15 | public function getUrl() { 16 | return $this->getUrlOrCss($this->jsUrl, "url"); 17 | } 18 | 19 | public function __toString() { 20 | $url=$this->getUrl(); 21 | return HtmlUtils::javascriptInclude($url); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/Map.php: -------------------------------------------------------------------------------- 1 | setProperty("role", "tabpanel"); 17 | $this->setProperty("class", "tab-pane"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlShapeItem.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", "active", ["active"]); 14 | }else{ 15 | $this->removePropertyValue("class", "active"); 16 | } 17 | return $this; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Dimmer.php: -------------------------------------------------------------------------------- 1 | uiName = "dimmer"; 11 | } 12 | 13 | public function setOn($value = false) { 14 | $this->params["on"] = $value; 15 | } 16 | 17 | public function setOpacity($value) { 18 | $this->params["opacity"] = $value; 19 | } 20 | 21 | public function setClosable($value) { 22 | $this->params["closable"] = $value; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Ajax/config/DefaultConfig.php: -------------------------------------------------------------------------------- 1 | array ( 12 | "txt" => "input_text", 13 | "btn" => "button", 14 | "ck" => "checkbox", 15 | "cmb" => "select_1", 16 | "list" => "select_5", 17 | "_" => "input_hidden", 18 | "f" => "input_file", 19 | "radio" => "radio", 20 | "mail" => "input_email" 21 | ) 22 | )); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/GenderSexuality.php: -------------------------------------------------------------------------------- 1 | uiName="sticky"; 12 | } 13 | 14 | /** 15 | * 16 | * @param string $value default : "" 17 | * @return $this 18 | */ 19 | public function setContext($value="") { 20 | return $this->setParam("context", $value); 21 | } 22 | 23 | public function setOffset($offset=0){ 24 | return $this->setParam("offset", $offset); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplModal.php: -------------------------------------------------------------------------------- 1 | 3 | 17 | '; 18 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Accordion.php: -------------------------------------------------------------------------------- 1 | uiName="accordion"; 12 | } 13 | 14 | /** 15 | * 16 | * @param string $value default : click 17 | * @return $this 18 | */ 19 | public function setOn($value="click") { 20 | return $this->setParam("on", $value); 21 | } 22 | 23 | public function setExclusive($value=true) { 24 | return $this->setParam("exclusive", $value); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/emojis/Nature.php: -------------------------------------------------------------------------------- 1 | login; 14 | } 15 | 16 | public function setLogin($login) { 17 | $this->login=$login; 18 | return $this; 19 | } 20 | 21 | public function getPassword() { 22 | return $this->password; 23 | } 24 | 25 | public function setPassword($password) { 26 | $this->password=$password; 27 | return $this; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Checkbox.php: -------------------------------------------------------------------------------- 1 | uiName="checkbox"; 12 | } 13 | 14 | public function setOnChecked($value) { 15 | $this->params["onChecked"]="%function(){".$value."}%"; 16 | } 17 | 18 | public function setOnUnchecked($value) { 19 | $this->params["onUnchecked"]="%function(){".$value."}%"; 20 | } 21 | 22 | public function setOnChange($value){ 23 | $this->params["onChange"]="%function(){".$value."}%"; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/html5/HtmlDatalist.php: -------------------------------------------------------------------------------- 1 | setProperty("value", $value); 16 | $elm->setContent($value); 17 | return $elm; 18 | } 19 | 20 | protected function createCondition($value) { 21 | return true; 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /Ajax/common/components/GenericComponent.php: -------------------------------------------------------------------------------- 1 | jquery_code_for_compile=array (); 15 | foreach ( $this->jsCodes as $jsCode ) { 16 | $this->jquery_code_for_compile []=$jsCode->compile(array ( 17 | "identifier" => $this->attachTo 18 | )); 19 | } 20 | $this->compileEvents(); 21 | return $this->compileJQueryCode(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ajax/ui/components/Slider.php: -------------------------------------------------------------------------------- 1 | uiName = "slider"; 18 | $this->setParam("value", 0); 19 | } 20 | 21 | public function onChange($jsCode) { 22 | return $this->addEvent("change", $jsCode); 23 | } 24 | 25 | public function onSlide($jsCode) { 26 | return $this->addEvent("slide", $jsCode); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Ajax/common/JsCode.php: -------------------------------------------------------------------------------- 1 | mask=$mask; 15 | } 16 | 17 | public function getMask() { 18 | return $this->mask; 19 | } 20 | 21 | public function setMask($mask) { 22 | $this->mask=$mask; 23 | return $this; 24 | } 25 | 26 | public function compile($keyAndvalues) { 27 | $result=$this->mask; 28 | foreach ( $keyAndvalues as $k => $v ) { 29 | $result=str_ireplace("%{$k}%", $v, $result); 30 | } 31 | return $result; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Ajax/semantic/html/views/HtmlItems.php: -------------------------------------------------------------------------------- 1 | count()); 22 | } 23 | 24 | public function newItem($identifier) { 25 | return new HtmlItem($identifier); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Ajax/config/Config.php: -------------------------------------------------------------------------------- 1 | vars=$vars; 10 | } 11 | 12 | public function setVar($name, $values) { 13 | $this->vars [$name]=$values; 14 | return $this; 15 | } 16 | 17 | public function getVar($name) { 18 | return $this->vars [$name]; 19 | } 20 | 21 | public function getVars() { 22 | return $this->vars; 23 | } 24 | 25 | public function setVars($values) { 26 | $this->vars=$values; 27 | return $this; 28 | } 29 | 30 | public function addVars($values) { 31 | $this->vars=array_merge($this->vars, $values); 32 | return $this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/semantic/components/validation/CustomRule.php: -------------------------------------------------------------------------------- 1 | jsFunction = $jsFunction; 21 | } 22 | 23 | public function compile(JsUtils $js) { 24 | $js->exec(Rule::custom($this->getType(), $this->jsFunction), true); 25 | } 26 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Color.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", self::RED); 13 | } 14 | 15 | public static function setGreen(HtmlSemDoubleElement $e) { 16 | return $e->addToProperty("class", self::GREEN); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Splitbutton.php: -------------------------------------------------------------------------------- 1 | events as $event => $jsCode ) { 13 | if ($event==="buttonClick") { 14 | $this->jquery_code_for_compile []="$( \"#split-".preg_replace('/[^a-zA-Z0-9\-.]/s', '', $this->attachTo)."\" ).on(\"click\" , function( event, data ) {".$jsCode."});"; 15 | } else { 16 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).on(\"".$event."\" , function( event, data ) {".$jsCode."});"; 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/HtmlFormRadio.php: -------------------------------------------------------------------------------- 1 | _identifier=$identifier; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/traits/TextFieldsTrait.php: -------------------------------------------------------------------------------- 1 | getDataField()->setPlaceholder($value); 11 | return $this; 12 | } 13 | 14 | public function setValue($value){ 15 | $this->getDataField()->setValue($value); 16 | return $this; 17 | } 18 | 19 | public function setInputType($type){ 20 | if($type==="hidden") 21 | $this->addToProperty("style","display:none;"); 22 | $this->getDataField()->setInputType($type); 23 | return $this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Modal.php: -------------------------------------------------------------------------------- 1 | 11 | * @version 1.0.1 12 | * 13 | */ 14 | class Modal extends SimpleSemExtComponent { 15 | 16 | public function __construct(JsUtils $js) { 17 | parent::__construct($js); 18 | $this->uiName='modal'; 19 | } 20 | 21 | public function showDimmer(){ 22 | return $this->addBehavior('hide dimmer'); 23 | } 24 | 25 | public function setInverted(){ 26 | $this->params['inverted']=true; 27 | } 28 | 29 | public function setOnHidden($jsCode) { 30 | $this->addComponentEvent('onHidden', $jsCode); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Ajax/php/symfony/Jquery_.php: -------------------------------------------------------------------------------- 1 | container->get("twig"); 18 | $this->compile($parameters); 19 | return new Response($twig->render($viewName, $parameters)); 20 | } 21 | 22 | public function generateUrl($path){ 23 | $request=Request::createFromGlobals(); 24 | return $request->getBaseUrl().$path; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlLink.php: -------------------------------------------------------------------------------- 1 | setHref($href); 15 | $this->content=$content; 16 | } 17 | 18 | /* 19 | * (non-PHPdoc) 20 | * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run() 21 | */ 22 | public function run(JsUtils $js) { 23 | $this->_bsComponent=$js->bootstrap()->generic("#".$this->identifier); 24 | $this->addEventsOnRun($js); 25 | return $this->_bsComponent; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/TableElementTrait.php: -------------------------------------------------------------------------------- 1 | addState(State::POSITIVE); 13 | } 14 | 15 | public function setNegative() { 16 | return $this->addState(State::NEGATIVE); 17 | } 18 | 19 | public function setWarning() { 20 | return $this->addState(State::WARNING); 21 | } 22 | 23 | public function setError() { 24 | return $this->addState(State::ERROR); 25 | } 26 | 27 | public function setDisabled($disable=true) { 28 | if($disable) 29 | $this->addState(State::DISABLED); 30 | return $this; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/HtmlSemSingleElement.php: -------------------------------------------------------------------------------- 1 | _baseClass=$baseClass; 19 | $this->setClass($baseClass); 20 | } 21 | 22 | /** 23 | * {@inheritDoc} 24 | * @see \Ajax\semantic\html\base\traits\BaseTrait::addContent() 25 | */ 26 | public function addContent($content, $before=false) {} 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/Objects.php: -------------------------------------------------------------------------------- 1 | content=$content; 19 | } 20 | 21 | public function asText(){ 22 | return $this->addToProperty("class", "text"); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlGlyphButton.php: -------------------------------------------------------------------------------- 1 | _template='<%tagName% id="%identifier%" %properties%>%glyph% %content%'; 16 | $this->tagName="button"; 17 | $this->setGlyph($glyph); 18 | } 19 | 20 | public function setGlyph($glyph) { 21 | $this->glyph=new HtmlGlyphicon($this->identifier."-glyph"); 22 | $this->glyph->setGlyphicon($glyph); 23 | return $this; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Transition.php: -------------------------------------------------------------------------------- 1 | _baseClass="ui image"; 13 | $this->setClass($this->_baseClass); 14 | } 15 | 16 | public function asAvatar($caption=NULL) { 17 | if (isset($caption)) 18 | $this->wrap("", $caption); 19 | return $this->addToProperty("class", "avatar"); 20 | } 21 | 22 | /** 23 | * {@inheritDoc} 24 | * @see \Ajax\semantic\html\base\traits\BaseTrait::addContent() 25 | */ 26 | public function addContent($content, $before=false) {} 27 | } 28 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/AttachedTrait.php: -------------------------------------------------------------------------------- 1 | setAttached(true); 19 | } 20 | return $this->addToPropertyCtrl("class", $side . " attached", Side::getConstantValues("attached")); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/HtmlSemCollection.php: -------------------------------------------------------------------------------- 1 | _baseClass=$baseClass; 18 | $this->setClass($baseClass); 19 | } 20 | 21 | public function run(JsUtils $js) { 22 | parent::run($js); 23 | $this->_bsComponent=$js->semantic()->generic("#".$this->identifier); 24 | $this->addEventsOnRun($js); 25 | return $this->_bsComponent; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/checkbox/HtmlCheckbox.php: -------------------------------------------------------------------------------- 1 | setType($checkboxType); 13 | } 14 | } 15 | 16 | public static function slider($identifier, $label="", $value=NULL) { 17 | return new HtmlCheckbox($identifier, $label, $value, CheckboxType::SLIDER); 18 | } 19 | 20 | public static function toggle($identifier, $label="", $value=NULL) { 21 | return new HtmlCheckbox($identifier, $label, $value, CheckboxType::TOGGLE); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Ajax/common/components/SimpleExtComponent.php: -------------------------------------------------------------------------------- 1 | events [$event]=$jsCode; 13 | return $this; 14 | } 15 | 16 | public function getScript() { 17 | parent::getScript(); 18 | $this->compileJsCodes(); 19 | return $this->compileJQueryCode(); 20 | } 21 | 22 | protected function compileJsCodes(){ 23 | foreach ( $this->jsCodes as $jsCode ) { 24 | $this->jquery_code_for_compile []=$jsCode->compile(array ( 25 | "identifier" => $this->attachTo 26 | )); 27 | } 28 | } 29 | 30 | public function addCode($jsCode) { 31 | $this->jsCodes []=new JsCode($jsCode); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Scrollspy.php: -------------------------------------------------------------------------------- 1 | uiName="scrollspy"; 18 | } 19 | 20 | /* 21 | * (non-PHPdoc) 22 | * @see \Ajax\common\components\SimpleComponent::attach() 23 | */ 24 | public function attach($identifier) { 25 | parent::attach($identifier); 26 | } 27 | 28 | public function setTarget($target) { 29 | $this->setParam("target", $target); 30 | } 31 | 32 | public function onActivate($jsCode) { 33 | $this->addEvent("activate.bs.scrollspy", $jsCode); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Ajax/semantic/html/views/HtmlCardGroups.php: -------------------------------------------------------------------------------- 1 | count()); 20 | } 21 | 22 | public function newItem($identifier) { 23 | return new HtmlCard($identifier); 24 | } 25 | 26 | public function getCard($index) { 27 | return $this->getItem($index); 28 | } 29 | 30 | public function getCardContent($cardIndex, $contentIndex) { 31 | return $this->getItemContent($cardIndex, $contentIndex); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlList.php: -------------------------------------------------------------------------------- 1 | addItems($items); 16 | } 17 | public function setOrdered($ordered=true){ 18 | $this->tagName=($ordered===true)?"ol":"ul"; 19 | } 20 | 21 | /** 22 | * {@inheritDoc} 23 | * @see HtmlCollection::createItem() 24 | */ 25 | protected function createItem($value) { 26 | $item=new HtmlDoubleElement("item-".$this->identifier."-".$this->count()); 27 | $item->setTagName("li"); 28 | $item->setContent($value); 29 | return $item; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Search.php: -------------------------------------------------------------------------------- 1 | uiName="search"; 12 | } 13 | 14 | public function setSource($value) { 15 | $this->params["source"]=$value; 16 | return $this; 17 | } 18 | 19 | public function setType($type) { 20 | $this->params["type"]=$type; 21 | return $this; 22 | } 23 | 24 | public function setSearchFields($fields) { 25 | $this->params["searchFields"]=$fields; 26 | return $this; 27 | } 28 | 29 | public function setApiSettings($value) { 30 | $this->params["apiSettings"]=$value; 31 | return $this; 32 | } 33 | 34 | public function setOnSelect($jsCode) { 35 | $this->params["onSelect"]=$jsCode; 36 | return $this; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /documentation/html/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /Ajax/semantic/widgets/dataelement/DeInstanceViewer.php: -------------------------------------------------------------------------------- 1 | widgetIdentifier."-".$index,"label","",$this->getCaption($index)); 19 | $lbl->setProperty("for", $result->getDataField()->getIdentifier()); 20 | $this->captions[$index]=$lbl; 21 | } 22 | return $result; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlOption.php: -------------------------------------------------------------------------------- 1 | _template=''; 16 | $this->content=$caption; 17 | $this->value=$value; 18 | $this->selected=""; 19 | } 20 | 21 | public function select(){ 22 | $this->selected="selected"; 23 | return $this; 24 | } 25 | 26 | public function getValue() { 27 | return $this->value; 28 | } 29 | public function setValue($value) { 30 | $this->value = $value; 31 | return $this; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/php/ubiquity/UIService.php: -------------------------------------------------------------------------------- 1 | jquery = $controller->jquery; 25 | $this->controller = $controller; 26 | $this->semantic = $this->jquery->semantic(); 27 | } 28 | 29 | public function renderView(string $viewName,array $parameters=[],bool $asString=false){ 30 | return $this->jquery->renderView($viewName,$parameters,$asString); 31 | } 32 | 33 | public function compile(){ 34 | echo $this->jquery->compile(); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/State.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", $state, array ($state )); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/content/HtmlTabContent.php: -------------------------------------------------------------------------------- 1 | setProperty("class", "tab-content"); 17 | $this->content=array (); // HtmlTabContentItem 18 | } 19 | 20 | public function addTabItem($identifier) { 21 | $tabItem=new HtmlTabContentItem($identifier); 22 | $this->content []=$tabItem; 23 | } 24 | 25 | public function getTabItem($index) { 26 | if ($indexcontent)) 27 | return $this->content [$index]; 28 | } 29 | 30 | public function getTabItems() { 31 | return $this->content; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlMenuItem.php: -------------------------------------------------------------------------------- 1 | addIcon($icon); 26 | } 27 | if(isset($title)){ 28 | $this->setTitle($title); 29 | } 30 | }else{ 31 | $this->setContent($content); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlTextarea.php: -------------------------------------------------------------------------------- 1 | setProperty("name", $identifier); 13 | $this->setValue($value); 14 | $this->setPlaceholder($placeholder); 15 | if(isset($rows)) 16 | $this->setRows($rows); 17 | } 18 | public function setValue($value) { 19 | if(isset($value)) 20 | $this->setContent($value); 21 | return $this; 22 | } 23 | 24 | public function setPlaceholder($value){ 25 | if(JString::isNotNull($value)) 26 | $this->setProperty("placeholder", $value); 27 | return $this; 28 | } 29 | 30 | public function setRows($count){ 31 | $this->setProperty("rows", $count); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplNavbar.php: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 | 15 | 16 | 17 | 20 |
21 | '; 22 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/view/ContentPartTrait.php: -------------------------------------------------------------------------------- 1 | getPart($partKey,null,$force); 12 | if($part instanceof HtmlSemDoubleElement){ 13 | $this->content[$partKey]=$part; 14 | $part->addContent($element,$before); 15 | } 16 | return $this; 17 | } 18 | 19 | public function getPart($partKey, $index=NULL,$force=false) { 20 | if (\array_key_exists($partKey, $this->content)) { 21 | if (isset($index)) 22 | return $this->content[$partKey][$index]; 23 | return $this->content[$partKey]; 24 | } 25 | if($force){ 26 | return new HtmlSemDoubleElement($partKey."-".$this->identifier,"div",$partKey); 27 | } 28 | return NULL; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlImg.php: -------------------------------------------------------------------------------- 1 | setSrc($src); 13 | $this->setAlt($alt); 14 | } 15 | 16 | public function getSrc() { 17 | return $this->getProperty("src"); 18 | } 19 | 20 | public function setSrc($src) { 21 | $this->setProperty("src", $src); 22 | return $this; 23 | } 24 | 25 | public function getAlt() { 26 | return $this->getProperty("alt"); 27 | } 28 | 29 | public function setAlt($alt) { 30 | $this->setProperty("alt", $alt); 31 | return $this; 32 | } 33 | 34 | public function getTitle() { 35 | return $this->getProperty("title"); 36 | } 37 | 38 | public function setTitle($title) { 39 | $this->setProperty("title", $title); 40 | return $this; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlFlag.php: -------------------------------------------------------------------------------- 1 | _template=''; 21 | $this->flag=$flag; 22 | } 23 | 24 | public function setFlag($flag) { 25 | $this->flag=$flag; 26 | } 27 | 28 | public static function France() { 29 | return new HtmlFlag("", Country::FRANCE); 30 | } 31 | 32 | public static function byNum($num) { 33 | return new HtmlFlag("", Country::getConstantValues()[$num]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlRail.php: -------------------------------------------------------------------------------- 1 | addToProperty('class', $type); 19 | return $this; 20 | } 21 | 22 | public function setLeft() { 23 | return $this->updateType('left'); 24 | } 25 | 26 | public function setRight() { 27 | return $this->updateType('right'); 28 | } 29 | 30 | public function setInternal() { 31 | return $this->updateType('internal'); 32 | } 33 | 34 | public function setDividing() { 35 | return $this->updateType('dividing'); 36 | } 37 | 38 | public function setClose() { 39 | return $this->updateType('close'); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phpmv/php-mv-ui", 3 | "description": "A JQuery and UI library for php and php MVC frameworks", 4 | "type": "library", 5 | "keywords": [ 6 | "php", 7 | "jquery", 8 | "phalcon", 9 | "symfony", 10 | "laravel", 11 | "Yii", 12 | "ubiquity", 13 | "codeIgniter", 14 | "twitter bootstrap", 15 | "jquery ui", 16 | "semantic ui", 17 | "framework" 18 | ], 19 | "require": { 20 | "php": ">=8.1", 21 | "frameworks/jquery": "~2.1" 22 | }, 23 | "suggest": { 24 | "components/jqueryui": "~1.11", 25 | "twitter/bootstrap": "~3.3", 26 | "fomantic/ui": "~2.7.8" 27 | }, 28 | "autoload": { 29 | "psr-4": { "Ajax\\": "Ajax/" } 30 | }, 31 | "license": "Apache-2.0", 32 | "authors": [ 33 | { 34 | "name": "Jean-Christophe HERON", 35 | "email": "myaddressmail@gmail.com", 36 | "role": "Lead developer" 37 | } 38 | ], 39 | "extra": { 40 | "branch-alias": { 41 | "dev-master": "2.4.x-dev" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /documentation/filters/traits.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", $value,TextAlignment::getConstants()); 17 | } 18 | 19 | public function textCenterAligned(){ 20 | return $this->setTextAlignment(TextAlignment::CENTER); 21 | } 22 | 23 | public function textJustified(){ 24 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); 25 | } 26 | 27 | public function textRightAligned(){ 28 | return $this->setTextAlignment(TextAlignment::RIGHT); 29 | } 30 | 31 | public function textLeftAligned(){ 32 | return $this->setTextAlignment(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlIconMenu.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", "icon"); 24 | } 25 | 26 | 27 | /** 28 | * {@inheritDoc} 29 | * @see HtmlMenu::createItem() 30 | */ 31 | protected function createItem($value) { 32 | $count=\sizeof($this->content); 33 | $value=new HtmlIcon("icon-".$count, $value); 34 | $itemO=new HtmlLink("item-".$count,"",$value); 35 | return $itemO->setClass("item"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/content/HtmlCarouselControl.php: -------------------------------------------------------------------------------- 1 | _template=include __DIR__.'/../templates/tplCarouselControl.php'; 15 | } 16 | 17 | public function getSens() { 18 | return $this->sens; 19 | } 20 | 21 | public function setSens($sens) { 22 | $this->sens=$sens; 23 | return $this; 24 | } 25 | 26 | public function getGlyphIcon() { 27 | return $this->glyphIcon; 28 | } 29 | 30 | public function setGlyphIcon($glyphIcon) { 31 | $this->glyphIcon=$glyphIcon; 32 | return $this; 33 | } 34 | 35 | public function getCaption() { 36 | return $this->caption; 37 | } 38 | 39 | public function setCaption($caption) { 40 | $this->caption=$caption; 41 | return $this; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Visibility.php: -------------------------------------------------------------------------------- 1 | uiName="visibility"; 18 | $this->params=["once"=>false,"observeChanges"=>true]; 19 | } 20 | 21 | public function setOnce($value=false) { 22 | return $this->setParam("once", $value); 23 | } 24 | 25 | public function setObserveChanges($value=true) { 26 | return $this->setParam("observeChanges", $value); 27 | } 28 | 29 | public function setOnTopVisible($value) { 30 | $this->params["onTopVisible"]="%function(){".$value."}%"; 31 | } 32 | 33 | public function setOnBottomVisible($value) { 34 | $this->params["onBottomVisible"]="%function(){".$value."}%"; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/HasTimeoutTrait.php: -------------------------------------------------------------------------------- 1 | _bsComponent)){ 22 | if(isset($this->_timeout)){ 23 | $js->exec("setTimeout(function() { $('#{$this->identifier}').transition({$this->_closeTransition}); }, {$this->_timeout});",true); 24 | } 25 | } 26 | return parent::run($js); 27 | } 28 | 29 | public function setTimeout($_timeout) { 30 | $this->_timeout=$_timeout; 31 | return $this; 32 | } 33 | 34 | public function setCloseTransition($_closeTransition) { 35 | $this->_closeTransition=$_closeTransition; 36 | return $this; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/ComputerFilesystem.php: -------------------------------------------------------------------------------- 1 | content=$caption; 19 | $this->setProperty("class", "label"); 20 | $this->setStyle($style); 21 | } 22 | 23 | /** 24 | * define the label style 25 | * avaible values : "label-default","label-primary","label-success","label-info","label-warning","label-danger" 26 | * @param string|int $cssStyle 27 | * @return \Ajax\bootstrap\html\HtmlLabel default : "label-default" 28 | */ 29 | public function setStyle($cssStyle) { 30 | return $this->addToPropertyCtrl("class", CssRef::getStyle($cssStyle, "label"), CssRef::Styles("label")); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/HtmlFormTextarea.php: -------------------------------------------------------------------------------- 1 | _identifier=$identifier; 17 | } 18 | 19 | /** 20 | * Defines the textarea row count 21 | * @param int $count 22 | */ 23 | public function setRows($count){ 24 | $this->getField()->setRows($count); 25 | } 26 | 27 | public function getDataField() { 28 | return $this->content["field"]; 29 | } 30 | 31 | public function setName($name){ 32 | $this->getDataField()->setProperty("name",$name); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Ajax/ui/components/Buttonset.php: -------------------------------------------------------------------------------- 1 | uiName = "buttonset"; 18 | } 19 | 20 | /** 21 | * Disables the buttonSet if set to true. 22 | * 23 | * @param Boolean $value 24 | * default : false 25 | * @return $this 26 | */ 27 | public function setDisabled($value) { 28 | return $this->setParamCtrl("disabled", $value, "is_bool"); 29 | } 30 | 31 | /** 32 | * Which descendant elements to convert manage as buttons. 33 | * default : "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)" 34 | * 35 | * @param String $value 36 | * @return $this 37 | */ 38 | public function setItems($value) { 39 | return $this->setParam("items", $value); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/HtmlFormCheckbox.php: -------------------------------------------------------------------------------- 1 | _identifier=$identifier; 20 | } 21 | 22 | public static function slider($identifier, $label="", $value=NULL) { 23 | return new HtmlFormCheckbox($identifier, $label, $value, CheckboxType::SLIDER); 24 | } 25 | 26 | public static function toggle($identifier, $label="", $value=NULL) { 27 | return new HtmlFormCheckbox($identifier, $label, $value, CheckboxType::TOGGLE); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Ajax/semantic/traits/SemanticHtmlViewsTrait.php: -------------------------------------------------------------------------------- 1 | addHtmlComponent(new HtmlCard($identifier)); 21 | } 22 | 23 | /** 24 | * @param string $identifier 25 | * @param array $items 26 | * @return HtmlCardGroups 27 | */ 28 | public function htmlCardGroups($identifier, $cards=array()) { 29 | return $this->addHtmlComponent(new HtmlCardGroups($identifier, $cards)); 30 | } 31 | 32 | /** 33 | * @param string $identifier 34 | * @param array $items 35 | * @return HtmlItems 36 | */ 37 | public function htmlItems($identifier, $items=array()) { 38 | return $this->addHtmlComponent(new HtmlItems($identifier, $items)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Ajax/php/laravel/JsUtils.php: -------------------------------------------------------------------------------- 1 | __get("q"); 13 | if (isset($controls) === false) { 14 | $controls=array (); 15 | } 16 | $controls[$identifier]=$content; 17 | $view->__set("q", $controls); 18 | } 19 | 20 | public function createScriptVariable(&$view,$view_var, $output){ 21 | $view->__set($view_var,$output); 22 | } 23 | 24 | public function forward($initialControllerInstance,$controllerName,$actionName,$params=NULL){ 25 | \ob_start(); 26 | App::make($controllerName)->{$actionName}($params); 27 | $result=\ob_get_contents(); 28 | \ob_end_clean(); 29 | return $result; 30 | } 31 | 32 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { 33 | return \view()->make($viewName,$params)->render(); 34 | } 35 | 36 | public function fromDispatcher($dispatcher){ 37 | return $dispatcher->segments(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Ajax/common/html/traits/BaseHooksTrait.php: -------------------------------------------------------------------------------- 1 | _hooks[$hookKey]); 14 | } 15 | 16 | /** 17 | * @param string $hookKey 18 | * @return callable|NULL 19 | */ 20 | public function getHook($hookKey){ 21 | if(isset($this->_hooks[$hookKey])){ 22 | return $this->_hooks[$hookKey]; 23 | } 24 | return null; 25 | } 26 | 27 | /** 28 | * Adds a new Hook 29 | * @param String $hookKey 30 | * @param callable $callable 31 | */ 32 | public function addHook($hookKey,$callable){ 33 | $this->_hooks[$hookKey]=$callable; 34 | } 35 | 36 | /** 37 | * Executes the hook with key $hookKey 38 | * @param string $hookKey 39 | * @param mixed|null $variable 40 | * @return void|mixed 41 | */ 42 | public function execHook($hookKey,...$variables){ 43 | if(($hook=$this->getHook($hookKey))!=null){ 44 | return call_user_func_array($hook,$variables); 45 | } 46 | return; 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/LabeledIconTrait.php: -------------------------------------------------------------------------------- 1 | identifier, $icon); 29 | } 30 | if($labeled!==false){ 31 | $direction=($before===true)?Direction::LEFT:Direction::RIGHT; 32 | $this->addToProperty("class", $direction." labeled icon"); 33 | $this->tagName="div"; 34 | } 35 | $this->addContent($iconO,$before); 36 | return $iconO; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlLabeledIconMenu.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", "labeled icon"); 24 | } 25 | 26 | /** 27 | * {@inheritDoc} 28 | * @see HtmlMenu::createItem() 29 | */ 30 | protected function createItem($value) { 31 | $text=""; 32 | $v=$value; 33 | if(\is_array($value)){ 34 | $v=@$value[0]; 35 | $text=@$value[1]; 36 | } 37 | $count=\sizeof($this->content); 38 | $value=new HtmlIcon("icon-".$count, $v); 39 | $value->wrap("",$text); 40 | $itemO=new HtmlLink("item-".$count,"",$value); 41 | return $itemO->setClass("item"); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Ajax/semantic/components/validation/AjaxRule.php: -------------------------------------------------------------------------------- 1 | false, 23 | 'url' => $url, 24 | 'params' => $params, 25 | 'hasLoader' => false, 26 | 'jsCallback' => $jsCallback, 27 | 'dataType' => 'json', 28 | 'stopPropagation' => false, 29 | 'preventDefault' => false, 30 | 'responseElement' => null 31 | ], $parameters); 32 | $this->ajaxCall = new AjaxCall($method, $parameters); 33 | } 34 | 35 | public function compile(JsUtils $js) { 36 | $js->exec(Rule::custom($this->getType(), "function(value,ruleValue){var result=true;" . $this->ajaxCall->compile($js) . "return result;}"), true); 37 | } 38 | } -------------------------------------------------------------------------------- /Ajax/service/AjaxTransition.php: -------------------------------------------------------------------------------- 1 | language){ 25 | $file=\realpath(dirname(__FILE__)."/semantic/components/validation/languages/".$language.".js"); 26 | if(\file_exists($file)){ 27 | $script=\file_get_contents($file); 28 | $this->js->exec($script,true); 29 | $this->language=$language; 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/base/HtmlElementAsContent.php: -------------------------------------------------------------------------------- 1 | element=$element; 19 | } elseif (is_string($element)) { 20 | $this->element=new HtmlBsDoubleElement($element); 21 | } 22 | $this->identifier=$element->getIdentifier(); 23 | } 24 | 25 | public function getElement() { 26 | return $this->element; 27 | } 28 | 29 | public function setElement($element) { 30 | $this->element=$element; 31 | return $this; 32 | } 33 | 34 | public function addBadge($caption, $leftSeparator=" ") { 35 | return $this->element->addBadge($caption,$leftSeparator); 36 | } 37 | 38 | public function addLabel($caption, $style="label-default", $leftSeparator=" ") { 39 | return $this->element->addLabel($caption,$style,$leftSeparator); 40 | } 41 | 42 | public function run(JsUtils $js) { 43 | $this->element->run($js); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/base/HtmlNavElement.php: -------------------------------------------------------------------------------- 1 | root=""; 27 | $this->attr="data-ajax"; 28 | } 29 | 30 | /** 31 | * Associate an ajax get to the elements, displayed in $targetSelector 32 | * $this->attr member is used to build each element url 33 | * @param string $targetSelector the target of the get 34 | * @return HtmlNavElement 35 | */ 36 | public function autoGetOnClick($targetSelector){ 37 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); 38 | } 39 | 40 | public function contentAsString(){ 41 | return implode("", $this->content); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Ajax/php/yii/JsUtils.php: -------------------------------------------------------------------------------- 1 | params; 16 | if (\array_key_exists("q", $params)===false) { 17 | $view->params["q"]=array(); 18 | } 19 | $view->params["q"][$identifier]=$content; 20 | } 21 | 22 | public function createScriptVariable(&$view,$view_var, $output){ 23 | $view->params[$view_var]=$output; 24 | } 25 | 26 | public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ 27 | \ob_start(); 28 | $ctrInfo=\yii::$app->createController($controllerName."/".$actionName); 29 | $ctrInfo[0]->{$ctrInfo[1]}($params); 30 | $result=\ob_get_contents(); 31 | \ob_end_clean(); 32 | return $result; 33 | } 34 | 35 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { 36 | return \yii::$app->view->render($viewName,$params); 37 | } 38 | 39 | public function fromDispatcher($dispatcher){ 40 | $uri=new \Ajax\php\yii\URI(); 41 | return $uri->segment_array(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/html5/HtmlLink.php: -------------------------------------------------------------------------------- 1 | setHref($href); 16 | if(isset($target)) 17 | $this->setTarget($target); 18 | $this->content=$content; 19 | } 20 | 21 | /* 22 | * (non-PHPdoc) 23 | * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run() 24 | */ 25 | public function run(JsUtils $js) { 26 | $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); 27 | $this->addEventsOnRun($js); 28 | return $this->_bsComponent; 29 | } 30 | 31 | public function addIcon($icon, $before=true) { 32 | return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before); 33 | } 34 | 35 | public static function icon($identifier, $icon, $href="#", $label=NULL) { 36 | $result=new HtmlLink($identifier, $href, $label); 37 | return $result->addIcon($icon); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/WebContent.php: -------------------------------------------------------------------------------- 1 | identifier=$this->cleanIdentifier($identifier); 21 | $this->_identifier=$this->identifier; 22 | $this->_self=$this; 23 | } 24 | 25 | public function getIdentifier() { 26 | return $this->identifier; 27 | } 28 | 29 | public function setIdentifier($identifier) { 30 | $this->identifier=$this->cleanIdentifier($identifier); 31 | return $this; 32 | } 33 | 34 | protected function cleanIdentifier($id) { 35 | return JString::cleanIdentifier($id); 36 | } 37 | /** 38 | * @return mixed 39 | */ 40 | public function getLibraryId() { 41 | if( isset($this->_libraryId)){ 42 | return $this->_libraryId; 43 | } 44 | return $this->identifier; 45 | } 46 | 47 | /** 48 | * @param mixed $_libraryId 49 | */ 50 | public function setLibraryId($_libraryId) { 51 | $this->_libraryId = $_libraryId; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/UserActions.php: -------------------------------------------------------------------------------- 1 | identifier, $caption); 14 | $badge->wrap($leftSeparator); 15 | $this->addContent($badge); 16 | return $this; 17 | } 18 | 19 | public function addLabel($caption, $style="label-default", $leftSeparator=" ") { 20 | $label=new HtmlLabel("label-".$this->identifier, $caption, $style); 21 | $label->wrap($leftSeparator); 22 | $this->addContent($label); 23 | return $this; 24 | } 25 | 26 | public function addGlyph($glyphicon,$before=true){ 27 | $glyph=new HtmlGlyphicon(""); 28 | $glyph->setGlyphicon($glyphicon); 29 | $this->addContent($glyph,$before); 30 | return $this; 31 | } 32 | 33 | public function wrapContentWithGlyph($glyphBefore,$glyphAfter=""){ 34 | $before=HtmlGlyphicon::getGlyphicon($glyphBefore)." "; 35 | $after=""; 36 | if($glyphAfter!==""){ 37 | $after=" ".HtmlGlyphicon::getGlyphicon($glyphAfter); 38 | } 39 | return $this->wrapContent($before,$after); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/IconTrait.php: -------------------------------------------------------------------------------- 1 | _hasIcon===false){ 22 | $iconO=$icon; 23 | if(\is_string($icon)){ 24 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); 25 | } 26 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); 27 | $this->addContent($iconO,$direction===Direction::LEFT); 28 | $this->_hasIcon=true; 29 | }else{ 30 | $iconO=$this->getIcon(); 31 | $iconO->setIcon($icon); 32 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); 33 | } 34 | return $iconO; 35 | } 36 | 37 | public function getIcon(){ 38 | if(\is_array($this->content)){ 39 | foreach ($this->content as $item){ 40 | if($item instanceof HtmlIcon) 41 | return $item; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlAccordionMenu.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", "accordion"); 15 | $this->setVertical(); 16 | } 17 | 18 | /** 19 | * {@inheritDoc} 20 | * @see HtmlCollection::createItem() 21 | */ 22 | protected function createItem($value) { 23 | $title=$value; 24 | $content=""; 25 | if(\is_array($value)){ 26 | $title=@$value[0];$content=@$value[1]; 27 | } 28 | $itemO=new HtmlAccordionMenuItem("item-".$this->identifier."-".$this->count(), $title, $content); 29 | return $itemO->setClass("item"); 30 | } 31 | 32 | /* 33 | * (non-PHPdoc) 34 | * @see BaseHtml::run() 35 | */ 36 | public function run(JsUtils $js) { 37 | if(isset($this->_bsComponent)===false) 38 | $this->_bsComponent=$js->semantic()->accordion("#".$this->identifier,$this->params); 39 | $this->addEventsOnRun($js); 40 | return $this->_bsComponent; 41 | } 42 | 43 | public function setExclusive($value){ 44 | $this->params["exclusive"]=$value; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/content/HtmlCarouselItem.php: -------------------------------------------------------------------------------- 1 | _template=include __DIR__.'/../templates/tplCarouselItem.php'; 16 | } 17 | 18 | public function getImageSrc() { 19 | return $this->imageSrc; 20 | } 21 | 22 | public function setImageSrc($imageSrc) { 23 | $this->imageSrc=$imageSrc; 24 | return $this; 25 | } 26 | 27 | public function getImageAlt() { 28 | return $this->imageAlt; 29 | } 30 | 31 | public function setImageAlt($imageAlt) { 32 | $this->imageAlt=$imageAlt; 33 | return $this; 34 | } 35 | 36 | public function getCaption() { 37 | return $this->caption; 38 | } 39 | 40 | public function setCaption($caption) { 41 | $this->caption=$caption; 42 | return $this; 43 | } 44 | 45 | /* 46 | * (non-PHPdoc) 47 | * @see \Ajax\bootstrap\html\base\BaseHtml::run() 48 | */ 49 | public function run(JsUtils $js) { 50 | 51 | } 52 | 53 | public function __toString() { 54 | return $this->compile(); 55 | } 56 | 57 | public function setClass($value) { 58 | $this->setProperty("class", $value); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlLabelGroups.php: -------------------------------------------------------------------------------- 1 | _states=\array_merge(Size::getConstants(),Color::getConstants(),["tag","circular"]); 21 | $this->addItems($labels); 22 | $this->setStates($attributes); 23 | } 24 | 25 | protected function createItem($value) { 26 | $caption=$value; 27 | $icon=NULL; 28 | $tagName="div"; 29 | if (\is_array($value)) { 30 | $caption=JArray::getValue($value, "caption", 0); 31 | $icon=JArray::getValue($value, "icon", 1); 32 | $tagName=JArray::getValue($value, "tagName", 2); 33 | } 34 | $labelO=new HtmlLabel("label-" . $this->identifier, $caption,$icon,$tagName); 35 | return $labelO; 36 | } 37 | 38 | protected function createCondition($value) { 39 | return ($value instanceof HtmlLabel) === false; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlImage.php: -------------------------------------------------------------------------------- 1 | setClass(""); 21 | parent::__construct($identifier, "div", "ui image", $image); 22 | if (isset($size)) 23 | $this->setSize($size); 24 | } 25 | 26 | public function setCircular() { 27 | return $this->addToProperty("class", "circular"); 28 | } 29 | 30 | public function asAvatar($caption=NULL) { 31 | if (isset($caption)) 32 | $this->wrap("", $caption); 33 | return $this->addToProperty("class", "avatar"); 34 | } 35 | 36 | public static function small($identifier, $src="", $alt="") { 37 | return new HtmlImage($identifier, $src, $alt, Size::SMALL); 38 | } 39 | 40 | public static function avatar($identifier, $src="", $caption=NULL) { 41 | $img=new HtmlImage($identifier, $src); 42 | return $img->asAvatar($caption); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Ajax/lib/CDNCoreCss.php: -------------------------------------------------------------------------------- 1 | framework=$framework; 17 | $this->data=$this->data [$framework]; 18 | } 19 | 20 | public function getUrl() { 21 | return $this->getUrlOrCss($this->jsUrl, "core"); 22 | } 23 | 24 | public function getCss() { 25 | return $this->getUrlOrCss($this->cssUrl, "css"); 26 | } 27 | 28 | public function __toString() { 29 | $url=$this->getUrl(); 30 | $css=$this->getCss(); 31 | return HtmlUtils::javascriptInclude($url)."\n".HtmlUtils::stylesheetInclude($css); 32 | } 33 | 34 | public function setCssUrl($cssUrl, $local=null) { 35 | $this->cssUrl=$cssUrl; 36 | if (isset($local)===false) { 37 | $local=JString::startsWith($cssUrl, "http")===false; 38 | } 39 | $this->setLocalCss($local); 40 | return $this; 41 | } 42 | 43 | public function getLocalCss() { 44 | return $this->localCss; 45 | } 46 | 47 | public function setLocalCss($localCss) { 48 | $this->localCss=$localCss; 49 | return $this; 50 | } 51 | 52 | public function getFramework() { 53 | return $this->framework; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/HtmlRating.php: -------------------------------------------------------------------------------- 1 | setValue($value); 19 | $this->setMax($max); 20 | } 21 | 22 | /** 23 | * {@inheritDoc} 24 | * @see \Ajax\common\html\HtmlDoubleElement::setValue() 25 | */ 26 | public function setValue($value){ 27 | $this->setProperty("data-rating", $value); 28 | } 29 | 30 | public function setMax($max){ 31 | $this->setProperty("data-max-rating", $max); 32 | } 33 | 34 | /** 35 | * {@inheritDoc} 36 | * @see HtmlSemDoubleElement::run() 37 | */ 38 | public function run(JsUtils $js){ 39 | parent::run($js); 40 | return $js->semantic()->rating("#".$this->identifier,$this->_params); 41 | } 42 | 43 | public function asStar(){ 44 | return $this->setIcon(); 45 | } 46 | 47 | public function asHeart(){ 48 | return $this->setIcon("heart"); 49 | } 50 | 51 | public function setIcon($icon="star"){ 52 | return $this->addToPropertyCtrl("class", $icon, ["star","heart",""]); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /Ajax/common/html/traits/NavElementTrait.php: -------------------------------------------------------------------------------- 1 | html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true); 21 | } 22 | 23 | public function getRoot() { 24 | return $this->root; 25 | } 26 | public function setRoot($root) { 27 | $this->root = $root; 28 | return $this; 29 | } 30 | public function getAttr() { 31 | return $this->attr; 32 | } 33 | 34 | /** 35 | * Define the html attribute for each element url in ajax 36 | * @param string $attr html attribute 37 | * @return HtmlNavElement 38 | */ 39 | public function setAttr($attr) { 40 | $this->attr = $attr; 41 | return $this; 42 | } 43 | 44 | public function __call($method, $args) { 45 | if(isset($this->$method) && is_callable($this->$method)) { 46 | return call_user_func_array( 47 | $this->$method, 48 | $args 49 | ); 50 | } 51 | } 52 | 53 | abstract public function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0); 54 | } 55 | -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/HtmlSticky.php: -------------------------------------------------------------------------------- 1 | setContext($context); 14 | } 15 | 16 | public function setContext($context){ 17 | $this->_params["context"]=$context; 18 | return $this; 19 | } 20 | 21 | public function setFixed($value=NULL){ 22 | $fixed="fixed"; 23 | if(isset($value)) 24 | $fixed.=" ".$value; 25 | return $this->addToProperty("class",$fixed); 26 | } 27 | 28 | public function setBound($value=NULL){ 29 | $bound="bound"; 30 | if(isset($value)) 31 | $bound.=" ".$value; 32 | return $this->addToProperty("class",$bound); 33 | } 34 | 35 | /** 36 | * {@inheritDoc} 37 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() 38 | */ 39 | public function run(JsUtils $js){ 40 | parent::run($js); 41 | return $js->semantic()->sticky("#".$this->identifier,$this->_params); 42 | } 43 | 44 | public function setOffset($offset=0){ 45 | $this->_params["offset"]=$offset; 46 | return $this; 47 | } 48 | 49 | 50 | 51 | public function setDebug($verbose=NULL){ 52 | $this->_params["debug"]=true; 53 | if(isset($verbose)) 54 | $this->_params["verbose"]=true; 55 | return $this; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Popup.php: -------------------------------------------------------------------------------- 1 | uiName="popup"; 12 | } 13 | 14 | /** 15 | * 16 | * @param string $value default : click 17 | * @return $this 18 | */ 19 | public function setOn($value="click") { 20 | return $this->setParam("on", $value); 21 | } 22 | 23 | /** 24 | * This event fires immediately when the show instance method is called. 25 | * @param string $jsCode 26 | * @return $this 27 | */ 28 | public function setOnShow($jsCode) { 29 | $jsCode=str_ireplace("\"","%quote%", $jsCode); 30 | return $this->setParam("onShow", "%function(){".$jsCode."}%"); 31 | } 32 | 33 | public function setExclusive($value){ 34 | return $this->setParam("exclusive", $value); 35 | } 36 | 37 | /** 38 | * Defines the css selector of the displayed popup 39 | * @param string $popup the css selector of the popup 40 | * @return \Ajax\semantic\components\Popup 41 | */ 42 | public function setPopup($popup){ 43 | return $this->setParam("popup", $popup); 44 | } 45 | 46 | public function setInline($value){ 47 | return $this->setParam("inline", $value); 48 | } 49 | 50 | public function setPosition($value){ 51 | return $this->setParam("position", $value); 52 | } 53 | 54 | public function setSetFluidWidth($value){ 55 | return $this->setParam("setFluidWidth", $value); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Ajax/service/JReflection.php: -------------------------------------------------------------------------------- 1 | getMethods(\ReflectionMethod::IS_PUBLIC); 15 | foreach ($methods as $method){ 16 | $name=$method->getName(); 17 | if(JString::startswith($name, "set")){ 18 | $property=\lcfirst(JString::replaceAtFirst($name, "set", "")); 19 | $value="__".$property."__"; 20 | try{ 21 | if($class->getProperty($property)!==null){ 22 | \call_user_func_array([$object,$name],[$value]); 23 | } 24 | }catch(\Exception $e){ 25 | //Nothing to do 26 | } 27 | } 28 | } 29 | return $object; 30 | } 31 | 32 | public static function callMethod($object,$callback,array $values){ 33 | return \call_user_func_array([$object,$callback],$values); 34 | } 35 | 36 | public static function getterName($propertyName,$prefix="get"){ 37 | return $prefix.\ucfirst($propertyName); 38 | } 39 | 40 | public static function callMethodFromAssociativeArray($object,$array,$methodPrefix="add"){ 41 | foreach ($array as $key=>$value){ 42 | if(\method_exists($object, $methodPrefix.\ucfirst($key))){ 43 | \call_user_func([$object,$methodPrefix.\ucfirst($key)],$value); 44 | } 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlInput.php: -------------------------------------------------------------------------------- 1 | setProperty("name", $identifier); 15 | $this->setValue($value); 16 | $this->setPlaceholder($placeholder); 17 | $this->setProperty("type", $type); 18 | } 19 | 20 | public function setValue($value) { 21 | if (isset($value)) 22 | $this->setProperty("value", $value); 23 | return $this; 24 | } 25 | 26 | public function setInputType($value) { 27 | return $this->setProperty("type", $value); 28 | } 29 | 30 | public function forceValue($value = 'true') { 31 | $this->wrap(''); 32 | $this->setValue($value); 33 | return $this; 34 | } 35 | 36 | public function setPlaceholder($value) { 37 | if (JString::isNotNull($value)) 38 | $this->_placeholder = $value; 39 | return $this; 40 | } 41 | 42 | public function compile(?JsUtils $js = NULL, mixed &$view = NULL) { 43 | $value = $this->_placeholder; 44 | if (JString::isNull($value)) { 45 | if (JString::isNotNull($this->getProperty("name"))) 46 | $value = \ucfirst($this->getProperty("name")); 47 | } 48 | $this->setProperty("placeholder", $value); 49 | return parent::compile($js, $view); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlPaginationMenu.php: -------------------------------------------------------------------------------- 1 | _pages=$items; 16 | } 17 | /** 18 | * {@inheritDoc} 19 | * @see \Ajax\common\html\BaseHtml::compile() 20 | */ 21 | public function compile(?JsUtils $js=NULL,mixed &$view=NULL){ 22 | $max=$this->_max; 23 | if(!$this->_compiled){ 24 | foreach ($this->content as $item){ 25 | $item->addClass("pageNum"); 26 | } 27 | $this->insertItem(new HtmlIcon("", "left chevron"))->setProperty("data-page", \max([1,$this->_page-1]))->addToProperty("class","_firstPage no-active"); 28 | $this->addItem(new HtmlIcon("", "right chevron"))->setProperty("data-page", \min([$max,$this->_page+1]))->setProperty("data-max", $max)->addToProperty("class","_lastPage no-active"); 29 | $this->asPagination(); 30 | } 31 | return parent::compile($js,$view); 32 | } 33 | 34 | public function setActivePage($page){ 35 | $index=$page-$this->_pages[0]; 36 | $this->setActiveItem($index); 37 | $this->_page=$page; 38 | return $this; 39 | } 40 | 41 | public function getPage() { 42 | return $this->_page; 43 | } 44 | /** 45 | * @param mixed $_max 46 | */ 47 | public function setMax($_max) { 48 | $this->_max = $_max; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlAccordionItem.php: -------------------------------------------------------------------------------- 1 | _template="%titleElement%".$this->_template; 20 | $this->_title=$title; 21 | } 22 | 23 | public function setTitle($title){ 24 | $this->_title=$title; 25 | } 26 | 27 | public function setIcon($icon){ 28 | $this->_icon=$icon; 29 | } 30 | 31 | protected function createTitleElement(){ 32 | $element=new HtmlSemDoubleElement("title-".$this->identifier,"div","title"); 33 | $element->setContent(array(new HtmlIcon("", $this->_icon),$this->_title)); 34 | if($this->_active===true) 35 | $element->addToProperty("class", "active"); 36 | return $element; 37 | } 38 | 39 | public function compile(?JsUtils $js=NULL, mixed &$view=NULL){ 40 | $this->titleElement=$this->createTitleElement(); 41 | return parent::compile($js,$view); 42 | } 43 | 44 | public function setActive($value=true){ 45 | $this->_active=$value; 46 | if($value===true) 47 | $this->addToPropertyCtrl("class", "active", array("active")); 48 | else 49 | $this->removePropertyValue("class", "active"); 50 | return $this; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlStepItem.php: -------------------------------------------------------------------------------- 1 | setIcon($icon); 21 | } 22 | if(isset($status)){ 23 | $this->setStatus($status); 24 | } 25 | if(isset($title)){ 26 | $this->setTitle($title,$desc); 27 | } 28 | }else{ 29 | $this->setContent($content); 30 | } 31 | } 32 | 33 | public function setActive($value=true){ 34 | if($value) 35 | $this->setStatus(StepStatus::ACTIVE); 36 | else 37 | $this->setStatus(StepStatus::NONE); 38 | return $this; 39 | } 40 | 41 | public function setCompleted(){ 42 | $this->removePropertyValues("class", [StepStatus::COMPLETED,StepStatus::DISABLED]); 43 | return $this->setStatus(StepStatus::COMPLETED); 44 | } 45 | 46 | public function setStatus($status){ 47 | return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants()); 48 | } 49 | 50 | public function removeStatus(){ 51 | $this->removePropertyValues("class", StepStatus::getConstants()); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlSegmentGroups.php: -------------------------------------------------------------------------------- 1 | addItems($items); 16 | } 17 | 18 | 19 | protected function createItem($value){ 20 | return new HtmlSegment("segment-".$this->count(),$value); 21 | } 22 | 23 | protected function createCondition($value){ 24 | return !($value instanceof HtmlSegment); 25 | } 26 | 27 | /** 28 | * Defines the group type 29 | * @param string $type one of "raised","stacked","piled" default : "" 30 | * @return \Ajax\semantic\html\elements\HtmlSegmentGroups 31 | */ 32 | public function setType($type){ 33 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); 34 | } 35 | 36 | public function setSens($sens=Sens::VERTICAL){ 37 | return $this->addToPropertyCtrl("class", $sens, Sens::getConstants()); 38 | } 39 | 40 | public function run(JsUtils $js){ 41 | $result= parent::run($js); 42 | return $result->setItemSelector(".ui.segment"); 43 | } 44 | 45 | public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){ 46 | $group=new HtmlSegmentGroups($identifier,$items); 47 | $group->setSens($sens); 48 | return $group->setType($type); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlSplitbutton.php: -------------------------------------------------------------------------------- 1 | asButton($cssStyle); 19 | $this->_template=include 'templates/tplSplitbutton.php'; 20 | $this->mClass="btn-group"; 21 | } 22 | 23 | /** 24 | * (non-PHPdoc) 25 | * @see \Ajax\bootstrap\html\HtmlDropdown::setSize() 26 | * @return HtmlSplitbutton 27 | */ 28 | public function setSize($size) { 29 | if (is_int($size)) { 30 | return $this->addToMember($this->mClass, CssRef::sizes("btn-group")[$size]); 31 | } 32 | return $this->addToMemberCtrl($this->mClass, $size, CssRef::sizes("btn-group")); 33 | } 34 | 35 | public function onButtonClick($jsCode) { 36 | $this->addEvent("buttonClick", $jsCode); 37 | } 38 | 39 | /* 40 | * (non-PHPdoc) 41 | * @see BaseHtml::run() 42 | */ 43 | public function run(JsUtils $js) { 44 | if ($this->getProperty("role")==="nav") { 45 | foreach ( $this->items as $dropdownItem ) { 46 | $dropdownItem->runNav($js); 47 | } 48 | } 49 | $this->_bsComponent=$js->bootstrap()->splitbutton("#".$this->identifier); 50 | $this->addEventsOnRun($js); 51 | return $this->_bsComponent; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/table/ActiveRow.php: -------------------------------------------------------------------------------- 1 | table=$table; 26 | $this->class=$class; 27 | $this->event=$event; 28 | $this->multiple=$multiple; 29 | } 30 | 31 | public function getClass() { 32 | return $this->class; 33 | } 34 | 35 | public function setClass($class) { 36 | $this->class=$class; 37 | return $this; 38 | } 39 | 40 | public function getEvent() { 41 | return $this->event; 42 | } 43 | 44 | public function setEvent($event) { 45 | $this->event=$event; 46 | return $this; 47 | } 48 | 49 | public function getMultiple() { 50 | return $this->multiple; 51 | } 52 | 53 | public function setMultiple($multiple) { 54 | $this->multiple=$multiple; 55 | return $this; 56 | } 57 | 58 | public function run(){ 59 | $multiple=""; 60 | if(!$this->multiple){ 61 | $multiple="$(this).closest('tbody').children('tr').removeClass('".$this->class."');"; 62 | } 63 | $this->table->onRow($this->event, $multiple."$(this).toggleClass('".$this->class."');".$this->table->jsTrigger("activeRowChange","[this]"),false,false); 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/HtmlToast.php: -------------------------------------------------------------------------------- 1 | 12 | * @version 1.0.0 13 | * @since 2.3.0 14 | * @see https://fomantic-ui.com/modules/toast.html 15 | */ 16 | class HtmlToast extends HtmlSemDoubleElement { 17 | 18 | protected $_paramParts=array(); 19 | 20 | public function __construct($identifier, $content='') { 21 | parent::__construct($identifier, 'div','ui toast'); 22 | if(isset($content)){ 23 | $this->setContent($content); 24 | } 25 | } 26 | 27 | public function setContent($value) { 28 | $this->content['content']=new HtmlSemDoubleElement('content-' . $this->identifier, 'div', 'content', $value); 29 | return $this; 30 | } 31 | 32 | /** 33 | * 34 | * {@inheritDoc} 35 | * 36 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() 37 | */ 38 | public function compile(?JsUtils $js=NULL,mixed &$view=NULL) { 39 | $this->content=JArray::sortAssociative($this->content, ['content','actions' ]); 40 | return parent::compile($js, $view); 41 | } 42 | 43 | /* 44 | * (non-PHPdoc) 45 | * @see BaseHtml::run() 46 | */ 47 | public function run(JsUtils $js) { 48 | if(isset($this->_bsComponent)===false){ 49 | $this->_bsComponent=$js->semantic()->toast('#'.$this->identifier,$this->_params,$this->_paramParts); 50 | } 51 | $this->addEventsOnRun($js); 52 | return $this->_bsComponent; 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/Pointers.php: -------------------------------------------------------------------------------- 1 | results=new SearchResults($results); 12 | $this->id=$id; 13 | $this->name=$name; 14 | } 15 | 16 | public function addResult($object) { 17 | $this->results->addResult($object); 18 | return $this; 19 | } 20 | 21 | public function addResults($objects) { 22 | $this->results->addResults($objects); 23 | return $this; 24 | } 25 | 26 | public function __toString() { 27 | $result="\"" . $this->id . "\": { \"name\": \"" . $this->name . "\"," . $this->results . "}"; 28 | return $result; 29 | } 30 | 31 | public function getId() { 32 | return $this->id; 33 | } 34 | 35 | public function setId($id) { 36 | $this->id=$id; 37 | return $this; 38 | } 39 | 40 | public function getName() { 41 | return $this->name; 42 | } 43 | 44 | public function setName($name) { 45 | $this->name=$name; 46 | return $this; 47 | } 48 | 49 | public function getResults() { 50 | return $this->results; 51 | } 52 | 53 | public function setResults($results) { 54 | $this->results=$results; 55 | return $this; 56 | } 57 | 58 | public function search($query, $field="title") { 59 | $result=$this->results->_search($query, $field); 60 | if ($result !== false) { 61 | return new SearchCategory($this->id, $this->name, $result); 62 | } 63 | return false; 64 | } 65 | 66 | public function getResponse() { 67 | return $this->__toString(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlGridCol.php: -------------------------------------------------------------------------------- 1 | setClass("column"); 22 | if (isset($width)) 23 | $this->setWidth($width); 24 | } 25 | 26 | /** 27 | * Defines the col width 28 | * @param int $width 29 | * @return \Ajax\semantic\html\content\HtmlGridCol 30 | */ 31 | public function setWidth($width) { 32 | if (\is_int($width)) { 33 | $width=Wide::getConstants()["W" . $width]; 34 | } 35 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); 36 | return $this->addToPropertyCtrl("class", "wide", array ("wide" )); 37 | } 38 | 39 | public function setValue($value) { 40 | $this->content=$value; 41 | return $this; 42 | } 43 | 44 | public function setValues($value) { 45 | return $this->setValue($value); 46 | } 47 | 48 | public function addDivider($vertical=true, $content=NULL) { 49 | $divider=new HtmlDivider("", $content); 50 | if ($vertical) 51 | $divider->setVertical(); 52 | else 53 | $divider->setHorizontal(); 54 | $this->wrap($divider,""); 55 | return $divider; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Ajax/common/html/HtmlSingleElement.php: -------------------------------------------------------------------------------- 1 | tagName=$tagName; 12 | $this->_template='<%tagName% id="%identifier%" %properties%/>'; 13 | } 14 | 15 | public function setClass($classNames) { 16 | if(\is_array($classNames)){ 17 | $classNames=implode(" ", $classNames); 18 | } 19 | $this->setProperty("class", $classNames); 20 | return $this; 21 | } 22 | 23 | public function addClass($classNames) { 24 | if(\is_array($classNames)){ 25 | $classNames=implode(" ", $classNames); 26 | } 27 | $this->addToProperty("class", $classNames); 28 | return $this; 29 | } 30 | 31 | public function setRole($value) { 32 | $this->setProperty("role", $value); 33 | return $this; 34 | } 35 | 36 | public function setTitle($value) { 37 | $this->setProperty("title", $value); 38 | return $this; 39 | } 40 | 41 | public function setStyle($value){ 42 | $this->setProperty("style", $value); 43 | return $this; 44 | } 45 | 46 | /** 47 | * {@inheritDoc} 48 | * @see \Ajax\common\html\BaseHtml::run() 49 | */ 50 | public function run(JsUtils $js) { 51 | 52 | } 53 | 54 | /* 55 | * (non-PHPdoc) 56 | * @see \Ajax\bootstrap\html\BaseHtml::fromArray() 57 | */ 58 | public function fromArray($array) { 59 | $array=parent::fromArray($array); 60 | foreach ( $array as $key => $value ) { 61 | $this->setProperty($key, $value); 62 | } 63 | return $array; 64 | } 65 | 66 | public function setSize($size) { 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Dropdown.php: -------------------------------------------------------------------------------- 1 | uiName="dropdown"; 18 | } 19 | 20 | public function attach($identifier) { 21 | parent::attach($identifier); 22 | } 23 | 24 | /** 25 | * This event fires immediately when the show instance method is called. 26 | * @param string $jsCode 27 | * @return $this 28 | */ 29 | public function onShow($jsCode) { 30 | return $this->addEvent("show.bs.dropdown", $jsCode); 31 | } 32 | 33 | /** 34 | * This event is fired when a dropdown element has been made visible to the user (will wait for CSS transitions to complete). 35 | * @param string $jsCode 36 | * @return $this 37 | */ 38 | public function onShown($jsCode) { 39 | return $this->addEvent("shown.bs.dropdown", $jsCode); 40 | } 41 | 42 | /** 43 | * This event is fired immediately when the hide method has been called. 44 | * @param string $jsCode 45 | * @return $this 46 | */ 47 | public function onHide($jsCode) { 48 | return $this->addEvent("hide.bs.dropdown", $jsCode); 49 | } 50 | 51 | /** 52 | * This event is fired when a dropdown element has been hidden from the user (will wait for CSS transitions to complete). 53 | * @param string $jsCode 54 | * @return $this 55 | */ 56 | public function onHidden($jsCode) { 57 | return $this->addEvent("hidden.bs.dropdown", $jsCode); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Ajax/semantic/components/SimpleSemExtComponent.php: -------------------------------------------------------------------------------- 1 | paramParts=array(); 13 | } 14 | 15 | protected function addBehavior($name) { 16 | $this->paramParts[]=[$name]; 17 | return $this; 18 | } 19 | 20 | protected function generateParamParts(){ 21 | $results=[]; 22 | foreach ($this->paramParts as $paramPart){ 23 | $results[]="{$this->uiName}(".\implode(",", $paramPart).")"; 24 | } 25 | return \implode(".", $results); 26 | } 27 | 28 | public function getScript() { 29 | $allParams=$this->params; 30 | $this->jquery_code_for_compile=array (); 31 | $this->compileJsCodes(); 32 | $paramParts=""; 33 | if(\sizeof($this->paramParts)>0){ 34 | $paramParts=".".$this->generateParamParts(); 35 | } 36 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).")".$paramParts.";"; 37 | $this->compileEvents(); 38 | return $this->compileJQueryCode(); 39 | } 40 | 41 | public function setParamParts($paramParts) { 42 | $this->paramParts=$paramParts; 43 | return $this; 44 | } 45 | 46 | public function addComponentEvent($event,$jsCode){ 47 | $jsCode=\str_ireplace("\"","%quote%", $jsCode); 48 | return $this->setParam($event, "%function(module){".$jsCode."}%"); 49 | } 50 | 51 | public function setJs(JsUtils $js){ 52 | $this->js=$js; 53 | $js->semantic()->addComponent($this, $this->attachTo, $this->params); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlDivider.php: -------------------------------------------------------------------------------- 1 | content=$content; 19 | } 20 | 21 | /** 22 | * vertical divider 23 | * @return HtmlDivider 24 | */ 25 | public function setVertical() { 26 | return $this->addToPropertyCtrl("class", "vertical", array ("vertical","horizontal" )); 27 | } 28 | 29 | /** 30 | * horizontal divider 31 | * @return HtmlDivider 32 | */ 33 | public function setHorizontal() { 34 | return $this->addToPropertyCtrl("class", "horizontal", array ("vertical","horizontal" )); 35 | } 36 | 37 | /** 38 | * hide the divider 39 | * @return HtmlDivider 40 | */ 41 | public function setHidden() { 42 | return $this->addToProperty("class", "hidden"); 43 | } 44 | 45 | /** 46 | * fitted, without any space above or below it 47 | * @return HtmlDivider 48 | */ 49 | public function setFitted() { 50 | return $this->addToProperty("class", "fitted"); 51 | } 52 | 53 | /** 54 | * 55 | * @return HtmlDivider 56 | */ 57 | public function asHeader() { 58 | return $this->addToProperty("class", "header"); 59 | } 60 | 61 | /** 62 | * @return HtmlDivider 63 | */ 64 | public function setIgnored(){ 65 | return $this->addToProperty("class", "ignored"); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlGlyphicon.php: -------------------------------------------------------------------------------- 1 | _template=''; 20 | } 21 | 22 | /** 23 | * Defines the glyphicon with his name or his index 24 | * @param string|int $glyphicon 25 | * @return \Ajax\bootstrap\html\HtmlGlyphicon 26 | */ 27 | public function setGlyphicon($glyphicon) { 28 | if (is_int($glyphicon)) { 29 | $glyphs=CssGlyphicon::getConstants(); 30 | if ($glyphiconglyphicon=$glyphicon; 40 | } 41 | 42 | /** 43 | * return an instance of GlyphButton with a glyph defined by string or index 44 | * @param string|int $glyph 45 | * @return \Ajax\bootstrap\html\HtmlGlyphicon 46 | */ 47 | public static function getGlyphicon($glyph) { 48 | $result=new HtmlGlyphicon(""); 49 | if (is_int($glyph)) { 50 | $glyphs=CssGlyphicon::getConstants(); 51 | if ($glyphsetGlyphicon($glyph); 56 | return $result; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlInput.php: -------------------------------------------------------------------------------- 1 | setProperty("name", $identifier); 18 | $this->setProperty("class", "form-control"); 19 | $this->setProperty("role", "input"); 20 | $this->setProperty("value", ""); 21 | $this->setProperty("type", "text"); 22 | } 23 | 24 | public function setValue($value) { 25 | $this->setProperty("value", $value); 26 | } 27 | 28 | public function setInputType($value) { 29 | $this->setProperty("type", $value); 30 | } 31 | 32 | public function setLabel($label, $before=true) { 33 | if ($before===true) { 34 | $this->wrap("", ""); 35 | } else { 36 | $this->wrap("", ""); 37 | } 38 | } 39 | 40 | public function setPlaceHolder($value){ 41 | $this->setProperty("placeholder", $value); 42 | } 43 | 44 | /* 45 | * (non-PHPdoc) 46 | * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run() 47 | */ 48 | public function run(JsUtils $js) { 49 | $this->_bsComponent=$js->bootstrap()->generic("#".$this->identifier); 50 | $this->addEventsOnRun($js); 51 | return $this->_bsComponent; 52 | } 53 | 54 | public function onChange($jsCode) { 55 | return $this->addEvent("change", $jsCode); 56 | } 57 | 58 | public function onKeypress($jsCode) { 59 | return $this->addEvent("keypress", $jsCode); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Ajax/semantic/components/search/SearchCategories.php: -------------------------------------------------------------------------------- 1 | categories=array (); 10 | } 11 | 12 | public function add($results, $category) { 13 | $count=\sizeof($this->categories); 14 | if (\array_key_exists($category, $this->categories)) { 15 | $this->categories[$category]->addResults($results); 16 | } else { 17 | $categoryO=new SearchCategory("category" . $count, $category, $results); 18 | $this->categories[$category]=$categoryO; 19 | } 20 | return $this; 21 | } 22 | 23 | public function search($query, $field="title") { 24 | $result=array (); 25 | foreach ( $this->categories as $category ) { 26 | $r=$category->search($query, $field); 27 | if ($r !== false) 28 | $result[]=$r; 29 | } 30 | $this->categories=$result; 31 | return $this; 32 | } 33 | 34 | public function __toString() { 35 | return "{\"results\":{" . \implode(",", \array_values($this->categories)) . "}}"; 36 | } 37 | 38 | public function getResponse() { 39 | return $this->__toString(); 40 | } 41 | 42 | /** 43 | * Loads results and categories from a collection of DB objects 44 | * @param array $objects the collection of objects 45 | * @param callable $function return an instance of SearchCategory 46 | */ 47 | public function fromDatabaseObjects($objects, $function) { 48 | parent::fromDatabaseObjects($objects, $function); 49 | } 50 | 51 | protected function fromDatabaseObject($object, $function) { 52 | $result=$function($object); 53 | if ($result instanceof SearchCategory) { 54 | $this->categories[]=$result; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Slider.php: -------------------------------------------------------------------------------- 1 | 12 | * @version 1.0.0 13 | * @since 2.3.0 14 | * @see https://fomantic-ui.com/modules/slider.html 15 | */ 16 | class Slider extends SimpleSemExtComponent { 17 | 18 | public function __construct(?JsUtils $js=NULL) { 19 | parent::__construct($js); 20 | $this->uiName='slider'; 21 | } 22 | 23 | public function close(){ 24 | return $this->addBehavior('close'); 25 | } 26 | 27 | public function setInterpretLabel($labels){ 28 | $var="window.document._slider_labels['".JString::cleanIdentifier($this->attachTo)."']"; 29 | $this->addCode('window.document._slider_labels=window.document._slider_labels||[];'.$var.'='.\json_encode($labels).';'); 30 | $this->params['interpretLabel']='%function(value) {return '.$var.'[value];}%'; 31 | } 32 | 33 | public function setMin($min){ 34 | $this->params['min']=$min; 35 | } 36 | 37 | public function setMax($max){ 38 | $this->params['max']=$max; 39 | } 40 | 41 | public function setStart($start){ 42 | $this->params['start']=$start; 43 | } 44 | 45 | public function setEnd($end){ 46 | $this->params['end']=$end; 47 | } 48 | 49 | public function setStep($step){ 50 | $this->params['step']=$step; 51 | } 52 | 53 | public function setSmooth($smooth) { 54 | $this->params['smooth']=$smooth; 55 | } 56 | 57 | public function setOnChange($jsCode) { 58 | $this->addComponentEvent('onChange', $jsCode); 59 | } 60 | 61 | public function setOnMove($jsCode) { 62 | $this->addComponentEvent('onMove', $jsCode); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlListItem.php: -------------------------------------------------------------------------------- 1 | setIcon($icon); 31 | } 32 | if (isset($image)) { 33 | $this->setImage($image); 34 | } 35 | if (isset($title)) { 36 | $this->setTitle($title, $desc); 37 | } elseif (isset($header)) { 38 | $this->setTitle($header, $desc, "header"); 39 | } 40 | if (isset($items)) { 41 | $this->addList($items); 42 | } 43 | } else { 44 | $this->setContent($content); 45 | } 46 | } 47 | 48 | public function addList($items = array(), $ordered = false) { 49 | $list = new HtmlList("", $items); 50 | if ($ordered) 51 | $list->setOrdered(); 52 | $list->setClass("list"); 53 | $this->content["list"] = $list; 54 | return $list; 55 | } 56 | 57 | public function getList() { 58 | return $this->content["list"]; 59 | } 60 | 61 | public function getItem($index) { 62 | return $this->getList()->getItem($index); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlIconGroups.php: -------------------------------------------------------------------------------- 1 | addItems($icons); 21 | $this->setSize($size); 22 | } 23 | 24 | /** 25 | * @return HtmlIcon 26 | */ 27 | public function getItem($index){ 28 | return parent::getItem($index); 29 | } 30 | 31 | protected function createItem($value) { 32 | $icon=$value; 33 | if (\is_array($value)) { 34 | $icon=JArray::getValue($value, "icon", 0); 35 | $size=JArray::getValue($value, "size", 1); 36 | } 37 | $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); 38 | if (isset($size)) { 39 | $iconO->setSize($size); 40 | } 41 | return $iconO; 42 | } 43 | 44 | protected function createCondition($value) { 45 | return ($value instanceof HtmlIcon) === false; 46 | } 47 | 48 | public function getIcon($index) { 49 | return $this->content[$index]; 50 | } 51 | 52 | public function run(JsUtils $js){ 53 | $result= parent::run($js); 54 | return $result->setItemSelector("i"); 55 | } 56 | 57 | public function toCorner($index=1) { 58 | $this->getItem($index)->toCorner(); 59 | return $this; 60 | } 61 | 62 | public static function corner($mainIcon,$cornerIcon,$size="huge"){ 63 | $icons=new HtmlIconGroups("icons",[$mainIcon,$cornerIcon],$size); 64 | return $icons->toCorner(1); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Ajax/semantic/components/Dropdown.php: -------------------------------------------------------------------------------- 1 | uiName = "dropdown"; 11 | } 12 | 13 | /** 14 | * Sets a default action to occur 15 | * 16 | * @param string $action 17 | * one of "select","auto","activate","combo","nothing","hide" 18 | * @return \Ajax\semantic\components\Dropdown 19 | */ 20 | public function setAction($action) { 21 | return $this->setParamCtrl("action", $action, array( 22 | "select", 23 | "auto", 24 | "activate", 25 | "combo", 26 | "nothing", 27 | "hide" 28 | )); 29 | } 30 | 31 | /** 32 | * Define the event which trigger dropdown 33 | * 34 | * @param string $event 35 | * Event used to trigger dropdown (Hover, Click, Custom Event) 36 | * @return \Ajax\semantic\components\Dropdown 37 | */ 38 | public function setOn($event) { 39 | return $this->setParam("on", $event); 40 | } 41 | 42 | public function setFullTextSearch($value) { 43 | return $this->setParam("fullTextSearch", $value); 44 | } 45 | 46 | public function setShowOnFocus($value) { 47 | return $this->setParam("showOnFocus", $value); 48 | } 49 | 50 | public function setAllowAdditions($value) { 51 | return $this->setParam("allowAdditions", $value); 52 | } 53 | 54 | public function setClearable($value) { 55 | return $this->setParam("clearable", $value); 56 | } 57 | 58 | public function setOnAdd($value) { 59 | $this->params["onAdd"] = "%function(addedValue, addedText, \$addedChoice){" . $value . "}%"; 60 | } 61 | 62 | public function setOnRemove($value) { 63 | $this->params["onRemove"] = "%function(removedValue, removedText, \$removedChoice){" . $value . "}%"; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Ajax/ui/components/DialogButton.php: -------------------------------------------------------------------------------- 1 | params["text"] = $caption; 25 | $this->params[$event] = $this->addFunction($jsCode); 26 | } 27 | 28 | public function __toString() { 29 | return $this->getScript(); 30 | } 31 | 32 | /* 33 | * (non-PHPdoc) 34 | * @see \Ajax\common\BaseComponent::getScript() 35 | */ 36 | public function getScript() { 37 | return json_encode($this->params, JSON_UNESCAPED_SLASHES); 38 | } 39 | 40 | public static function cancelButton($caption = "Annuler") { 41 | return new DialogButton($caption, "$( this ).dialog( 'close' );"); 42 | } 43 | 44 | /** 45 | * 46 | * @param JsUtils $js 47 | * @param string $url 48 | * @param string $form 49 | * @param string $responseElement 50 | * @param string $caption 51 | * @param array $parameters 52 | * default : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null) 53 | * @return DialogButton 54 | */ 55 | public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption = "Okay", $parameters = []) { 56 | return new DialogButton($caption, $js->postFormDeferred($url, $form, $responseElement, $parameters) . ";$( this ).dialog( 'close' );"); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlListgroup.php: -------------------------------------------------------------------------------- 1 | content=array (); 19 | $this->_template='<%tagName% %properties%>%content%'; 20 | $this->setProperty("class", "list-group"); 21 | } 22 | 23 | public function addItem($text="") { 24 | if (is_object($text)) { 25 | $element=$text; 26 | } else { 27 | switch($this->tagName) { 28 | case "ul": 29 | $element=new HtmlBsDoubleElement("list-gi-".$this->identifier); 30 | $element->setTagName("li"); 31 | break; 32 | default: 33 | $element=new HtmlLink("list-gi-".$this->identifier); 34 | break; 35 | } 36 | $element->setContent($text); 37 | } 38 | 39 | $item=new HtmlListgroupItem($element); 40 | if (\is_array($text)) { 41 | $item->setHeadingAndContent($text); 42 | } 43 | $this->content []=$item; 44 | return $item; 45 | } 46 | 47 | public function addItems($items) { 48 | foreach ( $items as $item ) { 49 | if (is_string($item)) { 50 | $this->addItem($item); 51 | } else 52 | $this->content []=$item; 53 | } 54 | } 55 | 56 | public function getItem($index) { 57 | if ($indexcontent)) 58 | return $this->content [$index]; 59 | } 60 | 61 | /* (non-PHPdoc) 62 | * @see \Ajax\bootstrap\html\base\BaseHtml::fromDatabaseObject() 63 | */ 64 | public function fromDatabaseObject($object, $function) { 65 | $this->addItem($function($object)); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /documentation/html/extra-styles.css: -------------------------------------------------------------------------------- 1 | @CHARSET "UTF-8"; 2 | @import url('https://fonts.googleapis.com/css?family=Baloo+Bhaina|Fredoka+One'); 3 | 4 | body, table, div, p, dl { 5 | font: 400 13px/21px Roboto,sans-serif; 6 | } 7 | 8 | #projectname 9 | { 10 | font: 300% 'Baloo Bhaina', cursive !important; 11 | } 12 | 13 | #projectbrief 14 | { 15 | color: #C8EFD2; 16 | font-size: 12px; 17 | margin: 0px; 18 | padding: 0px; 19 | margin-top: -30px; 20 | } 21 | 22 | #projectnumber 23 | { 24 | color: rgb(255,255,255); 25 | text-shadow: rgba(0, 0, 0, 0.0980392) 0px 1px 0px; 26 | font-size: 20px; 27 | font-weight: 400; 28 | font-style: italic; 29 | margin: 0px; 30 | padding: 0px; 31 | } 32 | 33 | #version{ 34 | color: rgb(71, 69, 70); 35 | font-size: 16px; 36 | font-weight: 600; 37 | margin: 0px; 38 | padding: 0px 10px 0px; 39 | } 40 | 41 | #titlearea 42 | { 43 | color: rgb(71, 69, 70); 44 | position: relative; 45 | text-align: left; 46 | text-shadow: rgba(0, 0, 0, 0.0980392) 0px 1px 0px; 47 | perspective-origin: 950.5px 128px; 48 | transform-origin: 950.5px 128px; 49 | background: rgb(48,118,112) linear-gradient( rgb(132,211,178) 0px, rgb(48,118,112) 100%) repeat-x scroll 0% 0% / auto padding-box border-box; 50 | padding: 0px 0px 10px; 51 | margin: 0px; 52 | width: 100%; 53 | border-bottom: 1px solid #395D54; 54 | } 55 | .memtitle{ 56 | font-weight: 600 !important; 57 | font-size: 120% !important; 58 | background-color: #F1E2D3 !important; 59 | background-image: none !important; 60 | color: #935B38 !important; 61 | } 62 | .memdoc p{ 63 | color: #357B74; 64 | font-weight: 500 !important; 65 | } 66 | #MSearchField{ 67 | background: none; 68 | font: 9pt Roboto,sans-serif; 69 | border: inherit; 70 | } 71 | #MSearchBox .left{ 72 | background: none; 73 | } 74 | 75 | #MSearchBox .right{ 76 | background: none; 77 | } 78 | 79 | .SelectItem{ 80 | font: 8pt Roboto,sans-serif; 81 | } -------------------------------------------------------------------------------- /Ajax/semantic/widgets/business/BusinessForm.php: -------------------------------------------------------------------------------- 1 | getDefaultModelInstance(); 22 | } 23 | parent::__construct($identifier,$modelInstance); 24 | $this->_initForm($fieldsOrder, $fieldsDefinition,$fields,$captions,$separators); 25 | } 26 | 27 | abstract protected function getDefaultModelInstance(); 28 | 29 | protected function _initForm($fieldsOrder,$fieldsDefinition,$fields=[],$captions=[],$separators=[]){ 30 | $this->_fieldsOrder=$fieldsOrder; 31 | $this->setFields($fields); 32 | $this->setSeparators($separators); 33 | $this->fieldsAs($fieldsDefinition); 34 | $this->setCaptions($captions); 35 | } 36 | 37 | protected function _getIndex($fieldName){ 38 | $index=$fieldName; 39 | if(\is_string($fieldName)){ 40 | $index=\array_search($fieldName, $this->_fieldsOrder); 41 | } 42 | return $index; 43 | } 44 | protected function _fieldAs($elementCallback,&$index,$attributes=NULL,$prefix=null){ 45 | $index=$this->_getIndex($index); 46 | return parent::_fieldAs($elementCallback, $index,$attributes,$prefix); 47 | } 48 | 49 | 50 | public function removeField($fieldName){ 51 | parent::removeField($fieldName); 52 | \array_splice($this->_fieldsOrder,$this->_getIndex($fieldName),1); 53 | return $this; 54 | } 55 | 56 | public function compile(?JsUtils $js=NULL,mixed &$view=NULL){ 57 | return parent::compile($js,$view); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlEmoji.php: -------------------------------------------------------------------------------- 1 | 13 | * @version 1.0.0 14 | * 15 | */ 16 | class HtmlEmoji extends HtmlSemDoubleElement { 17 | protected $_emoji; 18 | 19 | public function __construct($identifier, $emoji) { 20 | parent::__construct($identifier, "em", "", NULL); 21 | $this->setEmoji($emoji); 22 | } 23 | 24 | public function getEmoji() { 25 | return $this->_emoji; 26 | } 27 | 28 | /** 29 | * sets the emoji 30 | * @param string $emoji 31 | * @return HtmlEmoji 32 | */ 33 | public function setEmoji($emoji) { 34 | $emoji=":{$emoji}:"; 35 | if (isset($this->_emoji)) { 36 | $this->removePropertyValue("data-emoji", $this->_emoji); 37 | } 38 | $this->_emoji=$emoji; 39 | $this->addToProperty("data-emoji", $emoji); 40 | return $this; 41 | } 42 | 43 | /** 44 | * Emoji used as a simple loader 45 | * @return HtmlEmoji 46 | */ 47 | public function asLoader() { 48 | return $this->addToProperty("class", "loading"); 49 | } 50 | 51 | /** 52 | * icon formatted as a link 53 | * @param string $href 54 | * @param string $target 55 | * @return HtmlEmoji 56 | */ 57 | public function asLink($href=NULL,$target=NULL) { 58 | if (isset($href)) { 59 | $_target=""; 60 | if(isset($target)) 61 | $_target="target='{$target}'"; 62 | $this->wrap("", ""); 63 | } 64 | return $this->addToProperty("class", "link"); 65 | } 66 | 67 | public function addLabel($label, $before=false, $emoji=null) { 68 | if($before) 69 | $this->wrap($label); 70 | else 71 | $this->wrap("", $label); 72 | if($emoji!=null) 73 | $this->setEmoji($emoji); 74 | return $this; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Ajax/php/cakephp/_JsUtils.php: -------------------------------------------------------------------------------- 1 | viewVars; 17 | if (isset($viewVars["q"]) === false) { 18 | $controls=array (); 19 | }else{ 20 | $controls=$viewVars["q"]; 21 | } 22 | $controls[$identifier]=$content; 23 | $view->set("q", $controls); 24 | } 25 | 26 | public function createScriptVariable(&$view,$view_var, $output){ 27 | $view->set($view_var,$output); 28 | } 29 | 30 | /** 31 | * @param App\Controller\AppController $initialControllerInstance 32 | * @param string $controllerName 33 | * @param string $actionName 34 | * @param array $params 35 | * @see \Ajax\JsUtils::forward() 36 | */ 37 | public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ 38 | \ob_start(); 39 | if(isset($params) && !\is_array($params)){ 40 | $params=[$params]; 41 | } 42 | $url=h(Router::url(\array_merge([ 43 | 'controller' => $controllerName, 44 | 'action' => $actionName],$params),false 45 | )); 46 | $base=Router::url("/"); 47 | if (substr($url, 0, strlen($base)) == $base) { 48 | $url = substr($url, strlen($base)); 49 | } 50 | $initialControllerInstance->requestAction($url); 51 | $result=\ob_get_contents(); 52 | \ob_end_clean(); 53 | return $result; 54 | } 55 | 56 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { 57 | $view = new View(Router::getRequest(true), new Response()); 58 | if(\is_array($params)){ 59 | foreach ($params as $k=>$v){ 60 | $view->set($k, $v); 61 | } 62 | } 63 | return $view->render($viewName); 64 | } 65 | 66 | public function fromDispatcher($dispatcher){ 67 | return \explode("/", Router::getRequest(true)->url); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Ajax/semantic/components/validation/languages/fr.js: -------------------------------------------------------------------------------- 1 | $.fn.form.settings.prompt= { 2 | empty : '{name} doit avoir une valeur', 3 | checked : '{name} doit être coché', 4 | email : '{name} doit être une adresse e-mail valide', 5 | url : '{name} doit être une url valide', 6 | regExp : '{name} n\'est pas correctement formaté', 7 | integer : '{name} doit être un entier', 8 | decimal : '{name} doit être un nombre décimal', 9 | number : '{name} doit être un nombre', 10 | is : '{name} doit être égal à \'{ruleValue}\'', 11 | isExactly : '{name} doit être exactement \'{ruleValue}\'', 12 | not : '{name} ne doit pas être égal à \'{ruleValue}\'', 13 | notExactly : '{name} ne doit pas être exactement égal à \'{ruleValue}\'', 14 | contain : '{name} doit contenir \'{ruleValue}\'', 15 | containExactly : '{name} doit contenir exactement \'{ruleValue}\'', 16 | doesntContain : '{name} doit contenir \'{ruleValue}\'', 17 | doesntContainExactly : '{name} ne doit pas contenir exactement \'{ruleValue}\'', 18 | minLength : '{name} doit avoir au moins {ruleValue} caractères', 19 | length : '{name} doit contenir {ruleValue} caractères', 20 | exactLength : '{name} doit avoir une taille de {ruleValue} caractères', 21 | maxLength : '{name} ne doit pas avoir une longueur supérieure à {ruleValue} caractères', 22 | match : '{name} doit être égal au champ {ruleValue}', 23 | different : '{name} doit avoir une valeur différente du champ {ruleValue}', 24 | creditCard : '{name} doit être un numérode carte de crédit valide', 25 | minCount : '{name} doit comporter au moins {ruleValue} choix', 26 | exactCount : '{name} doit comporter exactement {ruleValue} choix', 27 | maxCount : '{name} doit comporter {ruleValue} choix au maximum' 28 | }; -------------------------------------------------------------------------------- /Ajax/semantic/components/Form.php: -------------------------------------------------------------------------------- 1 | uiName="form"; 20 | $this->params["fields"]=[]; 21 | } 22 | 23 | public function addField($identifier){ 24 | $this->params["fields"][$identifier]=new FieldValidation($identifier); 25 | } 26 | 27 | public function setInline($value){ 28 | return $this->setParam("inline", true); 29 | } 30 | 31 | public function setOn($value){ 32 | return $this->setParam("on", $value); 33 | } 34 | 35 | 36 | 37 | /** 38 | * @param string $identifier 39 | * @param Rule|string $type 40 | * @param mixed $value 41 | * @param string|NULL $prompt 42 | */ 43 | public function addFieldRule($identifier,$type,$prompt=NULL,$value=NULL){ 44 | if(isset($this->params["fields"][$identifier])===false){ 45 | $this->addField($identifier); 46 | } 47 | $this->params["fields"][$identifier]->addRule($type,$prompt,$value); 48 | } 49 | 50 | /** 51 | * @param FieldValidation $fieldValidation 52 | */ 53 | public function addFieldValidation($fieldValidation){ 54 | $this->params["fields"][$fieldValidation->getIdentifier()]=$fieldValidation; 55 | } 56 | 57 | public function setJs(JsUtils $js){ 58 | $this->js=$js; 59 | } 60 | 61 | public function getScript() { 62 | $allParams=$this->params; 63 | $this->jquery_code_for_compile=array (); 64 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).");"; 65 | $this->compileEvents(); 66 | return $this->compileJQueryCode(); 67 | } 68 | 69 | public function onValid($jsCode){ 70 | $this->addComponentEvent("onValid", $jsCode); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Ajax/semantic/components/search/SearchResult.php: -------------------------------------------------------------------------------- 1 | fromArray($id); 15 | } else { 16 | $this->id=$id; 17 | $this->title=$title; 18 | $this->description=$description; 19 | $this->image=$image; 20 | $this->price=$price; 21 | } 22 | } 23 | 24 | public function getId() { 25 | return $this->id; 26 | } 27 | 28 | public function setId($id) { 29 | $this->id=$id; 30 | return $this; 31 | } 32 | 33 | public function getTitle() { 34 | return $this->title; 35 | } 36 | 37 | public function setTitle($title) { 38 | $this->title=$title; 39 | return $this; 40 | } 41 | 42 | public function getDescription() { 43 | return $this->description; 44 | } 45 | 46 | public function setDescription($description) { 47 | $this->description=$description; 48 | return $this; 49 | } 50 | 51 | public function getImage() { 52 | return $this->image; 53 | } 54 | 55 | public function setImage($image) { 56 | $this->image=$image; 57 | return $this; 58 | } 59 | 60 | public function getPrice() { 61 | return $this->price; 62 | } 63 | 64 | public function setPrice($price) { 65 | $this->price=$price; 66 | return $this; 67 | } 68 | 69 | public function fromArray($array) { 70 | foreach ( $array as $key => $value ) { 71 | $this->{$key}=$value; 72 | } 73 | return $this; 74 | } 75 | 76 | public function asArray() { 77 | return $this->JsonSerialize(); 78 | } 79 | 80 | public function JsonSerialize() { 81 | $vars=get_object_vars($this); 82 | $result=array (); 83 | foreach ( $vars as $k => $v ) { 84 | if (isset($v)) 85 | $result[$k]=$v; 86 | } 87 | return $result; 88 | } 89 | 90 | public function search($query, $field="title") { 91 | $value=$this->$field; 92 | return \stripos($value, $query) !== false; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Ajax/semantic/components/jsTemplates/tplCheckedList.php: -------------------------------------------------------------------------------- 1 | = arr.length) {deferred.resolve();} else {setTimeout(chunk, 0);} 8 | }; 9 | setTimeout(chunk, 0);return deferred.promise(); 10 | }; 11 | $("%identifier% .master") 12 | .checkbox({ 13 | onChecked: function() {if($(this).closest(".loading").length==0 && !$(this).hasClass("_notAllChecked")){$(this).closest(".checkbox").siblings(".list").find(".checkbox").checkbox("check");}}, 14 | onUnchecked: function() {if($(this).closest(".loading").length==0){$(this).closest(".checkbox").siblings(".list").find(".checkbox").checkbox("uncheck");}} 15 | }) 16 | ; 17 | $("%identifier% .list .child.checkbox") 18 | .checkbox({ 19 | fireOnInit : %fireOnInit%, 20 | onChange : function() { 21 | var $listGroup = $(this).closest(".list"), 22 | $parentCheckbox = $listGroup.closest(".item").children(".checkbox"), 23 | $checkbox = $listGroup.find(".checkbox"), 24 | allChecked = true, 25 | allUnchecked = true; 26 | $listGroup.closest(".segment").addClass("loading"); 27 | deferredEach($checkbox,5).progress(function(index, item){ 28 | if( $(item).checkbox("is checked") ) { 29 | allUnchecked = false; 30 | } 31 | else { 32 | allChecked = false; 33 | } 34 | if(!allUnchecked && !allChecked) return; 35 | }).done(function(){ 36 | $listGroup.closest(".segment.loading").removeClass("loading"); 37 | if(allChecked) { 38 | $parentCheckbox.checkbox("set checked"); 39 | } 40 | else if(allUnchecked) { 41 | if(!$parentCheckbox.children("input").first().hasClass("_notAllChecked")){ 42 | $parentCheckbox.checkbox("set unchecked"); 43 | } 44 | } 45 | else { 46 | $parentCheckbox.checkbox("set indeterminate"); 47 | } 48 | %onChange% 49 | }); 50 | } 51 | }) 52 | ;'; 53 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/view/HtmlViewGroups.php: -------------------------------------------------------------------------------- 1 | addItems($items); 15 | } 16 | 17 | abstract protected function createElement(); 18 | 19 | protected function createItem($value) { 20 | $result=$this->createElement(); 21 | if (\is_array($value)) { 22 | $header=JArray::getValue($value, "header", 0); 23 | $metas=JArray::getValue($value, "metas", 1); 24 | $description=JArray::getValue($value, "description", 2); 25 | $image=JArray::getValue($value, "image", 3); 26 | $extra=JArray::getValue($value, "extra", 4); 27 | if (isset($image)) { 28 | $result->addImage($image); 29 | } 30 | $result->addItemHeaderContent($header, $metas, $description); 31 | if (isset($extra)) { 32 | $result->addExtraContent($extra); 33 | } 34 | } else 35 | $result->addItemContent($value); 36 | return $result; 37 | } 38 | 39 | /** 40 | * Defines the ites width (alias for setWidth) 41 | * @param int $wide 42 | */ 43 | public function setWide($wide) { 44 | $wide=Wide::getConstants()["W" . $wide]; 45 | return $this->addToPropertyCtrl("class", $wide, Wide::getConstants()); 46 | } 47 | 48 | abstract public function newItem($identifier); 49 | 50 | /** 51 | * @return HtmlViewGroups 52 | */ 53 | public function getItem($index){ 54 | return parent::getItem($index); 55 | } 56 | 57 | public function getItemContent($itemIndex, $contentIndex) { 58 | $item=$this->getItem($itemIndex); 59 | if (isset($item)) { 60 | return $item->getItemContent($contentIndex); 61 | } 62 | } 63 | 64 | public function fromDatabaseObject($object, $function) { 65 | return $this->addItem($function($object)); 66 | } 67 | 68 | public function run(JsUtils $js){ 69 | $result=parent::run($js); 70 | return $result->setItemSelector(".item"); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Ajax/service/AjaxCall.php: -------------------------------------------------------------------------------- 1 | method = $method; 14 | $this->parameters = $parameters; 15 | } 16 | 17 | public function compile(?JsUtils $js = null) { 18 | if ($js === null) 19 | return; 20 | $params = "{}"; 21 | $stopPropagation = true; 22 | $preventDefault = true; 23 | $method = "get"; 24 | $this->parameters["immediatly"] = false; 25 | extract($this->parameters); 26 | $result = $this->_eventPreparing($preventDefault, $stopPropagation); 27 | switch ($this->method) { 28 | case "get": 29 | $result .= $js->getDeferred($url, $responseElement, $this->parameters); 30 | break; 31 | case "post": 32 | $result .= $js->postDeferred($url, $params, $responseElement, $this->parameters); 33 | break; 34 | case "postForm": 35 | $result .= $js->postFormDeferred($url, $form, $responseElement, $this->parameters); 36 | break; 37 | case "json": 38 | $result .= $js->jsonDeferred($url, $method, $this->parameters); 39 | break; 40 | case "jsonArray": 41 | $result .= $js->jsonArrayDeferred($modelSelector, $url, $method, $this->parameters); 42 | break; 43 | default: 44 | $result .= $js->ajaxDeferred($this->method, $url, $responseElement, $this->parameters); 45 | break; 46 | } 47 | return $result; 48 | } 49 | 50 | protected function _eventPreparing($preventDefault, $stopPropagation) { 51 | $result = ""; 52 | if ($preventDefault === true) { 53 | $result .= Javascript::$preventDefault; 54 | } 55 | if ($stopPropagation === true) { 56 | $result .= Javascript::$stopPropagation; 57 | } 58 | return $result; 59 | } 60 | 61 | public function getMethod() { 62 | return $this->method; 63 | } 64 | 65 | public function setMethod($method) { 66 | $this->method = $method; 67 | return $this; 68 | } 69 | 70 | public function getParameters() { 71 | return $this->parameters; 72 | } 73 | 74 | public function setParameters($parameters) { 75 | $this->parameters = $parameters; 76 | return $this; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /Ajax/common/html/PropertyWrapper.php: -------------------------------------------------------------------------------- 1 | 0) { 16 | if (self::containsElement($input) === false) { 17 | $output=self::wrapStrings($input, $separator=' ', $valueQuote='"'); 18 | } else { 19 | $output=self::wrapObjects($input, $js, $view, $separator, $valueQuote); 20 | } 21 | } 22 | } 23 | return $output; 24 | } 25 | 26 | private static function containsElement($input) { 27 | foreach ( $input as $v ) { 28 | if (\is_object($v) || \is_array($v)) 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | public static function wrapStrings($input, $separator=' ', $valueQuote='"') { 35 | if (JArray::isAssociative($input) === true) { 36 | $result=implode($separator, array_map(function ($v, $k) use($valueQuote) { 37 | return $k . '=' . $valueQuote . $v . $valueQuote; 38 | }, $input, array_keys($input))); 39 | } else { 40 | $result=implode($separator, $input); 41 | } 42 | return $result; 43 | } 44 | 45 | public static function wrapObjects($input, $js=NULL, $view=null, $separator=' ', $valueQuote='"') { 46 | return implode($separator, array_map(function ($v) use($js, $view,$separator, $valueQuote) { 47 | if(\is_string($v)){ 48 | return $v; 49 | } 50 | if ($v instanceof BaseHtml){ 51 | return $v->compile($js,$view); 52 | } 53 | if (\is_array($v)) { 54 | return self::wrap($v, $js, $view,$separator, $valueQuote); 55 | } 56 | if(!\is_callable($v)){ 57 | return $v; 58 | } 59 | }, $input)); 60 | } 61 | 62 | protected static function wrapValue($value,$js=NULL, $separator=' ', $valueQuote='"'){ 63 | if (\is_array($value)) { 64 | return self::wrap($value, $js, $separator, $valueQuote); 65 | } 66 | if ($value instanceof BaseHtml){ 67 | return $value->compile($js); 68 | } 69 | if(!\is_callable($value)){ 70 | return $value; 71 | } 72 | return ''; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Ajax/bootstrap/html/content/HtmlTabItem.php: -------------------------------------------------------------------------------- 1 | _template='<%tagName% id="%identifier%" %properties%>%content%'; 19 | $this->content=new HtmlLink("link-".$identifier); 20 | $this->content->setHref($href); 21 | $this->content->setContent($caption); 22 | $this->setProperty("role", "presentation"); 23 | } 24 | 25 | public function setHref($value) { 26 | $this->content->setHref($value); 27 | } 28 | 29 | public function setContent($value) { 30 | $this->content->setContent($value); 31 | } 32 | 33 | /* 34 | * (non-PHPdoc) 35 | * @see \Ajax\bootstrap\html\HtmlDoubleElement::run() 36 | */ 37 | public function run(JsUtils $js) { 38 | $this->_bsComponent=$js->bootstrap()->tab("#".$this->identifier); 39 | $this->addEventsOnRun($js); 40 | return $this->_bsComponent; 41 | } 42 | 43 | public function getHref() { 44 | return $this->content->getHref(); 45 | } 46 | 47 | /* 48 | * (non-PHPdoc) 49 | * @see \Ajax\bootstrap\html\HtmlSingleElement::fromArray() 50 | */ 51 | public function fromArray($array) { 52 | if (array_key_exists("href", $array)) { 53 | $this->setHref($array ["href"]); 54 | unset($array ["key"]); 55 | } 56 | return parent::fromArray($array); 57 | } 58 | 59 | /* (non-PHPdoc) 60 | * @see \Ajax\bootstrap\html\base\BaseWidget::setIdentifier() 61 | */ 62 | public function setIdentifier($identifier) { 63 | parent::setIdentifier($identifier); 64 | if($this->content instanceof HtmlLink){ 65 | $this->content->setIdentifier("link-".$identifier); 66 | } 67 | } 68 | public function setActive($value=true){ 69 | $this->setProperty("class", ($value)?"active":""); 70 | } 71 | 72 | public function disable(){ 73 | $this->setProperty("class", "disabled"); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Ajax/ui/components/Dialog.php: -------------------------------------------------------------------------------- 1 | params = array( 22 | "dialogClass" => "no-close" 23 | ); 24 | $this->addCancelBtn("Annuler"); 25 | } 26 | 27 | public function getScript() { 28 | $allParams = $this->params; 29 | $jsonButtons = array(); 30 | foreach ($this->buttons as $button) { 31 | $jsonButtons[] = $button->getParams(); 32 | } 33 | $allParams["buttons"] = $jsonButtons; 34 | $this->jquery_code_for_compile[] = "$( '" . $this->attachTo . "' ).dialog(" . $this->getParamsAsJSON($allParams) . ");"; 35 | $result = implode("", $this->jquery_code_for_compile); 36 | $result = str_ireplace("\"%", "", $result); 37 | $result = str_ireplace("%\"", "", $result); 38 | $result = str_ireplace("\\n", "", $result); 39 | $result = str_ireplace("\\t", "", $result); 40 | return $result; 41 | } 42 | 43 | /** 44 | * 45 | * @param String $identifier 46 | * identifiant CSS 47 | */ 48 | public function attach($identifier) { 49 | $this->attachTo = $identifier; 50 | } 51 | 52 | public function addCancelBtn($caption = "Annuler", $position = NULL) { 53 | $this->insertBtn(DialogButton::cancelButton($caption), $position); 54 | } 55 | 56 | public function addSubmitBtn(JsUtils $js, $url, $form, $responseElement, $caption = "Valider", $position = NULL) { 57 | $this->insertBtn(DialogButton::submitButton($js, $url, $form, $responseElement, $caption), $position); 58 | } 59 | 60 | public function addButton($caption, $jsCode, $position = NULL) { 61 | $this->insertBtn(new DialogButton($caption, $jsCode), $position); 62 | } 63 | 64 | private function insertBtn($insert, $position = NULL) { 65 | if ($position != NULL) { 66 | $this->buttons = array_splice($this->buttons, $position, 0, $insert); 67 | } else { 68 | $this->buttons[] = $insert; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/traits/CheckboxTrait.php: -------------------------------------------------------------------------------- 1 | getHtmlCk()->addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants()); 19 | } 20 | 21 | 22 | /** 23 | * Attach $this to $selector and fire $action 24 | * @param string $selector jquery selector of the associated element 25 | * @param string $action action to execute : check, uncheck or NULL for toggle 26 | * @return HtmlFormField 27 | */ 28 | public function attachEvent($selector, $action=NULL) { 29 | return $this->getHtmlCk()->attachEvent($selector, $action); 30 | } 31 | 32 | /** 33 | * Attach $this to an array of $action=>$selector 34 | * @param array $events associative array of events to attach ex : ["#bt-toggle","check"=>"#bt-check","uncheck"=>"#bt-uncheck"] 35 | * @return HtmlFormField 36 | */ 37 | public function attachEvents($events=array()) { 38 | return $this->getHtmlCk()->attachEvents($events); 39 | } 40 | 41 | public function getField(){ 42 | return $this->content["field"]; 43 | } 44 | 45 | public function getHtmlCk(){ 46 | return $this->content["field"]; 47 | } 48 | 49 | public function setName($name){ 50 | $this->getDataField()->setProperty("name", $name); 51 | return $this; 52 | } 53 | 54 | public function getDataField(){ 55 | $field= $this->getField(); 56 | if($field instanceof AbstractCheckbox) 57 | $field=$field->getField(); 58 | return $field; 59 | } 60 | 61 | /** 62 | * Check the checkbox 63 | * @param boolean $value 64 | * @return $this 65 | */ 66 | public function setChecked($value=true){ 67 | if($value===true){ 68 | $this->getDataField()->setProperty("checked", "checked"); 69 | }else{ 70 | $this->getDataField()->removeProperty("checked"); 71 | } 72 | return $this; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /Ajax/ui/properties/Animation.php: -------------------------------------------------------------------------------- 1 | setDuration($duration); 16 | $this->setEasing($easing); 17 | $this->setQueue($queue); 18 | } 19 | 20 | /** 21 | * An int determining how long the animation will run (in milliseconds). 22 | * 23 | * @param int $value 24 | * default : 400 25 | */ 26 | public function setDuration($value) { 27 | $this->setParamCtrl("duration", $value, "is_int"); 28 | } 29 | 30 | /** 31 | * A string indicating which easing function to use for the transition. 32 | * 33 | * @param string $value 34 | * default : swing 35 | */ 36 | public function setEasing($value) { 37 | $this->setParamCtrl("easing", $value, array( 38 | "linear", 39 | "swing", 40 | "easeInQuad", 41 | "easeOutQuad", 42 | "easeInOutQuad", 43 | "easeInCubic", 44 | "easeOutCubic", 45 | "easeInOutCubic", 46 | "easeInQuart", 47 | "easeOutQuart", 48 | "easeInOutQuart", 49 | "easeInQuint", 50 | "easeOutQuint", 51 | "easeInOutQuint", 52 | "easeInExpo", 53 | "easeOutExpo", 54 | "easeInOutExpo", 55 | "easeInSine", 56 | "easeOutSine", 57 | "easeInOutSine", 58 | "easeInCirc", 59 | "easeOutCirc", 60 | "easeInOutCirc", 61 | "easeInElastic", 62 | "easeOutElastic", 63 | "easeInOutElastic", 64 | "easeInBack", 65 | "easeOutBack", 66 | "easeInOutBack", 67 | "easeInBounce", 68 | "easeOutBounce", 69 | "easeInOutBounce" 70 | )); 71 | } 72 | 73 | /** 74 | * A Boolean indicating whether to place the animation in the effects queue. 75 | * If false, the animation will begin immediately. 76 | * 77 | * @param Boolean $value 78 | * default : true 79 | */ 80 | public function setQueue($value) { 81 | $this->setParamCtrl("queue", $value, "is_bool"); 82 | } 83 | 84 | /* 85 | * (non-PHPdoc) 86 | * @see \Ajax\common\BaseComponent::getScript() 87 | */ 88 | public function getScript() {} 89 | } 90 | -------------------------------------------------------------------------------- /Ajax/semantic/html/content/InternalPopup.php: -------------------------------------------------------------------------------- 1 | semElement=$semElement; 19 | $this->title=$title; 20 | $this->content=$content; 21 | $this->setAttributes($variation,$params); 22 | } 23 | 24 | public function setHtml($html) { 25 | $this->html= $html; 26 | return $this; 27 | } 28 | 29 | public function setAttributes($variation=NULL,$params=array()){ 30 | $this->variation=$variation; 31 | $this->params=$params; 32 | } 33 | 34 | public function onShow($jsCode){ 35 | $this->params["onShow"]=$jsCode; 36 | } 37 | 38 | public function compile(?JsUtils $js=NULL){ 39 | if(JString::isNotNull($this->title)){ 40 | $this->semElement->setProperty("data-title", $this->title); 41 | } 42 | if(JString::isNotNull($this->content)){ 43 | $this->semElement->setProperty("data-content", $this->content); 44 | } 45 | $this->_compileHtml($js); 46 | if(JString::isNotNull($this->variation)){ 47 | $this->semElement->setProperty("data-variation", $this->variation); 48 | } 49 | } 50 | 51 | private function _compileHtml(?JsUtils $js=NULL){ 52 | if(JString::isNotNull($this->html)){ 53 | $html=$this->html; 54 | if(\is_array($html)){ 55 | \array_walk($html, function(&$item) use($js){ 56 | if($item instanceof HtmlSemDoubleElement){ 57 | $comp=$item->compile($js); 58 | if(isset($js)){ 59 | $bs=$item->run($js); 60 | if(isset($bs)) 61 | $this->params['onShow']=$bs->getScript(); 62 | } 63 | $item=$comp; 64 | } 65 | }); 66 | $html=\implode("",$html); 67 | } 68 | $html=\str_replace("\"", "'", $html); 69 | $this->semElement->addToProperty("data-html", $html); 70 | } 71 | } 72 | 73 | public function run(JsUtils $js){ 74 | $js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params); 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /Ajax/php/phalcon/JsUtils.php: -------------------------------------------------------------------------------- 1 | _di=$di; 14 | //$this->_setDi($di); 15 | } 16 | 17 | public function getDi() { 18 | return $this->_di; 19 | } 20 | 21 | public function getUrl($url){ 22 | return $this->_di->get("url")->get($url); 23 | } 24 | 25 | public function addViewElement($identifier,$content,&$view){ 26 | $controls=$view->getVar("q"); 27 | if (isset($controls) === false) { 28 | $controls=array (); 29 | } 30 | $controls[$identifier]=$content; 31 | $view->setVar("q", $controls); 32 | } 33 | 34 | public function createScriptVariable(&$view,$view_var, $output){ 35 | $view->setVar($view_var,$output); 36 | } 37 | 38 | public function forward($initialController,$controller,$action,$params=array()){ 39 | $dispatcher = $initialController->dispatcher; 40 | $dispatcher->setControllerName($controller); 41 | $dispatcher->setActionName($action); 42 | $dispatcher->dispatch(); 43 | $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) { 44 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); 45 | }); 46 | return $template; 47 | } 48 | 49 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { 50 | list($controller,$action)=\explode("@", $viewName); 51 | $template=$initialControllerInstance->view->getRender($controller, $action, $params, function ($view) { 52 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); 53 | }); 54 | return $template; 55 | } 56 | 57 | public function fromDispatcher($dispatcher){ 58 | $params=$dispatcher->getParams(); 59 | $action=$dispatcher->getActionName(); 60 | $items=array($dispatcher->getControllerName()); 61 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ 62 | $items[]=$action; 63 | foreach ($params as $p){ 64 | if(\is_object($p)===false) 65 | $items[]=$p; 66 | } 67 | } 68 | return $items; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Collapse.php: -------------------------------------------------------------------------------- 1 | uiName="collapse"; 20 | } 21 | 22 | public function attach($identifier) { 23 | parent::attach($identifier); 24 | $this->js->attr($identifier, "data-toggle", "collapse", true); 25 | } 26 | 27 | public function show() { 28 | $this->jsCodes []=new JsCode(' $(function () {$("%identifier%").click();});'); 29 | } 30 | 31 | /** 32 | * This event fires immediately when the show instance method is called. 33 | * @param string $jsCode 34 | * @return $this 35 | */ 36 | public function onShow($jsCode) { 37 | return $this->addEvent("show.bs.collapse", $jsCode); 38 | } 39 | 40 | /** 41 | * This event is fired when a collapse element has been made visible to the user (will wait for CSS transitions to complete). 42 | * @param string $jsCode 43 | * @return $this 44 | */ 45 | public function onShown($jsCode) { 46 | return $this->addEvent("shown.bs.collapse", $jsCode); 47 | } 48 | 49 | /** 50 | * This event is fired immediately when the hide method has been called. 51 | * @param string $jsCode 52 | * @return $this 53 | */ 54 | public function onHide($jsCode) { 55 | return $this->addEvent("hide.bs.collapse", $jsCode); 56 | } 57 | 58 | /** 59 | * This event is fired when a collapse element has been hidden from the user (will wait for CSS transitions to complete). 60 | * @param string $jsCode 61 | * @return $this 62 | */ 63 | public function onHidden($jsCode) { 64 | return $this->addEvent("hidden.bs.collapse", $jsCode); 65 | } 66 | 67 | protected function compileEvents() { 68 | foreach ( $this->events as $event => $jsCode ) { 69 | $this->jquery_code_for_compile []="$( \"".$this->collapsed."\" ).on(\"".$event."\" , function (e) {".$jsCode."});"; 70 | } 71 | } 72 | 73 | public function setCollapsed($collapsed) { 74 | $this->collapsed=$collapsed; 75 | return $this; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/icons/Brands.php: -------------------------------------------------------------------------------- 1 | data=include 'CDN.php'; 17 | $this->version=$version; 18 | $this->provider=$provider; 19 | $this->local=false; 20 | $this->jsUrl=null; 21 | } 22 | 23 | public function getJsUrl() { 24 | return $this->jsUrl; 25 | } 26 | 27 | public function setJsUrl($jsUrl, $local=null) { 28 | $this->jsUrl=$jsUrl; 29 | if (isset($local)===false) { 30 | $local=JString::startsWith($jsUrl, "http")===false; 31 | } 32 | $this->setLocal($local); 33 | return $this; 34 | } 35 | 36 | protected function getUrlOrCss($element, $key) { 37 | if (isset($element)) 38 | return $element; 39 | $version=$this->version; 40 | if (array_search($version, $this->getVersions())===false) 41 | $version=$this->getLastVersion(); 42 | return $this->replaceVersion($this->data [$this->provider] [$key], $version); 43 | } 44 | 45 | public function isLocal() { 46 | return $this->local; 47 | } 48 | 49 | public function setLocal($local) { 50 | $this->local=$local; 51 | return $this; 52 | } 53 | 54 | protected function replaceVersion($url, $version) { 55 | return str_ireplace("%version%", $version, $url); 56 | } 57 | 58 | protected function replaceTheme($url, $theme) { 59 | return str_ireplace("%theme%", $theme, $url); 60 | } 61 | 62 | protected function replaceVersionAndTheme($url, $version, $theme) { 63 | if (isset($theme)) 64 | return str_ireplace(array ( 65 | "%theme%", 66 | "%version%" 67 | ), array ( 68 | $theme, 69 | $version 70 | ), $url); 71 | else 72 | return $this->replaceVersion($url, $version); 73 | } 74 | 75 | public function getProviders() { 76 | return array_keys($this->data); 77 | } 78 | 79 | public function getVersions($provider=NULL) { 80 | if (isset($provider)) 81 | return $this->data [$provider] ["versions"]; 82 | else 83 | return $this->data [$this->provider] ["versions"]; 84 | } 85 | 86 | public function getLastVersion($provider=NULL) { 87 | return $this->getVersions($provider)[0]; 88 | } 89 | 90 | abstract public function getUrl(); 91 | } 92 | --------------------------------------------------------------------------------