├── .gitignore ├── Ajax ├── Bootstrap.php ├── Jquery.php ├── JqueryUI.php ├── JsUtils.php ├── Semantic.php ├── bootstrap │ ├── components │ │ ├── Carousel.php │ │ ├── Collapse.php │ │ ├── Dropdown.php │ │ ├── Modal.php │ │ ├── Popover.php │ │ ├── Scrollspy.php │ │ ├── Splitbutton.php │ │ ├── Tab.php │ │ ├── Tabs.php │ │ └── Tooltip.php │ ├── html │ │ ├── HtmlAccordion.php │ │ ├── HtmlAlert.php │ │ ├── HtmlBadge.php │ │ ├── HtmlBreadcrumbs.php │ │ ├── HtmlButton.php │ │ ├── HtmlButtongroups.php │ │ ├── HtmlButtontoolbar.php │ │ ├── HtmlCarousel.php │ │ ├── HtmlCollapse.php │ │ ├── HtmlDropdown.php │ │ ├── HtmlForm.php │ │ ├── HtmlGlyphButton.php │ │ ├── HtmlGlyphicon.php │ │ ├── HtmlGridsystem.php │ │ ├── HtmlInput.php │ │ ├── HtmlInputCheckbox.php │ │ ├── HtmlInputRadio.php │ │ ├── HtmlInputgroup.php │ │ ├── HtmlLabel.php │ │ ├── HtmlLink.php │ │ ├── HtmlListgroup.php │ │ ├── HtmlModal.php │ │ ├── HtmlNavbar.php │ │ ├── HtmlPagination.php │ │ ├── HtmlPanel.php │ │ ├── HtmlProgressbar.php │ │ ├── HtmlSplitbutton.php │ │ ├── HtmlTabs.php │ │ ├── base │ │ │ ├── CssButton.php │ │ │ ├── CssGlyphicon.php │ │ │ ├── CssNavbar.php │ │ │ ├── CssRef.php │ │ │ ├── CssSize.php │ │ │ ├── HtmlBsDoubleElement.php │ │ │ ├── HtmlElementAsContent.php │ │ │ └── HtmlNavElement.php │ │ ├── content │ │ │ ├── HtmlCarouselControl.php │ │ │ ├── HtmlCarouselItem.php │ │ │ ├── HtmlDropdownItem.php │ │ │ ├── HtmlGridCol.php │ │ │ ├── HtmlGridRow.php │ │ │ ├── HtmlListgroupItem.php │ │ │ ├── HtmlNavzone.php │ │ │ ├── HtmlTabContent.php │ │ │ ├── HtmlTabContentItem.php │ │ │ └── HtmlTabItem.php │ │ ├── phalcon │ │ │ ├── PhBsElement.php │ │ │ ├── PhBsForm.php │ │ │ ├── PhBsRenderer.php │ │ │ ├── PhBsSelect.php │ │ │ └── PhBsText.php │ │ └── templates │ │ │ ├── tplCarousel.php │ │ │ ├── tplCarouselControl.php │ │ │ ├── tplCarouselItem.php │ │ │ ├── tplDropdown.php │ │ │ ├── tplInputgroup.php │ │ │ ├── tplModal.php │ │ │ ├── tplNavbar.php │ │ │ ├── tplPanel.php │ │ │ ├── tplProgressbar.php │ │ │ └── tplSplitbutton.php │ ├── js │ │ └── Draggable.php │ └── traits │ │ └── BootstrapComponentsTrait.php ├── common │ ├── BaseEnum.php │ ├── BaseGui.php │ ├── JsCode.php │ ├── components │ │ ├── BaseComponent.php │ │ ├── GenericComponent.php │ │ ├── SimpleComponent.php │ │ └── SimpleExtComponent.php │ ├── html │ │ ├── BaseHtml.php │ │ ├── BaseWidget.php │ │ ├── HtmlCollection.php │ │ ├── HtmlDoubleElement.php │ │ ├── HtmlSingleElement.php │ │ ├── PropertyWrapper.php │ │ └── html5 │ │ │ ├── HtmlImg.php │ │ │ ├── HtmlInput.php │ │ │ ├── HtmlLinkTrait.php │ │ │ ├── HtmlList.php │ │ │ ├── HtmlOption.php │ │ │ ├── HtmlSelect.php │ │ │ └── HtmlTextarea.php │ └── traits │ │ ├── JqueryActionsTrait.php │ │ ├── JqueryAjaxTrait.php │ │ ├── JqueryEventsTrait.php │ │ ├── JsUtilsActionsTrait.php │ │ ├── JsUtilsAjaxTrait.php │ │ └── JsUtilsEventsTrait.php ├── config │ ├── DefaultConfig.php │ └── config.php ├── lib │ ├── CDN.php │ ├── CDNBase.php │ ├── CDNCoreCss.php │ ├── CDNGuiGen.php │ └── CDNJQuery.php ├── php │ ├── laravel │ │ └── JsUtils.php │ ├── phalcon │ │ └── JsUtils.php │ ├── symfony │ │ └── JsUtils.php │ └── yii │ │ ├── JsUtils.php │ │ └── URI.php ├── semantic │ ├── components │ │ ├── Accordion.php │ │ ├── Checkbox.php │ │ ├── Dimmer.php │ │ ├── Dropdown.php │ │ ├── Modal.php │ │ ├── Popup.php │ │ ├── Progress.php │ │ ├── Rating.php │ │ ├── Search.php │ │ ├── SimpleSemExtComponent.php │ │ ├── Sticky.php │ │ ├── jsTemplates │ │ │ └── tplCheckedList.php │ │ └── search │ │ │ ├── AbstractSearchResult.php │ │ │ ├── ISearch.php │ │ │ ├── SearchCategories.php │ │ │ ├── SearchCategory.php │ │ │ ├── SearchResult.php │ │ │ └── SearchResults.php │ ├── html │ │ ├── base │ │ │ ├── ClassModifier.php │ │ │ ├── HtmlSemCollection.php │ │ │ ├── HtmlSemDoubleElement.php │ │ │ ├── HtmlSemNavElement.php │ │ │ ├── HtmlSemSingleElement.php │ │ │ ├── constants │ │ │ │ ├── CheckboxType.php │ │ │ │ ├── Color.php │ │ │ │ ├── Country.php │ │ │ │ ├── Direction.php │ │ │ │ ├── Emphasis.php │ │ │ │ ├── HeaderSize.php │ │ │ │ ├── RevealType.php │ │ │ │ ├── SegmentType.php │ │ │ │ ├── Sens.php │ │ │ │ ├── Side.php │ │ │ │ ├── Size.php │ │ │ │ ├── Social.php │ │ │ │ ├── State.php │ │ │ │ ├── StepStatus.php │ │ │ │ ├── Style.php │ │ │ │ ├── TextAlignment.php │ │ │ │ ├── Variation.php │ │ │ │ ├── VerticalAlignment.php │ │ │ │ ├── Wide.php │ │ │ │ └── icons │ │ │ │ │ ├── Audio.php │ │ │ │ │ ├── Brands.php │ │ │ │ │ ├── ComputerFilesystem.php │ │ │ │ │ ├── Currency.php │ │ │ │ │ ├── GenderSexuality.php │ │ │ │ │ ├── ItemSelection.php │ │ │ │ │ ├── LayoutAdjustment.php │ │ │ │ │ ├── Map.php │ │ │ │ │ ├── Media.php │ │ │ │ │ ├── Message.php │ │ │ │ │ ├── Objects.php │ │ │ │ │ ├── PaymentOptions.php │ │ │ │ │ ├── Pointers.php │ │ │ │ │ ├── Rating.php │ │ │ │ │ ├── Shapes.php │ │ │ │ │ ├── Tables.php │ │ │ │ │ ├── Technologies.php │ │ │ │ │ ├── TextEditor.php │ │ │ │ │ ├── UserActions.php │ │ │ │ │ ├── UserTypes.php │ │ │ │ │ └── webContent.php │ │ │ └── traits │ │ │ │ ├── AttachedTrait.php │ │ │ │ ├── BaseTrait.php │ │ │ │ ├── IconTrait.php │ │ │ │ ├── LabeledIconTrait.php │ │ │ │ ├── TableElementTrait.php │ │ │ │ └── TextAlignmentTrait.php │ │ ├── collections │ │ │ ├── HtmlBreadcrumb.php │ │ │ ├── HtmlGrid.php │ │ │ ├── HtmlMessage.php │ │ │ ├── HtmlTable.php │ │ │ ├── form │ │ │ │ ├── HtmlForm.php │ │ │ │ ├── HtmlFormCheckbox.php │ │ │ │ ├── HtmlFormDropdown.php │ │ │ │ ├── HtmlFormField.php │ │ │ │ ├── HtmlFormFields.php │ │ │ │ ├── HtmlFormInput.php │ │ │ │ ├── HtmlFormRadio.php │ │ │ │ ├── HtmlFormTextarea.php │ │ │ │ └── traits │ │ │ │ │ ├── CheckboxTrait.php │ │ │ │ │ ├── FieldsTrait.php │ │ │ │ │ └── TextFieldsTrait.php │ │ │ └── menus │ │ │ │ ├── HtmlAccordionMenu.php │ │ │ │ ├── HtmlIconMenu.php │ │ │ │ ├── HtmlLabeledIconMenu.php │ │ │ │ ├── HtmlMenu.php │ │ │ │ └── HtmlPaginationMenu.php │ │ ├── content │ │ │ ├── HtmlAbsractItem.php │ │ │ ├── HtmlAccordionItem.php │ │ │ ├── HtmlAccordionMenuItem.php │ │ │ ├── HtmlDropdownItem.php │ │ │ ├── HtmlGridCol.php │ │ │ ├── HtmlGridRow.php │ │ │ ├── HtmlListItem.php │ │ │ ├── HtmlMenuItem.php │ │ │ ├── HtmlStepItem.php │ │ │ ├── InternalPopup.php │ │ │ ├── card │ │ │ │ ├── HtmlCardContent.php │ │ │ │ └── HtmlCardHeaderContent.php │ │ │ └── table │ │ │ │ ├── HtmlTD.php │ │ │ │ ├── HtmlTR.php │ │ │ │ └── HtmlTableContent.php │ │ ├── elements │ │ │ ├── HtmlButton.php │ │ │ ├── HtmlButtonGroups.php │ │ │ ├── HtmlContainer.php │ │ │ ├── HtmlDivider.php │ │ │ ├── HtmlFlag.php │ │ │ ├── HtmlHeader.php │ │ │ ├── HtmlIcon.php │ │ │ ├── HtmlIconGroups.php │ │ │ ├── HtmlImage.php │ │ │ ├── HtmlInput.php │ │ │ ├── HtmlLabel.php │ │ │ ├── HtmlLabelGroups.php │ │ │ ├── HtmlList.php │ │ │ ├── HtmlLoader.php │ │ │ ├── HtmlRail.php │ │ │ ├── HtmlReveal.php │ │ │ ├── HtmlSegment.php │ │ │ ├── HtmlSegmentGroups.php │ │ │ ├── HtmlStep.php │ │ │ └── html5 │ │ │ │ ├── HtmlImg.php │ │ │ │ └── HtmlLink.php │ │ ├── modules │ │ │ ├── HtmlAccordion.php │ │ │ ├── HtmlDimmer.php │ │ │ ├── HtmlDropdown.php │ │ │ ├── HtmlModal.php │ │ │ ├── HtmlPopup.php │ │ │ ├── HtmlProgress.php │ │ │ ├── HtmlRating.php │ │ │ ├── HtmlSearch.php │ │ │ ├── HtmlSticky.php │ │ │ └── checkbox │ │ │ │ ├── AbstractCheckbox.php │ │ │ │ ├── HtmlCheckbox.php │ │ │ │ └── HtmlRadio.php │ │ ├── templates │ │ │ ├── tplDropdown.php │ │ │ └── tplDropdownMenu.php │ │ └── views │ │ │ ├── HtmlCard.php │ │ │ └── HtmlCardGroups.php │ └── traits │ │ ├── SemanticComponentsTrait.php │ │ ├── SemanticHtmlCollectionsTrait.php │ │ ├── SemanticHtmlElementsTrait.php │ │ ├── SemanticHtmlModulesTrait.php │ │ └── SemanticHtmlViewsTrait.php ├── service │ ├── AjaxCall.php │ ├── JArray.php │ ├── JString.php │ └── PhalconUtils.php └── ui │ ├── components │ ├── Accordion.php │ ├── Autocomplete.php │ ├── Button.php │ ├── Buttonset.php │ ├── Dialog.php │ ├── DialogButton.php │ ├── Menu.php │ ├── Progressbar.php │ ├── Selectmenu.php │ ├── Slider.php │ ├── Spinner.php │ ├── Tabs.php │ └── Tooltip.php │ └── properties │ ├── Animation.php │ └── Position.php ├── CONTRIBUTING.md ├── LICENSE ├── README.md └── composer.json /.gitignore: -------------------------------------------------------------------------------- 1 | .buildpath 2 | *.project 3 | .settings/org.eclipse.php.core.prefs 4 | *.xml -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Carousel.php: -------------------------------------------------------------------------------- 1 | uiName="carousel"; 19 | $this->setInterval(2000); 20 | } 21 | 22 | public function attach($identifier) { 23 | parent::attach($identifier); 24 | } 25 | 26 | /** 27 | * The amount of time to delay between automatically cycling an item. 28 | * If false, carousel will not automatically cycle. 29 | * @param int $value 30 | * @return \Ajax\bootstrap\components\Carousel default : 5000 31 | */ 32 | public function setInterval($value=5000) { 33 | return $this->setParam("interval", $value); 34 | } 35 | 36 | /** 37 | * Pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. 38 | * @param string $event 39 | * @return \Ajax\bootstrap\components\Carousel default : 'hover' 40 | */ 41 | public function setPause($event="hover") { 42 | return $this->setParam("pause", $event); 43 | } 44 | 45 | /** 46 | * Whether the carousel should cycle continuously or have hard stops. 47 | * @param string $value 48 | * @return \Ajax\bootstrap\components\Carousel default : true 49 | */ 50 | public function setWrap($value=true) { 51 | return $this->setParam("wrap", $value); 52 | } 53 | 54 | /** 55 | * Whether the carousel should react to keyboard events. 56 | * @param string $value 57 | * @return \Ajax\bootstrap\components\Carousel default : true 58 | */ 59 | public function setKeyboard($value=true) { 60 | return $this->setParam("keyboard", $value); 61 | } 62 | 63 | /** 64 | * This event fires immediately when the slide instance method is invoked. 65 | * @param string $jsCode 66 | * @return $this 67 | */ 68 | public function onSlide($jsCode) { 69 | return $this->addEvent("slide.bs.carousel", $jsCode); 70 | } 71 | 72 | /** 73 | * This event is fired when the carousel has completed its slide transition. 74 | * @param string $jsCode 75 | * @return $this 76 | */ 77 | public function onSlid($jsCode) { 78 | return $this->addEvent("slid.bs.carousel", $jsCode); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /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/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 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Popover.php: -------------------------------------------------------------------------------- 1 | uiName="popover"; 18 | } 19 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/components/Tab.php: -------------------------------------------------------------------------------- 1 | uiName="tab"; 18 | } 19 | 20 | /* 21 | * (non-PHPdoc) 22 | * @see \Ajax\bootstrap\components\SimpleBsComponent::getScript() 23 | */ 24 | public function getScript() { 25 | $jsCode="$('".$this->attachTo." a').click(function (event) { event.preventDefault();$(this).tab('show');});"; 26 | $this->jquery_code_for_compile []=$jsCode; 27 | $this->compileEvents(); 28 | return $this->compileJQueryCode(); 29 | } 30 | 31 | public function show() { 32 | $this->jquery_code_for_compile []=' $(function () {$("'.$this->attachTo.' a").tab("show");});'; 33 | } 34 | 35 | /** 36 | * This event fires on tab show, but before the new tab has been shown. 37 | * Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively. 38 | * @param string $jsCode 39 | * @return $this 40 | */ 41 | public function onShow($jsCode) { 42 | return $this->addEvent("show.bs.tab", $jsCode); 43 | } 44 | 45 | /** 46 | * This event fires on tab show after a tab has been shown. 47 | * Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively. 48 | * @param string $jsCode 49 | * @return $this 50 | */ 51 | public function onShown($jsCode) { 52 | return $this->addEvent("shown.bs.tab", $jsCode); 53 | } 54 | 55 | /** 56 | * This event fires when a new tab is to be shown (and thus the previous active tab is to be hidden). 57 | * Use event.target and event.relatedTarget to target the current active tab and the new soon-to-be-active tab, respectively. 58 | * @param string $jsCode 59 | * @return $this 60 | */ 61 | public function onHide($jsCode) { 62 | return $this->addEvent("hide.bs.tab", $jsCode); 63 | } 64 | 65 | /** 66 | * This event fires after a new tab is shown (and thus the previous active tab is hidden). 67 | * Use event.target and event.relatedTarget to target the previous active tab and the new active tab, respectively. 68 | * @param string $jsCode 69 | * @return $this 70 | */ 71 | public function onHidden($jsCode) { 72 | return $this->addEvent("hidden.bs.tab", $jsCode); 73 | } 74 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlBadge.php: -------------------------------------------------------------------------------- 1 | content=$caption; 18 | $this->setProperty("class", "badge"); 19 | } 20 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlButtontoolbar.php: -------------------------------------------------------------------------------- 1 | setClass("btn-toolbar"); 18 | } 19 | 20 | /* 21 | * (non-PHPdoc) 22 | * @see \Ajax\bootstrap\html\HtmlButtongroups::addElement() 23 | */ 24 | public function addElement($element) { 25 | if ($element instanceof HtmlButtongroups) { 26 | $this->elements []=$element; 27 | } else { 28 | $this->getLastButtonGroup()->addElement($element); 29 | } 30 | } 31 | 32 | /** 33 | * Add and return a new buttongroup 34 | * @return \Ajax\bootstrap\html\HtmlButtongroups 35 | */ 36 | public function addGroup() { 37 | $nb=sizeof($this->elements); 38 | $bg=new HtmlButtongroups($this->identifier."-buttongroups-".$nb); 39 | $this->elements []=$bg; 40 | return $bg; 41 | } 42 | 43 | /** 44 | * 45 | * @return HtmlButtongroups 46 | */ 47 | private function getLastButtonGroup() { 48 | $nb=sizeof($this->elements); 49 | if ($nb>0) 50 | $bg=$this->elements [$nb-1]; 51 | else { 52 | $bg=new HtmlButtongroups($this->identifier."-buttongroups-".$nb); 53 | $this->elements []=$bg; 54 | } 55 | return $bg; 56 | } 57 | 58 | /** 59 | * return the Buttongroups at position $index 60 | * @return \Ajax\bootstrap\html\HtmlButtongroups 61 | */ 62 | public function getGroup($index) { 63 | return parent::getElement($index); 64 | } 65 | 66 | public function getLastGroup() { 67 | $bg=null; 68 | $nb=sizeof($this->elements); 69 | if ($nb>0) 70 | $bg=$this->elements [$nb-1]; 71 | return $bg; 72 | } 73 | 74 | /* 75 | * (non-PHPdoc) 76 | * @see \Ajax\bootstrap\html\HtmlButtongroups::getElement() 77 | */ 78 | public function getElement($index) { 79 | $element=null; 80 | $i=0; 81 | if (is_int($index)) { 82 | $elements=array (); 83 | foreach ( $this->elements as $group ) { 84 | $elements=array_merge($elements, $group->getElements()); 85 | } 86 | if ($indexelements) ) { 91 | $element=$this->elements [$i]->getElement($index); 92 | $i++; 93 | } 94 | } 95 | return $element; 96 | } 97 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlCollapse.php: -------------------------------------------------------------------------------- 1 | _template="%element%%collapse%"; 21 | $this->element->setProperty("data-toogle", "collapse"); 22 | $this->element->setProperty("aria-expanded", "false"); 23 | } 24 | 25 | public function attachTo($identifier) { 26 | $this->element->setProperty("aria-controls", $identifier); 27 | if ($this->element->getTagName()==="a") 28 | $this->element->setProperty("href", "#".$identifier); 29 | else 30 | $this->element->setProperty("data-target", "#".$identifier); 31 | } 32 | 33 | public function getAttachedZone() { 34 | $id=$this->element->getProperty("aria-controls"); 35 | if (!isset($id)) 36 | if ($this->element->getTagName()==="a") 37 | $id=$this->element->getProperty("href"); 38 | if (!isset($id)||$id==="#") { 39 | $id="collapse-".$this->element->getIdentifier(); 40 | $this->attachTo($id); 41 | } 42 | $id=$this->cleanIdentifier($id); 43 | return $id; 44 | } 45 | 46 | public function setAttachedZone(HtmlDoubleElement $element) { 47 | $this->attachTo($element->getIdentifier()); 48 | $this->collapse=$element; 49 | } 50 | 51 | public function createCollapsedZone($content="", $attachTo=NULL) { 52 | if (isset($attachTo)) 53 | $this->attachTo($attachTo); 54 | $collapsedZone=new HtmlBsDoubleElement($this->getAttachedZone()); 55 | $collapsedZone->setProperty("class", "collapse"); 56 | $collapsedZone->setContent($content); 57 | return $collapsedZone; 58 | } 59 | 60 | public function addCollapsedZone($content="", $attachTo=NULL) { 61 | $this->collapse=$this->createCollapsedZone($content, $attachTo); 62 | return $this->collapse; 63 | } 64 | 65 | /* 66 | * (non-PHPdoc) 67 | * @see BaseHtml::run() 68 | */ 69 | public function run(JsUtils $js) { 70 | $this->_bsComponent=$js->bootstrap()->collapse("#".$this->element->getIdentifier()); 71 | $this->addEventsOnRun($js); 72 | return $this->_bsComponent; 73 | } 74 | 75 | public function __toString() { 76 | return $this->compile(); 77 | } 78 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlInputRadio.php: -------------------------------------------------------------------------------- 1 | setProperty("type", "radio"); 15 | $this->setProperty("class", ""); 16 | if (isset($label)) { 17 | $this->setLabel($label, false); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/HtmlLabel.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 | } -------------------------------------------------------------------------------- /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 | // TODO use Class Tag 28 | } -------------------------------------------------------------------------------- /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)===true) { 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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/base/CssButton.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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/base/HtmlNavElement.php: -------------------------------------------------------------------------------- 1 | root=""; 25 | $this->attr="data-ajax"; 26 | } 27 | 28 | /** 29 | * Associate an ajax get to the elements, displayed in $targetSelector 30 | * $attr member is used to build each element url 31 | * @param string $targetSelector the target of the get 32 | * @param string $attr the html attribute used to build the elements url 33 | * @return HtmlNavElement 34 | */ 35 | public function autoGetOnClick($targetSelector){ 36 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); 37 | } 38 | 39 | public function contentAsString(){ 40 | return implode("", $this->content); 41 | } 42 | 43 | /** 44 | * Generate the jquery script to set the elements to the HtmlNavElement 45 | * @param JsUtils $jsUtils 46 | */ 47 | public function jsSetContent(JsUtils $jsUtils){ 48 | $jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true); 49 | } 50 | 51 | public function getRoot() { 52 | return $this->root; 53 | } 54 | public function setRoot($root) { 55 | $this->root = $root; 56 | return $this; 57 | } 58 | public function getAttr() { 59 | return $this->attr; 60 | } 61 | 62 | /** 63 | * Define the html attribute for each element url in ajax 64 | * @param string $attr html attribute 65 | * @return HtmlNavElement 66 | */ 67 | public function setAttr($attr) { 68 | $this->attr = $attr; 69 | return $this; 70 | } 71 | 72 | public function __call($method, $args) { 73 | if(isset($this->$method) && is_callable($this->$method)) { 74 | return call_user_func_array( 75 | $this->$method, 76 | $args 77 | ); 78 | } 79 | } 80 | 81 | public abstract function fromDispatcher(JsUtils $js,$dispatcher,$startIndex=0); 82 | 83 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | // TODO: Auto-generated method stub 51 | } 52 | 53 | public function __toString() { 54 | return $this->compile(); 55 | } 56 | 57 | public function setClass($value) { 58 | $this->setProperty("class", $value); 59 | } 60 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/content/HtmlTabContentItem.php: -------------------------------------------------------------------------------- 1 | setProperty("role", "tabpanel"); 17 | $this->setProperty("class", "tab-pane"); 18 | } 19 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/content/HtmlTabItem.php: -------------------------------------------------------------------------------- 1 | _template='<%tagName% id="%identifier%" %properties%>%content%'; 20 | $this->content=new HtmlLink("link-".$identifier); 21 | $this->content->setHref($href); 22 | $this->content->setContent($caption); 23 | $this->setProperty("role", "presentation"); 24 | } 25 | 26 | public function setHref($value) { 27 | $this->content->setHref($value); 28 | } 29 | 30 | public function setContent($value) { 31 | $this->content->setContent($value); 32 | } 33 | 34 | /* 35 | * (non-PHPdoc) 36 | * @see \Ajax\bootstrap\html\HtmlDoubleElement::run() 37 | */ 38 | public function run(JsUtils $js) { 39 | $this->_bsComponent=$js->bootstrap()->tab("#".$this->identifier); 40 | $this->addEventsOnRun($js); 41 | return $this->_bsComponent; 42 | } 43 | 44 | public function getHref() { 45 | return $this->content->getHref(); 46 | } 47 | 48 | /* 49 | * (non-PHPdoc) 50 | * @see \Ajax\bootstrap\html\HtmlSingleElement::fromArray() 51 | */ 52 | public function fromArray($array) { 53 | if (array_key_exists("href", $array)) { 54 | $this->setHref($array ["href"]); 55 | unset($array ["key"]); 56 | } 57 | return parent::fromArray($array); 58 | } 59 | 60 | /* (non-PHPdoc) 61 | * @see \Ajax\bootstrap\html\base\BaseWidget::setIdentifier() 62 | */ 63 | public function setIdentifier($identifier) { 64 | parent::setIdentifier($identifier); 65 | if($this->content instanceof HtmlLink){ 66 | $this->content->setIdentifier("link-".$identifier); 67 | } 68 | } 69 | public function setActive($value=true){ 70 | $this->setProperty("class", ($value)?"active":""); 71 | } 72 | 73 | public function disable(){ 74 | $this->setProperty("class", "disabled"); 75 | } 76 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/phalcon/PhBsElement.php: -------------------------------------------------------------------------------- 1 | renderer->setName($name); 27 | } 28 | 29 | public function compile(JsUtils $js=NULL, &$view=NULL) { 30 | return $this->renderer->compile($js, $view); 31 | } 32 | 33 | public function run(JsUtils $js) { 34 | return $this->renderer->run($js); 35 | } 36 | 37 | public function setLabel($label) { 38 | return $this->renderer->setLabel($label); 39 | } 40 | 41 | /* 42 | * (non-PHPdoc) 43 | * @see \Phalcon\Forms\Element::setAttribute() 44 | */ 45 | public function setAttribute($attribute, $value) { 46 | return $this->renderer->setAttribute($attribute, $value); 47 | } 48 | 49 | public function getRenderer() { 50 | return $this->renderer; 51 | } 52 | 53 | public function setRenderer(PhBsRenderer $renderer) { 54 | $this->renderer=$renderer; 55 | return $this; 56 | } 57 | 58 | /* 59 | * (non-PHPdoc) 60 | * @see \Phalcon\Forms\ElementInterface::render() 61 | */ 62 | public function render($attributes=null) { 63 | $this->renderer->getElement()->setDefault($this->getValue()); 64 | return $this->renderer->render($attributes); 65 | } 66 | 67 | public function getHtmlElement() { 68 | return $this->renderer->getHtmlElement(); 69 | } 70 | 71 | public function setHtmlElement($htmlElement) { 72 | $this->renderer->setHtmlElement($htmlElement); 73 | return $this; 74 | } 75 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/phalcon/PhBsForm.php: -------------------------------------------------------------------------------- 1 | form=new HtmlForm($identifier); 20 | } 21 | 22 | /* 23 | * (non-PHPdoc) 24 | * @see \Phalcon\Forms\Form::add() 25 | */ 26 | public function add($element, $postion=null, $type=null) { 27 | parent::add($element, $postion, $type); 28 | } 29 | 30 | public function compile(JsUtils $js=NULL, &$view=NULL) { 31 | $result=""; 32 | foreach ( $this->_elements as $element ) { 33 | if ($element instanceof PhBsElement) 34 | $result.=$element->compile($js, $view); 35 | } 36 | return $result; 37 | } 38 | 39 | public function run(JsUtils $js) { 40 | foreach ( $this->_elements as $element ) { 41 | if ($element instanceof PhBsElement) 42 | $element->run($js); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/phalcon/PhBsRenderer.php: -------------------------------------------------------------------------------- 1 | element=$element; 24 | $this->htmlElement=$htmlElement; 25 | } 26 | 27 | public function setLabel($label) { 28 | $this->element->setLabel($label); 29 | $this->htmlElement->setLabel($label); 30 | return $this; 31 | } 32 | 33 | public function setName($name) { 34 | $this->element->setName($name); 35 | $this->htmlElement->setIdentifier($name); 36 | $this->htmlElement->setProperty("name", $name); 37 | } 38 | 39 | public function compile(JsUtils $js=NULL, &$view=NULL) { 40 | return $this->htmlElement->compile($js, $view); 41 | } 42 | 43 | public function run(JsUtils $js) { 44 | return $this->htmlElement->run($js); 45 | } 46 | 47 | public function setAttribute($attribute, $value) { 48 | $this->element->setAttribute($attribute, $value); 49 | return $this->htmlElement->setProperty($attribute, $value); 50 | } 51 | 52 | public function render($attributes=null) { 53 | $attrs=$this->element->getAttributes(); 54 | foreach ( $attrs as $key => $value ) { 55 | $this->htmlElement->setProperty($key, $value); 56 | } 57 | if (isset($attributes)) 58 | $this->htmlElement->addProperties($attributes); 59 | $this->htmlElement->setIdentifier($this->element->getName()); 60 | $this->htmlElement->setValue($this->element->getValue()); 61 | 62 | return $this->htmlElement->compile(); 63 | } 64 | 65 | public function getHtmlElement() { 66 | return $this->htmlElement; 67 | } 68 | 69 | public function setHtmlElement($htmlElement) { 70 | $this->htmlElement=$htmlElement; 71 | return $this; 72 | } 73 | 74 | public function getElement() { 75 | return $this->element; 76 | } 77 | 78 | public function setElement(Element $element) { 79 | $this->element=$element; 80 | return $this; 81 | } 82 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/phalcon/PhBsSelect.php: -------------------------------------------------------------------------------- 1 | setTagName("select"); 16 | $this->renderer=new PhBsRenderer(new Select($name, array (), $attributes), $list); 17 | $this->setOptions($options); 18 | } 19 | 20 | /** 21 | * Set the choice’s options 22 | * @param mixed $options array of options to add 23 | */ 24 | public function setOptions($options) { 25 | $this->renderer->getElement()->setOptions($options); 26 | $this->renderer->getHtmlElement()->setOptions($options); 27 | } 28 | 29 | /** 30 | * Adds an option to the current options 31 | * @param mixed $option option to add 32 | */ 33 | public function addOption($option) { 34 | $this->renderer->getElement()->addOption($option); 35 | $this->renderer->getHtmlElement()->addOption($option); 36 | } 37 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/phalcon/PhBsText.php: -------------------------------------------------------------------------------- 1 | renderer=new PhBsRenderer(new Text($name, $attributes), new HtmlInput($name)); 19 | } 20 | } -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplCarousel.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 8 | 9 | 10 | 13 | 14 | 15 | %leftControl% 16 | %rightControl% 17 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplCarouselControl.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | %caption% 6 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplCarouselItem.php: -------------------------------------------------------------------------------- 1 | 4 | %imageAlt% 5 | 8 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplDropdown.php: -------------------------------------------------------------------------------- 1 | 3 | <%tagName% id="%identifier%" class="%class%" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 4 | %btnCaption% 5 | 6 | 7 | 10 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplInputgroup.php: -------------------------------------------------------------------------------- 1 | 3 | %addonLeft% 4 | 5 | %addonRight% 6 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplModal.php: -------------------------------------------------------------------------------- 1 | 3 | 17 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplNavbar.php: -------------------------------------------------------------------------------- 1 | 4 |
5 | 6 | 15 | 16 | 17 | 20 |
21 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplPanel.php: -------------------------------------------------------------------------------- 1 | 3 | %header% 4 | %collapseBegin% 5 |
6 | %content% 7 |
8 | %footer% 9 | %collapseEnd% 10 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplProgressbar.php: -------------------------------------------------------------------------------- 1 | 4 | %caption% 5 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/html/templates/tplSplitbutton.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 | '; -------------------------------------------------------------------------------- /Ajax/bootstrap/js/Draggable.php: -------------------------------------------------------------------------------- 1 | mask="$('%identifier%').draggable({ handle: '.modal-header' });"; 11 | } 12 | } -------------------------------------------------------------------------------- /Ajax/common/BaseEnum.php: -------------------------------------------------------------------------------- 1 | getConstants(); 22 | } 23 | return self::$constCacheArray[$calledClass]; 24 | } 25 | 26 | public static function getConstantValues($postFix="",$prefixBefore=false) { 27 | if ($postFix == "") 28 | return \array_values(self::getConstants()); 29 | else { 30 | if($prefixBefore===false){ 31 | return \array_map(function ($elem) use($postFix) { 32 | return $elem . " " . $postFix; 33 | }, \array_values(self::getConstants())); 34 | }else{ 35 | return \array_map(function ($elem) use($postFix) { 36 | return $postFix." ".$elem; 37 | }, \array_values(self::getConstants())); 38 | } 39 | } 40 | } 41 | 42 | public static function isValidName($name, $strict=false) { 43 | $constants=self::getConstants(); 44 | 45 | if ($strict) { 46 | return array_key_exists($name, $constants); 47 | } 48 | 49 | $keys=array_map('strtolower', array_keys($constants)); 50 | return in_array(strtolower($name), $keys); 51 | } 52 | 53 | public static function isValidValue($value) { 54 | $values=array_values(self::getConstants()); 55 | return in_array($value, $values, true); 56 | } 57 | } -------------------------------------------------------------------------------- /Ajax/common/BaseGui.php: -------------------------------------------------------------------------------- 1 | autoCompile=$autoCompile; 30 | $this->components=array (); 31 | $this->htmlComponents=array (); 32 | } 33 | 34 | public function isAutoCompile() { 35 | return $this->autoCompile; 36 | } 37 | 38 | public function setAutoCompile($autoCompile) { 39 | $this->autoCompile=$autoCompile; 40 | return $this; 41 | } 42 | 43 | public function compile($internal=false) { 44 | if ($internal===false&&$this->autoCompile===true) 45 | throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); 46 | foreach ( $this->components as $component ) { 47 | $component->compile(); 48 | } 49 | } 50 | 51 | public function setJs(JsUtils $js) { 52 | $this->js=$js; 53 | } 54 | 55 | public function addComponent(SimpleComponent $component, $attachTo, $params) { 56 | if ($this->autoCompile) 57 | $this->components []=$component; 58 | if (isset($attachTo)) 59 | $component->attach($attachTo); 60 | if (isset($params)) 61 | if (is_array($params)) 62 | $component->setParams($params); 63 | return $component; 64 | } 65 | 66 | public function addHtmlComponent($htmlComponent) { 67 | $this->htmlComponents []=$htmlComponent; 68 | return $htmlComponent; 69 | } 70 | 71 | public function compileHtml(JsUtils $js=NULL, &$view=NULL) { 72 | foreach ( $this->htmlComponents as $htmlComponent ) { 73 | $htmlComponent->compile($js, $view); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/common/components/BaseComponent.php: -------------------------------------------------------------------------------- 1 | js=$js; 24 | } 25 | 26 | protected function getParamsAsJSON($params) { 27 | $result=""; 28 | if (sizeof($params)>0) { 29 | $result=json_encode($params, JSON_UNESCAPED_SLASHES); 30 | $result=str_ireplace("%quote%", "\"", $result); 31 | } 32 | return $result; 33 | } 34 | 35 | public function setParam($key, $value) { 36 | $this->params [$key]=$value; 37 | return $this; 38 | } 39 | 40 | public function getParam($key) { 41 | $value=null; 42 | if (array_key_exists($key, $this->params)) 43 | $value=$this->params [$key]; 44 | return $value; 45 | } 46 | 47 | public function getParams() { 48 | return $this->params; 49 | } 50 | 51 | public function compile(JsUtils $js=NULL) { 52 | if ($js==NULL) 53 | $js=$this->js; 54 | $script=$this->getScript(); 55 | $js->addToCompile($script); 56 | } 57 | 58 | protected function setParamCtrl($key, $value, $typeCtrl) { 59 | if (is_array($typeCtrl)) { 60 | if (array_search($value, $typeCtrl)===false) 61 | throw new \Exception("La valeur passée a propriété `".$key."` ne fait pas partie des valeurs possibles : {".implode(",", $typeCtrl)."}"); 62 | } else { 63 | if (!$typeCtrl($value)) { 64 | throw new \Exception("La fonction ".$typeCtrl." a retourné faux pour l'affectation de la propriété ".$key); 65 | } 66 | } 67 | $this->setParam($key, $value); 68 | } 69 | 70 | public function setParams($params) { 71 | foreach ( $params as $k => $v ) { 72 | $method="set".ucfirst($k); 73 | if (method_exists($this, $method)) 74 | $this->$method($v); 75 | else { 76 | $this->setParam($k, $v); 77 | trigger_error("`".$k."` property n'existe pas", E_USER_NOTICE); 78 | } 79 | } 80 | 81 | return $this; 82 | } 83 | 84 | abstract public function getScript(); 85 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/common/components/SimpleExtComponent.php: -------------------------------------------------------------------------------- 1 | events [$event]=$jsCode; 14 | } 15 | 16 | public function getScript() { 17 | parent::getScript(); 18 | foreach ( $this->jsCodes as $jsCode ) { 19 | $this->jquery_code_for_compile []=$jsCode->compile(array ( 20 | "identifier" => $this->attachTo 21 | )); 22 | } 23 | return $this->compileJQueryCode(); 24 | } 25 | 26 | public function addCode($jsCode) { 27 | $this->jsCodes []=new JsCode($jsCode); 28 | } 29 | } -------------------------------------------------------------------------------- /Ajax/common/html/BaseWidget.php: -------------------------------------------------------------------------------- 1 | identifier=$this->cleanIdentifier($identifier); 15 | } 16 | 17 | public function getIdentifier() { 18 | return $this->identifier; 19 | } 20 | 21 | public function setIdentifier($identifier) { 22 | $this->identifier=$identifier; 23 | return $this; 24 | } 25 | 26 | protected function cleanIdentifier($id) { 27 | return preg_replace('/[^a-zA-Z0-9\-.]/s', '', $id); 28 | } 29 | } -------------------------------------------------------------------------------- /Ajax/common/html/HtmlDoubleElement.php: -------------------------------------------------------------------------------- 1 | _template="<%tagName% id='%identifier%' %properties%>%wrapContentBefore%%content%%wrapContentAfter%"; 19 | } 20 | 21 | public function setContent($content) { 22 | $this->content=$content; 23 | return $this; 24 | } 25 | 26 | public function getContent() { 27 | return $this->content; 28 | } 29 | 30 | public function addContent($content,$before=false) { 31 | if (is_array($this->content)===false) { 32 | if(isset($this->content)) 33 | $this->content=array ($this->content); 34 | else 35 | $this->content=array(); 36 | } 37 | if($before) 38 | array_unshift($this->content,$content); 39 | else 40 | $this->content []=$content; 41 | return $this; 42 | } 43 | 44 | /* 45 | * (non-PHPdoc) 46 | * @see \Ajax\bootstrap\html\HtmlSingleElement::run() 47 | */ 48 | public function run(JsUtils $js) { 49 | parent::run($js); 50 | if ($this->content instanceof HtmlDoubleElement) { 51 | $this->content->run($js); 52 | } else if (is_array($this->content)) { 53 | foreach ( $this->content as $itemContent ) { 54 | if ($itemContent instanceof HtmlDoubleElement) { 55 | $itemContent->run($js); 56 | } 57 | } 58 | } 59 | } 60 | 61 | public function setValue($value) { 62 | } 63 | 64 | public function wrapContent($before, $after="") { 65 | $this->wrapContentBefore.=$before; 66 | $this->wrapContentAfter=$after.$this->wrapContentAfter; 67 | return $this; 68 | } 69 | } -------------------------------------------------------------------------------- /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 setRole($value) { 24 | $this->setProperty("role", $value); 25 | return $this; 26 | } 27 | 28 | public function setTitle($value) { 29 | $this->setProperty("title", $value); 30 | return $this; 31 | } 32 | 33 | /* 34 | * (non-PHPdoc) 35 | * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run() 36 | */ 37 | public function run(JsUtils $js) { 38 | 39 | } 40 | 41 | /* 42 | * (non-PHPdoc) 43 | * @see \Ajax\bootstrap\html\BaseHtml::fromArray() 44 | */ 45 | public function fromArray($array) { 46 | $array=parent::fromArray($array); 47 | foreach ( $array as $key => $value ) { 48 | $this->setProperty($key, $value); 49 | } 50 | return $array; 51 | } 52 | 53 | public function setSize($size) { 54 | } 55 | } -------------------------------------------------------------------------------- /Ajax/common/html/PropertyWrapper.php: -------------------------------------------------------------------------------- 1 | 0) { 16 | if (self::containsElement($input) === false) { 17 | $output=self::wrapStrings($input, $js, $separator=' ', $valueQuote='"'); 18 | } else { 19 | $output=self::wrapObjects($input, $js, $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) === true || \is_array($v)) 29 | return true; 30 | } 31 | return false; 32 | } 33 | 34 | public static function wrapStrings($input, $js, $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, array_values($input)); 41 | } 42 | return $result; 43 | } 44 | 45 | public static function wrapObjects($input, $js=NULL, $separator=' ', $valueQuote='"') { 46 | return implode($separator, array_map(function ($v) use($js, $separator, $valueQuote) { 47 | if (is_object($v)) 48 | return $v->compile($js); 49 | elseif (\is_array($v)) { 50 | return self::wrap($v, $js, $separator, $valueQuote); 51 | } else 52 | return $v; 53 | }, $input)); 54 | } 55 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlInput.php: -------------------------------------------------------------------------------- 1 | setProperty("name", $identifier); 13 | $this->setValue($value); 14 | $this->setPlaceholder($placeholder); 15 | $this->setProperty("type", $type); 16 | } 17 | 18 | public function setValue($value) { 19 | if(isset($value)) 20 | $this->setProperty("value", $value); 21 | return $this; 22 | } 23 | 24 | public function setInputType($value) { 25 | return $this->setProperty("type", $value); 26 | } 27 | 28 | public function setPlaceholder($value){ 29 | if(JString::isNull($value)){ 30 | if(JString::isNotNull($this->identifier)) 31 | $value=\ucfirst($this->identifier); 32 | } 33 | if(JString::isNotNull($value)) 34 | $this->setProperty("placeholder", $value); 35 | return $this; 36 | } 37 | } -------------------------------------------------------------------------------- /Ajax/common/html/html5/HtmlLinkTrait.php: -------------------------------------------------------------------------------- 1 | setProperty("href", $value); 9 | } 10 | 11 | public function getHref() { 12 | return $this->getProperty("href"); 13 | } 14 | 15 | public function setTarget($value="_self") { 16 | return $this->setProperty("target", $value); 17 | } 18 | // TODO use Class Tag 19 | } -------------------------------------------------------------------------------- /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 \Ajax\common\html\html5\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 | } -------------------------------------------------------------------------------- /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/common/html/html5/HtmlTextarea.php: -------------------------------------------------------------------------------- 1 | setValue($value); 13 | $this->setPlaceholder($placeholder); 14 | if(isset($rows)) 15 | $this->setRows($rows); 16 | } 17 | public function setValue($value) { 18 | if(isset($value)) 19 | $this->setContent($value); 20 | return $this; 21 | } 22 | 23 | public function setPlaceholder($value){ 24 | if(JString::isNotNull($value)) 25 | $this->setProperty("placeholder", $value); 26 | return $this; 27 | } 28 | 29 | public function setRows($count){ 30 | $this->setProperty("rows", $count); 31 | } 32 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/lib/CDNBase.php: -------------------------------------------------------------------------------- 1 | data=include 'CDN.php'; 16 | $this->version=$version; 17 | $this->provider=$provider; 18 | $this->local=false; 19 | $this->jsUrl=null; 20 | } 21 | 22 | public function getJsUrl() { 23 | return $this->jsUrl; 24 | } 25 | 26 | public function setJsUrl($jsUrl, $local=null) { 27 | $this->jsUrl=$jsUrl; 28 | if (isset($local)===false) { 29 | $local=PhalconUtils::startsWith($jsUrl, "http")===false; 30 | } 31 | $this->setLocal($local); 32 | return $this; 33 | } 34 | 35 | protected function getUrlOrCss($element, $key) { 36 | if (isset($element)) 37 | return $element; 38 | $version=$this->version; 39 | if (array_search($version, $this->getVersions())===false) 40 | $version=$this->getLastVersion(); 41 | return $this->replaceVersion($this->data [$this->provider] [$key], $version); 42 | } 43 | 44 | public function isLocal() { 45 | return $this->local; 46 | } 47 | 48 | public function setLocal($local) { 49 | $this->local=$local; 50 | return $this; 51 | } 52 | 53 | protected function replaceVersion($url, $version) { 54 | return str_ireplace("%version%", $version, $url); 55 | } 56 | 57 | protected function replaceTheme($url, $theme) { 58 | return str_ireplace("%theme%", $theme, $url); 59 | } 60 | 61 | protected function replaceVersionAndTheme($url, $version, $theme) { 62 | if (isset($theme)) 63 | return str_ireplace(array ( 64 | "%theme%", 65 | "%version%" 66 | ), array ( 67 | $theme, 68 | $version 69 | ), $url); 70 | else 71 | return $this->replaceVersion($url, $version); 72 | } 73 | 74 | public function getProviders() { 75 | return array_keys($this->data); 76 | } 77 | 78 | public function getVersions($provider=NULL) { 79 | if (isset($provider)) 80 | return $this->data [$provider] ["versions"]; 81 | else 82 | return $this->data [$this->provider] ["versions"]; 83 | } 84 | 85 | public function getLastVersion($provider=NULL) { 86 | return $this->getVersions($provider)[0]; 87 | } 88 | 89 | abstract public function getUrl(); 90 | } -------------------------------------------------------------------------------- /Ajax/lib/CDNCoreCss.php: -------------------------------------------------------------------------------- 1 | framework=$framework; 15 | $this->data=$this->data [$framework]; 16 | } 17 | 18 | public function getUrl() { 19 | return $this->getUrlOrCss($this->jsUrl, "core"); 20 | } 21 | 22 | public function getCss() { 23 | return $this->getUrlOrCss($this->cssUrl, "css"); 24 | } 25 | 26 | public function __toString() { 27 | $url=$this->getUrl(); 28 | $css=$this->getCss(); 29 | return PhalconUtils::javascriptInclude($url, $this->local)."\n".PhalconUtils::stylesheetLink($css, $this->localCss); 30 | ; 31 | } 32 | 33 | public function setCssUrl($cssUrl, $local=null) { 34 | $this->cssUrl=$cssUrl; 35 | if (isset($local)===false) { 36 | $local=PhalconUtils::startsWith($cssUrl, "http")===false; 37 | } 38 | $this->setLocalCss($local); 39 | return $this; 40 | } 41 | 42 | public function getLocalCss() { 43 | return $this->localCss; 44 | } 45 | 46 | public function setLocalCss($localCss) { 47 | $this->localCss=$localCss; 48 | return $this; 49 | } 50 | 51 | public function getFramework() { 52 | return $this->framework; 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /Ajax/lib/CDNGuiGen.php: -------------------------------------------------------------------------------- 1 | data=$this->data ["JQueryUI"]; 15 | if (is_int($theme)) { 16 | $themes=$this->getThemes(); 17 | if (sizeof($themes)>$theme-1) 18 | $this->theme=$themes [$theme-1]; 19 | else 20 | throw new \Exception("CDNGuiGen : Le numéro de thème demandé n'existe pas"); 21 | } 22 | $this->theme=$theme; 23 | $this->cssUrl=null; 24 | } 25 | 26 | public function getCssUrl() { 27 | return $this->cssUrl; 28 | } 29 | 30 | public function getThemes($provider=NULL) { 31 | if (isset($provider)) 32 | return $this->data [$provider] ["themes"]; 33 | else 34 | return $this->data [$this->provider] ["themes"]; 35 | } 36 | 37 | public function getFirstTheme($provider=NULL) { 38 | $themes=$this->getThemes($provider); 39 | if (sizeof($themes)>0) 40 | return $themes [0]; 41 | return ""; 42 | } 43 | 44 | public function getUrl() { 45 | return $this->getUrlOrCss($this->jsUrl, "core"); 46 | } 47 | 48 | public function getCss() { 49 | if (isset($this->cssUrl)) 50 | return $this->cssUrl; 51 | $version=$this->version; 52 | if (array_search($version, $this->getVersions())===false) 53 | $version=$this->getLastVersion(); 54 | $theme=$this->theme; 55 | if (array_search($theme, $this->getThemes())===false) 56 | $theme=$this->getFirstTheme(); 57 | return $this->replaceVersionAndTheme($this->data [$this->provider] ["css"], $version, $theme); 58 | } 59 | 60 | public function __toString() { 61 | $url=$this->getUrl(); 62 | $css=$this->getCss(); 63 | return PhalconUtils::javascriptInclude($url, $this->local)."\n".PhalconUtils::stylesheetLink($css, $this->localCss); 64 | } 65 | 66 | public function setCssUrl($cssUrl, $local=null) { 67 | $this->cssUrl=$cssUrl; 68 | if (isset($local)===false) { 69 | $local=PhalconUtils::startsWith($cssUrl, "http")===false; 70 | } 71 | $this->setLocalCss($local); 72 | return $this; 73 | } 74 | 75 | public function getLocalCss() { 76 | return $this->localCss; 77 | } 78 | 79 | public function setLocalCss($localCss) { 80 | $this->localCss=$localCss; 81 | return $this; 82 | } 83 | } -------------------------------------------------------------------------------- /Ajax/lib/CDNJQuery.php: -------------------------------------------------------------------------------- 1 | data=$this->data ["JQuery"]; 12 | } 13 | 14 | public function getUrl() { 15 | return $this->getUrlOrCss($this->jsUrl, "url"); 16 | } 17 | 18 | public function __toString() { 19 | $url=$this->getUrl(); 20 | return PhalconUtils::javascriptInclude($url, $this->local); 21 | } 22 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/php/symfony/JsUtils.php: -------------------------------------------------------------------------------- 1 | getInjected(); 13 | if(isset($router)===true){ 14 | try { 15 | $url=$router->generate($url); 16 | }catch (\Exception $e){ 17 | return $router->getContext()->getBaseUrl(); 18 | } 19 | } 20 | return $url; 21 | } 22 | public function addViewElement($identifier,$content,&$view){ 23 | if(\array_key_exists("q", $view)===false){ 24 | $view["q"]=array(); 25 | } 26 | $view["q"][$identifier]=$content; 27 | } 28 | 29 | public function createScriptVariable(&$view,$view_var, $output){ 30 | $view[$view_var]=$output; 31 | } 32 | 33 | /** 34 | * @param Symfony\Component\DependencyInjection\ContainerInterface $initialControllerInstance 35 | * @param string $controllerName 36 | * @param string $actionName 37 | * @param array $params 38 | * @see \Ajax\JsUtils::forward() 39 | */ 40 | public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ 41 | $path=$params; 42 | $request = $initialControllerInstance->get('request_stack')->getCurrentRequest(); 43 | $path['_forwarded'] = $request->attributes; 44 | $path['_controller'] = $controllerName.":".$actionName; 45 | $subRequest = $request->duplicate([], null, $path); 46 | $response= $initialControllerInstance->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); 47 | return $response->getContent(); 48 | } 49 | 50 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { 51 | if ($initialControllerInstance->has('templating')) { 52 | return $initialControllerInstance->get('templating')->render($viewName, $params); 53 | } 54 | 55 | if (!$initialControllerInstance->has('twig')) { 56 | throw new \LogicException('You can not use the "renderView" method if the Templating Component or the Twig Bundle are not available.'); 57 | } 58 | 59 | return $initialControllerInstance->get('twig')->render($viewName, $params); 60 | } 61 | 62 | public function fromDispatcher($dispatcher){ 63 | $request = $dispatcher->get('request_stack')->getCurrentRequest(); 64 | $uri=$request->getPathInfo(); 65 | if(JString::startswith($uri, "/")){ 66 | $uri=\substr($uri, 1); 67 | } 68 | return \explode("/", $uri); 69 | } 70 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Accordion.php: -------------------------------------------------------------------------------- 1 | uiName="accordion"; 13 | } 14 | 15 | /** 16 | * 17 | * @param string $value default : click 18 | * @return $this 19 | */ 20 | public function setOn($value="click") { 21 | return $this->setParam("on", $value); 22 | } 23 | 24 | public function setExclusive($value=true) { 25 | return $this->setParam("exclusive", $value); 26 | } 27 | 28 | //TODO other events implementation 29 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Checkbox.php: -------------------------------------------------------------------------------- 1 | uiName="checkbox"; 13 | } 14 | //TODO other events implementation 15 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Dimmer.php: -------------------------------------------------------------------------------- 1 | uiName="dimmer"; 13 | } 14 | 15 | public function setOn($value=false) { 16 | $this->params["on"]=$value; 17 | } 18 | 19 | public function setOpacity($value) { 20 | $this->params["opacity"]=$value; 21 | } 22 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Dropdown.php: -------------------------------------------------------------------------------- 1 | uiName="dropdown"; 13 | } 14 | 15 | /** 16 | * Sets a default action to occur 17 | * @param string $action 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("select","auto","activate","combo","nothing","hide")); 22 | } 23 | 24 | /** 25 | * Define the event which trigger dropdown 26 | * @param string $event Event used to trigger dropdown (Hover, Click, Custom Event) 27 | * @return \Ajax\semantic\components\Dropdown 28 | */ 29 | public function setOn($event){ 30 | return $this->setParam("on", $event); 31 | } 32 | 33 | public function setFullTextSearch($value){ 34 | return $this->setParam("fullTextSearch", $value); 35 | } 36 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Modal.php: -------------------------------------------------------------------------------- 1 | uiName="modal"; 12 | } 13 | 14 | protected function setBehavior($name) { 15 | $this->paramParts[]=[$name]; 16 | return $this; 17 | } 18 | 19 | public function showDimmer(){ 20 | return $this->setBehavior("hide dimmer"); 21 | } 22 | 23 | public function setInverted(){ 24 | $this->params["inverted"]=true; 25 | } 26 | 27 | // TODO other events implementation 28 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Popup.php: -------------------------------------------------------------------------------- 1 | uiName="popup"; 13 | } 14 | 15 | /** 16 | * 17 | * @param string $value default : click 18 | * @return $this 19 | */ 20 | public function setOn($value="click") { 21 | return $this->setParam("on", $value); 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 setOnShow($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 | //TODO other events implementation 54 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Progress.php: -------------------------------------------------------------------------------- 1 | uiName="progress"; 13 | } 14 | 15 | public function setOnChange($jsCode) { 16 | return $this->params["onChange"]=$jsCode; 17 | } 18 | 19 | public function setText($values) { 20 | return $this->params["text"]=$values; 21 | } 22 | 23 | // TODO other events implementation 24 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Rating.php: -------------------------------------------------------------------------------- 1 | uiName="rating"; 13 | } 14 | //TODO other events implementation 15 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Search.php: -------------------------------------------------------------------------------- 1 | uiName="search"; 13 | } 14 | 15 | public function setSource($value) { 16 | $this->params["source"]=$value; 17 | return $this; 18 | } 19 | 20 | public function setType($type) { 21 | $this->params["type"]=$type; 22 | return $this; 23 | } 24 | 25 | public function setSearchFields($fields) { 26 | $this->params["searchFields"]=$fields; 27 | return $this; 28 | } 29 | 30 | public function setApiSettings($value) { 31 | $this->params["apiSettings"]=$value; 32 | return $this; 33 | } 34 | 35 | public function setOnSelect($jsCode) { 36 | $this->params["onSelect"]=$jsCode; 37 | return $this; 38 | } 39 | 40 | // TODO other events implementation 41 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/SimpleSemExtComponent.php: -------------------------------------------------------------------------------- 1 | paramParts=array(); 13 | } 14 | 15 | protected function generateParamParts(){ 16 | $results=[]; 17 | foreach ($this->paramParts as $paramPart){ 18 | $results[]="{$this->uiName}(".\implode(",", $paramPart).")"; 19 | } 20 | return \implode(".", $results); 21 | } 22 | 23 | public function getScript() { 24 | $allParams=$this->params; 25 | $this->jquery_code_for_compile=array (); 26 | $paramParts=""; 27 | if(\sizeof($this->paramParts)>0){ 28 | $paramParts=".".$this->generateParamParts(); 29 | } 30 | $this->jquery_code_for_compile []="$( \"".$this->attachTo."\" ).{$this->uiName}(".$this->getParamsAsJSON($allParams).")".$paramParts.";"; 31 | $this->compileEvents(); 32 | return $this->compileJQueryCode(); 33 | } 34 | 35 | public function setParamParts($paramParts) { 36 | $this->paramParts=$paramParts; 37 | return $this; 38 | } 39 | 40 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/Sticky.php: -------------------------------------------------------------------------------- 1 | uiName="sticky"; 13 | } 14 | 15 | /** 16 | * 17 | * @param string $value default : "" 18 | * @return $this 19 | */ 20 | public function setContext($value="") { 21 | return $this->setParam("context", $value); 22 | } 23 | //TODO other events implementation 24 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/jsTemplates/tplCheckedList.php: -------------------------------------------------------------------------------- 1 | fromDatabaseObject($object, $function); 11 | } 12 | } 13 | return $this; 14 | } 15 | 16 | protected abstract function fromDatabaseObject($object, $function); 17 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/search/ISearch.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 | } -------------------------------------------------------------------------------- /Ajax/semantic/components/search/SearchCategory.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 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/ClassModifier.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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/HtmlSemSingleElement.php: -------------------------------------------------------------------------------- 1 | _baseClass=$baseClass; 19 | $this->setClass($baseClass); 20 | } 21 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/CheckboxType.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", self::RED); 13 | } 14 | 15 | public static function setGreen(HtmlSemDoubleElement $e) { 16 | return $e->addToProperty("class", self::GREEN); 17 | } 18 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/Direction.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", $state, array ($state )); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/constants/StepStatus.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", "attached", array ("attached" )); 18 | } 19 | return $this->addToPropertyCtrl("class", $value . " attached", Side::getConstantValues("attached")); 20 | } 21 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/IconTrait.php: -------------------------------------------------------------------------------- 1 | _hasIcon===false){ 15 | $iconO=$icon; 16 | if(\is_string($icon)){ 17 | $iconO=new HtmlIcon("icon-".$this->identifier, $icon); 18 | } 19 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); 20 | $this->addContent($iconO,false); 21 | $this->_hasIcon=true; 22 | }else{ 23 | $iconO=$this->getIcon(); 24 | $iconO->setIcon($icon); 25 | $this->addToPropertyCtrl("class", $direction." icon", Direction::getConstantValues("icon")); 26 | } 27 | return $iconO; 28 | } 29 | 30 | public function getIcon(){ 31 | if(\is_array($this->content)){ 32 | foreach ($this->content as $item){ 33 | if($item instanceof HtmlIcon) 34 | return $item; 35 | } 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/LabeledIconTrait.php: -------------------------------------------------------------------------------- 1 | identifier, $icon); 20 | } 21 | if($labeled!==false){ 22 | $direction=($before===true)?Direction::LEFT:Direction::RIGHT; 23 | $this->addToProperty("class", $direction." labeled icon"); 24 | $this->tagName="div"; 25 | } 26 | $this->addContent($iconO,$before); 27 | return $iconO; 28 | } 29 | } -------------------------------------------------------------------------------- /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() { 28 | return $this->addState(State::DISABLED); 29 | } 30 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/base/traits/TextAlignmentTrait.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", $value,TextAlignment::getConstants()); 15 | } 16 | 17 | public function textCenterAligned(){ 18 | return $this->setTextAlignment(TextAlignment::CENTER); 19 | } 20 | 21 | public function textJustified(){ 22 | return $this->setTextAlignment(TextAlignment::JUSTIFIED); 23 | } 24 | 25 | public function textRightAligned(){ 26 | return $this->setTextAlignment(TextAlignment::RIGHT); 27 | } 28 | 29 | public function textLeftAligned(){ 30 | return $this->setTextAlignment(); 31 | } 32 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/HtmlFormCheckbox.php: -------------------------------------------------------------------------------- 1 | asSelect($identifier,$multiple), $label); 12 | } 13 | 14 | public function setItems($items){ 15 | return $this->getField()->setItems($items); 16 | } 17 | public function addItem($item,$value=NULL,$image=NULL){ 18 | return $this->getField()->addItem($item,$value,$image); 19 | } 20 | public static function multipleDropdown($identifier,$items=array(), $label=NULL,$value=NULL){ 21 | return new HtmlFormDropdown($identifier,$items,$label,$value,true); 22 | } 23 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/HtmlFormInput.php: -------------------------------------------------------------------------------- 1 | getField()->setProperty("readonly", ""); 19 | } 20 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/HtmlFormRadio.php: -------------------------------------------------------------------------------- 1 | getField()->setRows($count); 24 | } 25 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/traits/CheckboxTrait.php: -------------------------------------------------------------------------------- 1 | addToPropertyCtrl("class", $checkboxType, CheckboxType::getConstants()); 13 | } 14 | 15 | /** 16 | * Attach $this to $selector and fire $action 17 | * @param string $selector jquery selector of the associated element 18 | * @param string $action action to execute : check, uncheck or NULL for toggle 19 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox 20 | */ 21 | public function attachEvent($selector, $action=NULL) { 22 | return $this->getField()->attachEvent($selector, $action); 23 | } 24 | 25 | /** 26 | * Attach $this to an array of $action=>$selector 27 | * @param array $events associative array of events to attach ex : ["#bt-toggle","check"=>"#bt-check","uncheck"=>"#bt-uncheck"] 28 | * @return \Ajax\semantic\html\collections\form\AbstractHtmlFormRadioCheckbox 29 | */ 30 | public function attachEvents($events=array()) { 31 | return $this->getField()->attachEvents($events); 32 | } 33 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/traits/FieldsTrait.php: -------------------------------------------------------------------------------- 1 | fromArray($input); 29 | $fields[]=$f; 30 | } 31 | return $this->addFields($fields,$fieldslabel); 32 | } 33 | 34 | /** 35 | * @param string $identifier 36 | * @param array $items 37 | * @param string $label 38 | * @param string $value 39 | * @param boolean $multiple 40 | * @return \Ajax\common\html\HtmlDoubleElement 41 | */ 42 | public function addDropdown($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false){ 43 | return $this->addItem(new HtmlFormDropdown($identifier,$items,$label,$value,$multiple)); 44 | } 45 | 46 | public function addInput($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL){ 47 | return $this->addItem(new HtmlFormInput($identifier,$label,$type,$value,$placeholder)); 48 | } 49 | 50 | public function addPassword($identifier, $label=NULL){ 51 | return $this->addItem(new HtmlFormInput($identifier,$label,"password","","")); 52 | } 53 | 54 | public function addButton($identifier,$value,$cssStyle=NULL,$onClick=NULL){ 55 | return $this->addItem(new HtmlButton($identifier,$value,$cssStyle,$onClick)); 56 | } 57 | 58 | public function addCheckbox($identifier, $label=NULL,$value=NULL,$type=NULL){ 59 | return $this->addItem(new HtmlFormCheckbox($identifier,$label,$value,$type)); 60 | } 61 | 62 | public function addRadio($identifier, $name,$label=NULL,$value=NULL){ 63 | return $this->addItem(new HtmlFormRadio($identifier,$name,$label,$value)); 64 | } 65 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/form/traits/TextFieldsTrait.php: -------------------------------------------------------------------------------- 1 | getField()->setPlaceholder($value); 10 | } 11 | 12 | public function setValue($value){ 13 | return $this->getField()->setValue($value); 14 | } 15 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlAccordionMenu.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", "accordion"); 15 | $this->setVertical(); 16 | } 17 | 18 | /** 19 | * {@inheritDoc} 20 | * @see \Ajax\common\html\html5\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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlIconMenu.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", "icon"); 25 | } 26 | 27 | 28 | /** 29 | * {@inheritDoc} 30 | * @see \Ajax\semantic\html\collections\HtmlMenu::createItem() 31 | */ 32 | protected function createItem($value) { 33 | $count=\sizeof($this->content); 34 | $value=new HtmlIcon("icon-".$count, $value); 35 | $itemO=new HtmlLink("item-".$count,"",$value); 36 | return $itemO->setClass("item"); 37 | } 38 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlLabeledIconMenu.php: -------------------------------------------------------------------------------- 1 | addToProperty("class", "labeled icon"); 25 | } 26 | 27 | /** 28 | * {@inheritDoc} 29 | * @see \Ajax\semantic\html\collections\HtmlMenu::createItem() 30 | */ 31 | protected function createItem($value) { 32 | $text=""; 33 | $v=$value; 34 | if(\is_array($value)){ 35 | $v=@$value[0]; 36 | $text=@$value[1]; 37 | } 38 | $count=\sizeof($this->content); 39 | $value=new HtmlIcon("icon-".$count, $v); 40 | $value->wrap("",$text); 41 | $itemO=new HtmlLink("item-".$count,"",$value); 42 | return $itemO->setClass("item"); 43 | } 44 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/collections/menus/HtmlPaginationMenu.php: -------------------------------------------------------------------------------- 1 | insertItem(new HtmlIcon("", "left chevron")); 21 | $this->addItem(new HtmlIcon("", "right chevron")); 22 | $this->asPagination(); 23 | return parent::compile($js,$view); 24 | } 25 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlAbsractItem.php: -------------------------------------------------------------------------------- 1 | content=array(); 17 | $this->initContent($content); 18 | } 19 | 20 | protected abstract function initContent($content); 21 | 22 | public function setIcon($icon){ 23 | $this->content["icon"]=new HtmlIcon("icon-".$this->identifier, $icon); 24 | } 25 | 26 | public function setImage($image){ 27 | $image=new HtmlImg("icon-".$this->identifier, $image); 28 | $image->asAvatar(); 29 | $this->content["image"]=$image; 30 | } 31 | 32 | private function createContent(){ 33 | $this->content["content"]=new HtmlSemDoubleElement("content-".$this->identifier,"div","content"); 34 | return $this->content["content"]; 35 | } 36 | 37 | public function setTitle($title,$description=NULL,$baseClass="title"){ 38 | $title=new HtmlSemDoubleElement("","div",$baseClass,$title); 39 | if(\array_key_exists("content", $this->content)===false){ 40 | $this->createContent(); 41 | } 42 | $this->content["content"]->addContent($title); 43 | if(isset($description)){ 44 | $description=new HtmlSemDoubleElement("","div","description",$description); 45 | $this->content["content"]->addContent($description); 46 | } 47 | return $this; 48 | } 49 | 50 | public function getPart($partName="header"){ 51 | $content=\array_merge($this->content["content"]->getContent(),array(@$this->content["icon"],@$this->content["image"])); 52 | return $this->getElementByPropertyValue("class", $partName, $content); 53 | } 54 | 55 | public function setActive(){ 56 | $this->setTagName("div"); 57 | $this->removeProperty("href"); 58 | return $this->addToPropertyCtrl("class", "active", array("active")); 59 | } 60 | 61 | public function asLink($href=NULL,$part=NULL){ 62 | $this->setTagName("a"); 63 | if(isset($href)) 64 | $this->setProperty("href", $href); 65 | return $this; 66 | } 67 | 68 | /** 69 | * 70 | * {@inheritDoc} 71 | * 72 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() 73 | */ 74 | public function compile(JsUtils $js=NULL, &$view=NULL) { 75 | if(\is_array($this->content)) 76 | $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); 77 | return parent::compile($js, $view); 78 | } 79 | } -------------------------------------------------------------------------------- /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, &$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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlAccordionMenuItem.php: -------------------------------------------------------------------------------- 1 | content->setActive($value); 13 | return $this; 14 | } 15 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlGridCol.php: -------------------------------------------------------------------------------- 1 | setClass("column"); 23 | if (isset($width)) 24 | $this->setWidth($width); 25 | } 26 | 27 | /** 28 | * Defines the col width 29 | * @param int $width 30 | * @return \Ajax\semantic\html\content\HtmlGridCol 31 | */ 32 | public function setWidth($width) { 33 | if (\is_int($width)) { 34 | $width=Wide::getConstants()["W" . $width]; 35 | } 36 | $this->addToPropertyCtrl("class", $width, Wide::getConstants()); 37 | return $this->addToPropertyCtrl("class", "wide", array ("wide" )); 38 | } 39 | 40 | public function setValue($value) { 41 | $this->content=$value; 42 | return $this; 43 | } 44 | 45 | public function setValues($value) { 46 | return $this->setValue($value); 47 | } 48 | 49 | public function addDivider($vertical=true, $content=NULL) { 50 | $divider=new HtmlDivider("", $content); 51 | if ($vertical) 52 | $divider->setVertical(); 53 | else 54 | $divider->setHorizontal(); 55 | $this->wrap("", $divider); 56 | return $divider; 57 | } 58 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlListItem.php: -------------------------------------------------------------------------------- 1 | setIcon($icon); 30 | } 31 | if(isset($image)===true){ 32 | $this->setImage($image); 33 | } 34 | if(isset($title)===true){ 35 | $this->setTitle($title,$desc); 36 | }elseif (isset($header)===true){ 37 | $this->setTitle($header,$desc,"header"); 38 | } 39 | if(isset($items)===true){ 40 | $this->addList($items); 41 | } 42 | }else{ 43 | $this->setContent($content); 44 | } 45 | } 46 | public function addList($items=array()) { 47 | $list=new HtmlList("", $items); 48 | $list->setClass("list"); 49 | $this->content["list"]=$list; 50 | return $list; 51 | } 52 | 53 | public function getList(){ 54 | return $this->content["list"]; 55 | } 56 | 57 | public function getItem($index){ 58 | return $this->getList()->getItem($index); 59 | } 60 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlMenuItem.php: -------------------------------------------------------------------------------- 1 | setIcon($icon); 28 | } 29 | if(isset($title)===true){ 30 | $this->setTitle($title,$desc); 31 | } 32 | }else{ 33 | $this->setContent($content); 34 | } 35 | } 36 | /* public function addIcon($icon, $before=true) { 37 | $content=$this->content; 38 | $this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content"); 39 | $this->content->setContent($content); 40 | $this->content->addContent(new HtmlIcon("icon" . $this->identifier, $icon), $before); 41 | return $this; 42 | }*/ 43 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/HtmlStepItem.php: -------------------------------------------------------------------------------- 1 | setIcon($icon); 28 | } 29 | if(isset($status)===true){ 30 | $this->setStatus($status); 31 | } 32 | if(isset($title)===true){ 33 | $this->setTitle($title,$desc); 34 | } 35 | }else{ 36 | $this->setContent($content); 37 | } 38 | } 39 | 40 | public function setActive(){ 41 | return $this->setStatus(StepStatus::ACTIVE); 42 | } 43 | 44 | public function setCompleted(){ 45 | return $this->setStatus(StepStatus::COMPLETED); 46 | } 47 | 48 | public function setStatus($status){ 49 | return $this->addToPropertyCtrl("class", $status, StepStatus::getConstants()); 50 | } 51 | 52 | public function removeStatus(){ 53 | $this->removePropertyValues("class", StepStatus::getConstants()); 54 | } 55 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/InternalPopup.php: -------------------------------------------------------------------------------- 1 | semElement=$semElement; 16 | $this->title=$title; 17 | $this->content=$content; 18 | $this->setAttributes($variation,$params); 19 | } 20 | 21 | public function setHtml($html) { 22 | $this->html=$html; 23 | return $this; 24 | } 25 | 26 | public function setAttributes($variation=NULL,$params=array()){ 27 | $this->variation=$variation; 28 | $this->params=$params; 29 | } 30 | 31 | public function onShow($jsCode){ 32 | $this->params["onShow"]=$jsCode; 33 | } 34 | 35 | public function compile(){ 36 | if(JString::isNotNull($this->title)){ 37 | $this->semElement->addToProperty("data-title", $this->title); 38 | } 39 | if(JString::isNotNull($this->content)){ 40 | $this->semElement->addToProperty("data-content", $this->content); 41 | } 42 | if(JString::isNotNull($this->html)){ 43 | $this->semElement->addToProperty("data-html", $this->html); 44 | } 45 | if(JString::isNotNull($this->variation)){ 46 | $this->semElement->addToProperty("data-variation", $this->variation); 47 | } 48 | } 49 | 50 | public function run(JsUtils $js){ 51 | $js->semantic()->popup("#".$this->semElement->getIdentifier(),$this->params); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/content/card/HtmlCardHeaderContent.php: -------------------------------------------------------------------------------- 1 | setHeader($header); 16 | } 17 | $this->addMetas($metas); 18 | if (isset($description)) { 19 | $this->setDescription($description); 20 | } 21 | } 22 | 23 | public function setDescription($value) { 24 | $this->content["description"]=new HtmlSemDoubleElement("description-" . $this->identifier, "div", "description", $value); 25 | } 26 | 27 | public function setHeader($value) { 28 | $this->content["header"]=new HtmlSemDoubleElement("header-" . $this->identifier, "a", "header", $value); 29 | } 30 | 31 | /** 32 | * 33 | * {@inheritDoc} 34 | * 35 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() 36 | */ 37 | public function compile(JsUtils $js=NULL, &$view=NULL) { 38 | $this->content=JArray::sortAssociative($this->content, [ "image","header","meta","description" ]); 39 | return parent::compile($js, $view); 40 | } 41 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlContainer.php: -------------------------------------------------------------------------------- 1 | content=$content; 18 | } 19 | 20 | public function asText(){ 21 | return $this->addToProperty("class", "text"); 22 | } 23 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlDivider.php: -------------------------------------------------------------------------------- 1 | content=$content; 18 | } 19 | 20 | /** 21 | * vertical divider 22 | * @return \Ajax\semantic\html\elements\HtmlDivider 23 | */ 24 | public function setVertical() { 25 | return $this->addToPropertyCtrl("class", "vertical", array ("vertical","horizontal" )); 26 | } 27 | 28 | /** 29 | * horizontal divider 30 | * @return \Ajax\semantic\html\elements\HtmlDivider 31 | */ 32 | public function setHorizontal() { 33 | return $this->addToPropertyCtrl("class", "horizontal", array ("vertical","horizontal" )); 34 | } 35 | 36 | /** 37 | * hide the divider 38 | * @return \Ajax\semantic\html\elements\HtmlDivider 39 | */ 40 | public function setHidden() { 41 | return $this->addToProperty("class", "hidden"); 42 | } 43 | 44 | /** 45 | * fitted, without any space above or below it 46 | * @return \Ajax\semantic\html\elements\HtmlDivider 47 | */ 48 | public function setFitted() { 49 | return $this->addToProperty("class", "fitted"); 50 | } 51 | 52 | /** 53 | * 54 | * @return \Ajax\semantic\html\elements\HtmlDivider 55 | */ 56 | public function asHeader() { 57 | return $this->addToProperty("class", "header"); 58 | } 59 | 60 | /** 61 | * inverts the divider colors 62 | * @return \Ajax\semantic\html\elements\HtmlDivider 63 | */ 64 | public function setInverted() { 65 | return $this->addToProperty("class", "inverted"); 66 | } 67 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlFlag.php: -------------------------------------------------------------------------------- 1 | _template=''; 20 | $this->flag=$flag; 21 | } 22 | 23 | public function setFlag($flag) { 24 | $this->flag=$flag; 25 | } 26 | 27 | public static function France() { 28 | return new HtmlFlag("", Country::FRANCE); 29 | } 30 | 31 | public static function byNum($num) { 32 | return new HtmlFlag("", Country::getConstantValues()[$num]); 33 | } 34 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlIconGroups.php: -------------------------------------------------------------------------------- 1 | addItems($icons); 19 | $this->setSize($size); 20 | } 21 | 22 | protected function createItem($value) { 23 | $icon=$value; 24 | if (\is_array($value)) { 25 | $icon=JArray::getValue($value, "icon", 0); 26 | $size=JArray::getValue($value, "size", 1); 27 | } 28 | $iconO=new HtmlIcon("icon-" . $this->identifier, $icon); 29 | if (isset($size)) { 30 | $iconO->setSize($size); 31 | } 32 | return $iconO; 33 | } 34 | 35 | protected function createCondition($value) { 36 | return ($value instanceof HtmlIcon) === false; 37 | } 38 | 39 | public function getIcon($index) { 40 | return $this->content[$index]; 41 | } 42 | 43 | public function toCorner($index=1) { 44 | $this->getItem($index)->toCorner(); 45 | return $this; 46 | } 47 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlImage.php: -------------------------------------------------------------------------------- 1 | setClass(""); 14 | parent::__construct($identifier, "div", "ui image", $image); 15 | if (isset($size)) 16 | $this->setSize($size); 17 | } 18 | 19 | public function setCircular() { 20 | return $this->addToProperty("class", "circular"); 21 | } 22 | 23 | public function asAvatar($caption=NULL) { 24 | if (isset($caption)) 25 | $this->wrap("", $caption); 26 | return $this->addToProperty("class", "avatar"); 27 | } 28 | 29 | public static function small($identifier, $src="", $alt="") { 30 | return new HtmlImage($identifier, $src, $alt, Size::SMALL); 31 | } 32 | 33 | public static function avatar($identifier, $src="", $caption=NULL) { 34 | $img=new HtmlImage($identifier, $src); 35 | return $img->asAvatar($caption); 36 | } 37 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlLoader.php: -------------------------------------------------------------------------------- 1 | setElement(0, $visibleContent); 16 | $this->setElement(1, $hiddenContent); 17 | $this->setType($type,$attributeType); 18 | } 19 | 20 | private function setElement($index,$content){ 21 | if(!$content instanceof HtmlSingleElement){ 22 | $content=new HtmlLabel("",$content); 23 | } 24 | if($content instanceof HtmlSemDoubleElement){ 25 | $content=new HtmlSemDoubleElement($this->identifier."-".$index,"div","",$content); 26 | }elseif ($content instanceof HtmlImg){ 27 | $this->addToPropertyCtrl("class", "image", array("image")); 28 | } 29 | $content->addToProperty("class",(($index===0)?"visible":"hidden")." content"); 30 | $this->content[$index]=$content; 31 | return $this; 32 | } 33 | 34 | public function setVisibleContent($visibleContent){ 35 | return $this->setElement(0, $visibleContent); 36 | } 37 | 38 | public function setHiddenContent($hiddenContent){ 39 | return $this->setElement(1, $hiddenContent); 40 | } 41 | 42 | public function getVisibleContent(){ 43 | return $this->content[0]; 44 | } 45 | 46 | public function getHiddenContent(){ 47 | return $this->content[1]; 48 | } 49 | 50 | public function setType($type,$attribute=NULL){ 51 | $this->addToPropertyCtrl("class", $type, RevealType::getConstants()); 52 | if(isset($attribute)){ 53 | $this->addToPropertyCtrl("class", $attribute, Direction::getConstants()); 54 | } 55 | return $this; 56 | } 57 | 58 | public function setFade($attribute=NULL){ 59 | return $this->setType(RevealType::FADE,$attribute); 60 | } 61 | 62 | public function setMove($attribute=NULL){ 63 | return $this->setType(RevealType::MOVE,$attribute); 64 | } 65 | 66 | public function setRotate($attribute=NULL){ 67 | return $this->setType(RevealType::ROTATE,$attribute); 68 | } 69 | 70 | public function setCircular(){ 71 | return $this->addToProperty("class", "circular"); 72 | } 73 | 74 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlSegment.php: -------------------------------------------------------------------------------- 1 | _variations=\array_merge($this->_variations, [ Variation::PADDED,Variation::COMPACT ]); 26 | $this->_states=\array_merge($this->_states, [ State::LOADING ]); 27 | $this->content=$content; 28 | } 29 | 30 | /** 31 | * Defines the segment type 32 | * @param string $type one of "raised","stacked","piled" default : "" 33 | * @return \Ajax\semantic\html\elements\HtmlSegment 34 | */ 35 | public function setType($type) { 36 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); 37 | } 38 | 39 | public function setSens($sens="vertical") { 40 | return $this->addToPropertyCtrl("class", $sens, array ("vertical","horizontal" )); 41 | } 42 | 43 | public function setEmphasis($value=Emphasis::SECONDARY) { 44 | return $this->addToPropertyCtrl("class", $value, Emphasis::getConstants()); 45 | } 46 | 47 | public function setCircular() { 48 | return $this->addToProperty("class", "circular"); 49 | } 50 | 51 | public function clear() { 52 | return $this->addToProperty("class", "clearing"); 53 | } 54 | 55 | public function setCompact() { 56 | return $this->addToProperty("class", "compact"); 57 | } 58 | 59 | public function setBasic() { 60 | return $this->setProperty("class", "ui basic segment"); 61 | } 62 | 63 | public function asContainer() { 64 | return $this->addToPropertyCtrl("class", "container", array ("container" )); 65 | } 66 | 67 | public function addGrid($numRows=1, $numCols=NULL){ 68 | $grid=new HtmlGrid("Grid-".$this->identifier,$numRows,$numCols); 69 | $this->content=$grid; 70 | return $grid; 71 | } 72 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/HtmlSegmentGroups.php: -------------------------------------------------------------------------------- 1 | addItems($items); 15 | } 16 | 17 | 18 | protected function createItem($value){ 19 | return new HtmlSegment("segment-".$this->count(),$value); 20 | } 21 | 22 | protected function createCondition($value){ 23 | return !($value instanceof HtmlSegment); 24 | } 25 | 26 | /** 27 | * Defines the group type 28 | * @param string $type one of "raised","stacked","piled" default : "" 29 | * @return \Ajax\semantic\html\elements\HtmlSegmentGroups 30 | */ 31 | public function setType($type){ 32 | return $this->addToPropertyCtrl("class", $type, SegmentType::getConstants()); 33 | } 34 | 35 | public function setSens($sens=Sens::VERTICAL){ 36 | return $this->addToPropertyCtrl("class", $sens, Sens::getConstants()); 37 | } 38 | 39 | public static function group($identifier,$items=array(),$type="",$sens=Sens::VERTICAL){ 40 | $group=new HtmlSegmentGroups($identifier,$items); 41 | $group->setSens($sens); 42 | return $group->setType($type); 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/html5/HtmlImg.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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/elements/html5/HtmlLink.php: -------------------------------------------------------------------------------- 1 | setHref($href); 16 | $this->content=$content; 17 | } 18 | 19 | /* 20 | * (non-PHPdoc) 21 | * @see \Ajax\bootstrap\html\base\HtmlSingleElement::run() 22 | */ 23 | public function run(JsUtils $js) { 24 | $this->_bsComponent=$js->semantic()->generic("#" . $this->identifier); 25 | $this->addEventsOnRun($js); 26 | return $this->_bsComponent; 27 | } 28 | 29 | public function addIcon($icon, $before=true) { 30 | return $this->addContent(new HtmlIcon("icon-" . $this->identifier, $icon), $before); 31 | } 32 | 33 | public static function icon($identifier, $icon, $href="#", $label=NULL) { 34 | $result=new HtmlLink($identifier, $href, $label); 35 | return $result->addIcon($icon); 36 | } 37 | // TODO use Class Tag 38 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/HtmlDimmer.php: -------------------------------------------------------------------------------- 1 | setContent($content); 18 | $this->_inverted=false; 19 | } 20 | 21 | public function setContent($content) { 22 | $this->content=new HtmlSemDoubleElement("content-" . $this->identifier, "div", "content", new HtmlSemDoubleElement("", "div", "center", $content)); 23 | return $this; 24 | } 25 | 26 | public function asIcon($icon, $title, $subHeader=NULL) { 27 | $header=new HtmlHeader("header-" . $this->identifier); 28 | $header->asIcon($icon, $title, $subHeader); 29 | if ($this->_inverted === false) 30 | $header->setInverted(); 31 | return $this->setContent($header); 32 | } 33 | 34 | public function asPage() { 35 | return $this->addToProperty("class", "page"); 36 | } 37 | 38 | public function setInverted() { 39 | parent::setInverted(); 40 | $this->_inverted=true; 41 | return $this; 42 | } 43 | 44 | public function run(JsUtils $js) { 45 | if ($this->_container instanceof HtmlSingleElement) 46 | $this->_bsComponent=$js->semantic()->dimmer("#" . $this->_container->getIdentifier(), $this->_params); 47 | return parent::run($js); 48 | } 49 | 50 | public function jsShow() { 51 | if (isset($this->_container) === true) 52 | return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; 53 | } 54 | 55 | public function setBlurring() { 56 | return $this->addToProperty("class", "blurring"); 57 | } 58 | 59 | public function setParams($_params) { 60 | $this->_params=$_params; 61 | return $this; 62 | } 63 | 64 | public function setContainer($_container) { 65 | $this->_container=$_container; 66 | return $this; 67 | } 68 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/HtmlPopup.php: -------------------------------------------------------------------------------- 1 | _container=$container; 18 | $this->setClass("ui popup"); 19 | $this->content=$content; 20 | $this->_params=array("on"=>"hover"); 21 | } 22 | 23 | public function addList($items=array(),$header=NULL){ 24 | if(!$this->content instanceof HtmlGrid){ 25 | $this->content=new HtmlGrid("Grid-".$this->identifier,0); 26 | } 27 | $grid=$this->content; 28 | 29 | $colCount=$grid->colCount(); 30 | $colCount++; 31 | $grid->setColsCount($colCount); 32 | 33 | $list=new HtmlList("",$items); 34 | $list->asLink(); 35 | if(isset($header)){ 36 | $list->addHeader(4,$header); 37 | } 38 | $grid->getCell(0,$colCount-1)->setContent($list); 39 | $grid->setDivided()->setRelaxed(true); 40 | return $list; 41 | } 42 | 43 | /** 44 | * A popup can have no maximum width and continue to flow to fit its content 45 | */ 46 | public function setFlowing(){ 47 | return $this->addToProperty("class", "flowing"); 48 | } 49 | 50 | /** 51 | * A popup can provide more basic formatting 52 | */ 53 | public function setBasic(){ 54 | return $this->addToProperty("class", "basic"); 55 | } 56 | 57 | /** 58 | * {@inheritDoc} 59 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() 60 | */ 61 | public function run(JsUtils $js){ 62 | $this->_params["popup"]="#".$this->identifier; 63 | $js->semantic()->popup("#".$this->_container->getIdentifier(),$this->_params); 64 | } 65 | 66 | public function setOn($event="click"){ 67 | $this->_params["on"]=$event; 68 | return $this; 69 | } 70 | 71 | public function setInline($value=true){ 72 | $this->_params["inline"]=$value; 73 | return $this; 74 | } 75 | 76 | public function setPosition($position){ 77 | $this->_params["position"]=$position; 78 | return $this; 79 | } 80 | } -------------------------------------------------------------------------------- /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 \Ajax\semantic\html\base\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 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/HtmlSticky.php: -------------------------------------------------------------------------------- 1 | setContext($context); 15 | } 16 | 17 | public function setContext($context){ 18 | $this->_params["context"]=$context; 19 | return $this; 20 | } 21 | 22 | /** 23 | * {@inheritDoc} 24 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run() 25 | */ 26 | public function run(JsUtils $js){ 27 | parent::run($js); 28 | return $js->semantic()->sticky("#".$this->identifier,$this->_params); 29 | } 30 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/checkbox/HtmlCheckbox.php: -------------------------------------------------------------------------------- 1 | setType($checkboxType); 14 | } 15 | } 16 | 17 | public static function slider($identifier, $label="", $value=NULL) { 18 | return new HtmlCheckbox($identifier, $label, $value, CheckboxType::SLIDER); 19 | } 20 | 21 | public static function toggle($identifier, $label="", $value=NULL) { 22 | return new HtmlCheckbox($identifier, $label, $value, CheckboxType::TOGGLE); 23 | } 24 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/modules/checkbox/HtmlRadio.php: -------------------------------------------------------------------------------- 1 | setType($checkboxType); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /Ajax/semantic/html/templates/tplDropdown.php: -------------------------------------------------------------------------------- 1 | 3 | %input% 4 | %content% 5 | <%mTagName% class="%mClass%"> 6 | %items% 7 | 8 | '; -------------------------------------------------------------------------------- /Ajax/semantic/html/templates/tplDropdownMenu.php: -------------------------------------------------------------------------------- 1 | 3 | %input% 4 | %items% 5 | '; -------------------------------------------------------------------------------- /Ajax/semantic/html/views/HtmlCardGroups.php: -------------------------------------------------------------------------------- 1 | addItems($cards); 14 | } 15 | 16 | protected function createItem($value) { 17 | $result=new HtmlCard("card-" . $this->count()); 18 | if (\is_array($value)) { 19 | $header=JArray::getValue($value, "header", 0); 20 | $metas=JArray::getValue($value, "metas", 1); 21 | $description=JArray::getValue($value, "description", 2); 22 | $image=JArray::getValue($value, "image", 3); 23 | $extra=JArray::getValue($value, "extra", 4); 24 | if (isset($image)) { 25 | $result->addImage($image); 26 | } 27 | $result->addCardHeaderContent($header, $metas, $description); 28 | if (isset($extra)) { 29 | $result->addExtraContent($extra); 30 | } 31 | } else 32 | $result->addCardContent($value); 33 | return $result; 34 | } 35 | 36 | /** 37 | * Defines the cards width (alias for setWidth) 38 | * @param int $wide 39 | */ 40 | public function setWide($wide) { 41 | $wide=Wide::getConstants()["W" . $wide]; 42 | return $this->addToPropertyCtrl("class", $wide, Wide::getConstants()); 43 | } 44 | 45 | public function newCard($identifier) { 46 | return new HtmlCard($identifier); 47 | } 48 | 49 | public function getCard($index) { 50 | return $this->getItem($index); 51 | } 52 | 53 | public function getCardContent($cardIndex, $contentIndex) { 54 | $card=$this->getItem($cardIndex); 55 | if (isset($card)) { 56 | return $card->getCardContent($contentIndex); 57 | } 58 | } 59 | 60 | public function fromDatabaseObject($object, $function) { 61 | return $this->addItem($function($object)); 62 | } 63 | } -------------------------------------------------------------------------------- /Ajax/semantic/traits/SemanticHtmlCollectionsTrait.php: -------------------------------------------------------------------------------- 1 | addHtmlComponent(new HtmlTable($identifier, $rowCount, $colCount)); 18 | } 19 | } -------------------------------------------------------------------------------- /Ajax/semantic/traits/SemanticHtmlModulesTrait.php: -------------------------------------------------------------------------------- 1 | addHtmlComponent(new HtmlFormCheckbox($identifier, $label, $value, $type)); 28 | } 29 | 30 | /** 31 | * 32 | * @param string $identifier 33 | * @param int $rowCount 34 | * @param int $colCount 35 | * @return HtmlRating 36 | */ 37 | public function htmlRating($identifier, $value, $max, $icon="") { 38 | return $this->addHtmlComponent(new HtmlRating($identifier, $value, $max, $icon)); 39 | } 40 | 41 | /** 42 | * 43 | * @param string $identifier 44 | * @param int $value 45 | * @param string $label 46 | * @return HtmlProgress 47 | */ 48 | public function htmlProgress($identifier, $value=0, $label=NULL) { 49 | return $this->addHtmlComponent(new HtmlProgress($identifier, $value, $label)); 50 | } 51 | 52 | /** 53 | * 54 | * @param string $identifier 55 | * @param string $placeholder 56 | * @return HtmlSearch 57 | */ 58 | public function htmlSearch($identifier, $placeholder=NULL, $icon=NULL) { 59 | return $this->addHtmlComponent(new HtmlSearch($identifier, $placeholder, $icon)); 60 | } 61 | 62 | /** 63 | * 64 | * @param string $identifier 65 | * @param mixed $content 66 | * @return HtmlDimmer 67 | */ 68 | public function htmlDimmer($identifier, $content=NULL) { 69 | return $this->addHtmlComponent(new HtmlDimmer($identifier, $content)); 70 | } 71 | 72 | 73 | /** 74 | * @param string $identifier 75 | * @param string $header 76 | * @param string $content 77 | * @param array $actions 78 | * @return HtmlModal 79 | */ 80 | public function htmlModal($identifier, $header="", $content="", $actions=array()) { 81 | return $this->addHtmlComponent(new HtmlModal($identifier, $header,$content,$actions)); 82 | } 83 | } -------------------------------------------------------------------------------- /Ajax/semantic/traits/SemanticHtmlViewsTrait.php: -------------------------------------------------------------------------------- 1 | addHtmlComponent(new HtmlCard($identifier)); 18 | } 19 | 20 | public function htmlCardGroups($identifier, $cards=array()) { 21 | return $this->addHtmlComponent(new HtmlCardGroups($identifier, $cards)); 22 | } 23 | } -------------------------------------------------------------------------------- /Ajax/service/AjaxCall.php: -------------------------------------------------------------------------------- 1 | method=$method; 13 | $this->parameters=$parameters; 14 | } 15 | 16 | public function compile(JsUtils $js=null) { 17 | if ($js==null) 18 | return; 19 | $result=""; 20 | $params="{}"; 21 | $callback=NULL; 22 | $attr="id"; 23 | $validation=false; 24 | $stopPropagation=true; 25 | $preventDefault=true; 26 | extract($this->parameters); 27 | if ($preventDefault===true) { 28 | $result.="\nevent.preventDefault();\n"; 29 | } 30 | if ($stopPropagation===true) { 31 | $result.="event.stopPropagation();\n"; 32 | } 33 | switch($this->method) { 34 | case "get": 35 | $result.=$js->getDeferred($url, $responseElement, $params, $callback, $attr); 36 | break; 37 | case "post": 38 | $result.=$js->postDeferred($url, $responseElement, $params, $callback, $attr); 39 | break; 40 | case "postForm": 41 | $result.=$js->postFormDeferred($url, $form, $responseElement, $validation, $callback, $attr); 42 | break; 43 | } 44 | return $result; 45 | } 46 | 47 | public function getMethod() { 48 | return $this->method; 49 | } 50 | 51 | public function setMethod($method) { 52 | $this->method=$method; 53 | return $this; 54 | } 55 | 56 | public function getParameters() { 57 | return $this->parameters; 58 | } 59 | 60 | public function setParameters($parameters) { 61 | $this->parameters=$parameters; 62 | return $this; 63 | } 64 | } -------------------------------------------------------------------------------- /Ajax/service/JArray.php: -------------------------------------------------------------------------------- 1 | 0) { 48 | for($i=0; $i < $size - 1; $i++) { 49 | $result.=$pieces[$i] . @$glue[$i]; 50 | } 51 | $result.=$pieces[$size - 1]; 52 | } 53 | } else { 54 | $result=\implode($glue, $pieces); 55 | } 56 | return $result; 57 | } 58 | 59 | public static function dimension($array) { 60 | if (is_array(reset($array))) { 61 | $return=self::dimension(reset($array)) + 1; 62 | } else { 63 | $return=1; 64 | } 65 | return $return; 66 | } 67 | 68 | public static function sortAssociative($array, $sortedKeys=array()) { 69 | $newArray=array (); 70 | foreach ( $sortedKeys as $key ) { 71 | if (\array_key_exists($key, $array)) { 72 | $newArray[$key]=$array[$key]; 73 | } 74 | } 75 | return $newArray; 76 | } 77 | } -------------------------------------------------------------------------------- /Ajax/service/JString.php: -------------------------------------------------------------------------------- 1 | uiName="button"; 19 | } 20 | 21 | /** 22 | * Disables the button if set to true. 23 | * @param Boolean $value default : false 24 | * @return $this 25 | */ 26 | public function setDisabled($value) { 27 | return $this->setParamCtrl("disabled", $value, "is_bool"); 28 | } 29 | 30 | /** 31 | * Icons to display, with or without text (see text option). 32 | * By default, the primary icon is displayed on the left of the label text and the secondary is displayed on the right. 33 | * The positioning can be controlled via CSS. 34 | * The value for the primary and secondary properties must match an icon class name, e.g., "ui-icon-gear". 35 | * For using only one icon: icons: { primary: "ui-icon-locked" }. For using two icons: icons: { primary: "ui-icon-gear", secondary: "ui-icon-triangle-1-s" }. 36 | * @param String $value default : { primary: null, secondary: null } 37 | * @return $this 38 | */ 39 | public function setIcons($value) { 40 | if (is_string($value)) { 41 | if (Text::startsWith($value, "{")) 42 | ; 43 | $value="%".$value."%"; 44 | } 45 | return $this->setParam("icons", $value); 46 | } 47 | 48 | /** 49 | * Whether to show the label. 50 | * When set to false no text will be displayed, but the icons option must be enabled, otherwise the text option will be ignored. 51 | * @param Boolean $value default : false 52 | * @return $this 53 | */ 54 | public function setText($value) { 55 | return $this->setParamCtrl("text", $value, "is_bool"); 56 | } 57 | 58 | /** 59 | * Text to show in the button. 60 | * When not specified (null), the element's HTML content is used, or its value attribute if the element is an input element of type submit or reset, 61 | * or the HTML content of the associated label element if the element is an input of type radio or checkbox. 62 | * @param string $value default : null 63 | * @return $this 64 | */ 65 | public function setLabel($value) { 66 | return $this->setParam("label", $value); 67 | } 68 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Buttonset.php: -------------------------------------------------------------------------------- 1 | uiName="buttonset"; 18 | } 19 | 20 | /** 21 | * Disables the buttonSet if set to true. 22 | * @param Boolean $value default : false 23 | * @return $this 24 | */ 25 | public function setDisabled($value) { 26 | return $this->setParamCtrl("disabled", $value, "is_bool"); 27 | } 28 | 29 | /** 30 | * Which descendant elements to convert manage as buttons. 31 | * default : "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)" 32 | * @param String $value 33 | * @return $this 34 | */ 35 | public function setItems($value) { 36 | return $this->setParam("items", $value); 37 | } 38 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Dialog.php: -------------------------------------------------------------------------------- 1 | params=array ( 20 | "dialogClass" => "no-close" 21 | ); 22 | $this->addCancelBtn("Annuler"); 23 | } 24 | 25 | public function getScript() { 26 | $allParams=$this->params; 27 | $jsonButtons=array (); 28 | foreach ( $this->buttons as $button ) { 29 | $jsonButtons []=$button->getParams(); 30 | } 31 | $allParams ["buttons"]=$jsonButtons; 32 | $this->jquery_code_for_compile []="$( '" . $this->attachTo . "' ).dialog(" . $this->getParamsAsJSON($allParams) . ");"; 33 | $result=implode("", $this->jquery_code_for_compile); 34 | $result=str_ireplace("\"%", "", $result); 35 | $result=str_ireplace("%\"", "", $result); 36 | $result=str_ireplace("\\n", "", $result); 37 | $result=str_ireplace("\\t", "", $result); 38 | return $result; 39 | } 40 | 41 | /** 42 | * 43 | * @param String $identifier identifiant CSS 44 | */ 45 | public function attach($identifier) { 46 | $this->attachTo=$identifier; 47 | } 48 | 49 | public function addCancelBtn($caption="Annuler", $position=NULL) { 50 | $this->insertBtn(DialogButton::cancelButton($caption), $position); 51 | } 52 | 53 | public function addSubmitBtn(JsUtils $js, $url, $form, $responseElement, $caption="Valider", $position=NULL) { 54 | $this->insertBtn(DialogButton::submitButton($js, $url, $form, $responseElement, $caption), $position); 55 | } 56 | 57 | public function addButton($caption, $jsCode, $position=NULL) { 58 | $this->insertBtn(new DialogButton($caption, $jsCode), $position); 59 | } 60 | 61 | private function insertBtn($insert, $position=NULL) { 62 | if ($position != NULL) { 63 | $this->buttons=array_splice($this->buttons, $position, 0, $insert); 64 | } else { 65 | $this->buttons []=$insert; 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /Ajax/ui/components/DialogButton.php: -------------------------------------------------------------------------------- 1 | params ["text"]=$caption; 26 | $this->params [$event]=$this->addFunction($jsCode); 27 | } 28 | 29 | public function __toString() { 30 | return $this->getScript(); 31 | } 32 | 33 | /* 34 | * (non-PHPdoc) 35 | * @see \Ajax\common\BaseComponent::getScript() 36 | */ 37 | public function getScript() { 38 | return json_encode($this->params, JSON_UNESCAPED_SLASHES); 39 | } 40 | 41 | public static function cancelButton($caption="Annuler") { 42 | return new DialogButton($caption, "$( this ).dialog( 'close' );"); 43 | } 44 | 45 | public static function submitButton(JsUtils $js, $url, $form, $responseElement, $caption="Okay") { 46 | return new DialogButton($caption, $js->postForm($url, $form, $responseElement) . ";$( this ).dialog( 'close' );"); 47 | } 48 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Menu.php: -------------------------------------------------------------------------------- 1 | uiName="menu"; 18 | } 19 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Progressbar.php: -------------------------------------------------------------------------------- 1 | params=array ( 18 | "value" => 50 19 | ); 20 | $this->uiName="progressbar"; 21 | } 22 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Selectmenu.php: -------------------------------------------------------------------------------- 1 | uiName="selectmenu"; 18 | } 19 | } -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Spinner.php: -------------------------------------------------------------------------------- 1 | uiName="spinner"; 18 | } 19 | } -------------------------------------------------------------------------------- /Ajax/ui/components/Tabs.php: -------------------------------------------------------------------------------- 1 | uiName="tabs"; 18 | } 19 | } -------------------------------------------------------------------------------- /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 | * @param int $value default : 400 23 | */ 24 | public function setDuration($value) { 25 | $this->setParamCtrl("duration", $value, "is_int"); 26 | } 27 | 28 | /** 29 | * A string indicating which easing function to use for the transition. 30 | * @param string $value default : swing 31 | */ 32 | public function setEasing($value) { 33 | $this->setParamCtrl("easing", $value, array ( 34 | "linear", 35 | "swing", 36 | "easeInQuad", 37 | "easeOutQuad", 38 | "easeInOutQuad", 39 | "easeInCubic", 40 | "easeOutCubic", 41 | "easeInOutCubic", 42 | "easeInQuart", 43 | "easeOutQuart", 44 | "easeInOutQuart", 45 | "easeInQuint", 46 | "easeOutQuint", 47 | "easeInOutQuint", 48 | "easeInExpo", 49 | "easeOutExpo", 50 | "easeInOutExpo", 51 | "easeInSine", 52 | "easeOutSine", 53 | "easeInOutSine", 54 | "easeInCirc", 55 | "easeOutCirc", 56 | "easeInOutCirc", 57 | "easeInElastic", 58 | "easeOutElastic", 59 | "easeInOutElastic", 60 | "easeInBack", 61 | "easeOutBack", 62 | "easeInOutBack", 63 | "easeInBounce", 64 | "easeOutBounce", 65 | "easeInOutBounce" 66 | )); 67 | } 68 | 69 | /** 70 | * A Boolean indicating whether to place the animation in the effects queue. 71 | * If false, the animation will begin immediately. 72 | * @param Boolean $value default : true 73 | */ 74 | public function setQueue($value) { 75 | $this->setParamCtrl("queue", $value, "is_bool"); 76 | } 77 | 78 | /* 79 | * (non-PHPdoc) 80 | * @see \Ajax\common\BaseComponent::getScript() 81 | */ 82 | public function getScript() { 83 | // TODO: Auto-generated method stub 84 | } 85 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Phalcon-jquery is an open source project. 2 | 3 | *We accept bug reports, new feature requests and pull requests in GitHub*. 4 | 5 | If you have a change or new feature in mind, please fill an [NFR](https://github.com/jcheron/phalcon-jquery/wiki/New-Feature-Request---NFR). 6 | 7 | Thanks!
8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Phalcon jquery](http://angular.kobject.net/git/phalconist/phalcon-jquery-git.png "Phalcon jquery") 2 | 3 | **A JQuery and UI library** (JQuery UI, Twitter Bootstrap, Semantic-UI) for Phalcon MVC framework 4 | 5 | [![Build Status](https://travis-ci.org/jcheron/phalcon-jquery-tests-suite.svg?branch=master)](https://travis-ci.org/jcheron/phalcon-jquery-tests-suite) 6 | [![Latest Stable Version](https://poser.pugx.org/jcheron/phalcon-jquery/v/stable)](https://packagist.org/packages/jcheron/phalcon-jquery) [![Total Downloads](https://poser.pugx.org/jcheron/phalcon-jquery/downloads)](https://packagist.org/packages/jcheron/phalcon-jquery) [![Latest Unstable Version](https://poser.pugx.org/jcheron/phalcon-jquery/v/unstable)](https://packagist.org/packages/jcheron/phalcon-jquery) [![License](https://poser.pugx.org/jcheron/phalcon-jquery/license)](https://packagist.org/packages/jcheron/phalcon-jquery) 7 | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jcheron/phalcon-jquery/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jcheron/phalcon-jquery/?branch=master) 8 | [![codecov](https://codecov.io/gh/jcheron/phalcon-jquery-tests-suite/branch/master/graph/badge.svg)](https://codecov.io/gh/jcheron/phalcon-jquery-tests-suite) 9 | 10 | ## What's new ? 11 | Phalcon-JQuery becomes phpMv-UI and supports several php frameworks. 12 | 13 | see https://github.com/phpMv/phpMv-UI 14 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jcheron/phalcon-jquery", 3 | "description": "A JQuery and UI library for Phalcon MVC framework", 4 | "type": "phalcon-jquery", 5 | "keywords": [ 6 | "jquery", 7 | "phalcon", 8 | "twitter bootstrap", 9 | "jquery ui", 10 | "semantic ui", 11 | "framework" 12 | ], 13 | "require": { 14 | "php": ">5.3.9", 15 | "frameworks/jquery": "~2.1", 16 | "components/jqueryui": "~1.11", 17 | "twitter/bootstrap": "~3.3", 18 | "ext-phalcon": ">1.3" 19 | }, 20 | "autoload": { 21 | "psr-4": { "Ajax\\": "" } 22 | }, 23 | "license": "Apache-2.0", 24 | "authors": [ 25 | { 26 | "name": "Jean-Christophe HERON", 27 | "email": "myaddressmail@gmail.com", 28 | "role": "Developer" 29 | } 30 | ] 31 | } 32 | --------------------------------------------------------------------------------