The jquery core class is the Javascript Helper Class of EQDKP-PLUS. Jquery is an open source Javascript framework. All our Javascript is based on jQuery, some plugins are custom written for eqdkpplus. To be more flexible and allow users to easily use this features, i wrote the jquery abstraction class. Please use this functions if possible, and do not directly use jquery plugins provided in the core.
$jquery->CustomUI($template)
This function is used to set the custom UI CSS. This function is called in the core.php, and should not be used into plugins. It adds the link to the custom ui css to the template engine.
The Code editor function allows you to use a textarea with a syntax highlighter. Usefull for Editors, p.e. the Layout Editor.
$jquery->CodeEditor(ID, CODE, TYPE, OPTIONS);
| Name | Description | Possible Values |
|---|---|---|
| TYPE | The Type of the dialog | html, xml, css, html_js |
| ID | name and ID of the textarea | string |
| CODE | The Source code to be shown | string |
| OPTIONS | Additional Options | array |
| Option Name | Description | Default Value |
|---|---|---|
| no_css | Do not use the CSS, use custom one | false |
| textarea_height | height of the textarea contining the code editor | 350px |
| no_linenumbers | do not show line numbers | false |
The Dialogs are javascript overlay dialogs, p.e. as in a lightbox. Could be used at any place, as a modal or normal window.
$jquery->Dialog(NAME, WINDOW_HEADER, OPTIONS, TYPE);
| Name | Description | Possible Values |
|---|---|---|
| TYPE | The Type of the dialog | url, confirm, alert |
| NAME | function Name to be called, p.e. 'fe_portalsettings' means function fe_portalsettings(); | string |
| WINDOW_HEADER | The Text shown in the Window head | string |
| OPTIONS | Additional Options | array |
| Option Name | Description | Available for TYPE |
|---|---|---|
| url | the URL to be opened or redirected (confirm) | url, confirm |
| message | the message to be shown in the window | alert, confirm |
| withid | the id of the function p.e. test(withid) | confirm, url |
| custom_js | Use custom JS Code instead of redirect to url when confirmed | confirm |
| cancel_js | JS Code for canceling the dialog | confirm |
| confirm_name | Used in the PLUS-Confirms, to pass the values of the selected inputs to the confirm box | confirm |
| buttontxt | The text of the "confirm" button | confirm |
| confirm_url | Used in the PLUS-Confirms, the URL where to pass the POST and fetch the text to be shown instead of the #replacedata# in the languagestring | confirm |
| message | The message to be shown | url, alert, confirm |
| onclose | redirect on window close | url |
| width | Width of the window | url, alert, confirm |
| height | Height of the window | url, alert, confirm |
| buttons | Pass Code for Buttons, default is NULL (p.e. 'buttons' => "{ 'save': function(){ $('#editCategoryForm').submit(); $(this).dialog('close'); } }") | url |
| modal | Modal window, true/false | url |
| resize | User can resize window, true/false | url |
| draggable | User can drag&drop window, true/false | url |
Sliders, based on the jquery.ui. Can be used as ranged sliders or single sliders.
$jquery->Slider(ID, OPTIONS, TYPE);
| Name | Description | Possible Values |
|---|---|---|
| TYPE | The Type of the dialog | normal, range |
| ID | name and ID of the slider | string |
| OPTIONS | Additional Options | array |
| Option Name | Description | Default Value | For Type |
|---|---|---|---|
| min | Minimum slider Value | integer | range |
| max | Maximum slider Value | integer | range |
| values | Values array, p.e. from config | array(min, max) | range |
| label | Label text for the slider | string | range |
| width | Width of the Slider | string | range |
Possibility to add an autocomplete feature to an existing input.
$jquery->Autocomplete(ID, DATAARRAY);
| Name | Description | Possible Values |
|---|---|---|
| ID | name and ID of the slider | string |
| DATAARRAY | Array with autocomplete items | array |
A simple dropdown menu, p.e. used in the charmanager for providing a better handling.
$jquery->DropDownMenu(ID, ITEMS, IMAGEPATH ,BUTTON);
| Name | Description | Possible Values |
|---|---|---|
| ID | ID of the text input to attach autocomplete | string |
| ITEMS | Array with menu items | array |
| IMAGEPATH | Path to the menu images | string |
| BUTTON | Button Text | string |
a full Dropdownmenu solution, based on the suckerfish concept, using jquery for animations && support for Internet Explorer, p.e. used in the admin menu of 0.7.
$jquery->SuckerFishMenu(DATAARRAY, NAME, IMAGEPATH, NODEFIMAGE);
| Name | Description | Possible Values |
|---|---|---|
| NAME | name of the menu, must be unique | string |
| DATAARRAY | Array with autocomplete items | array |
| IMAGEPATH | Path to the menu images | string |
| NODEFIMAGE | Do not use the default menu image, p.e. the puzzle icon | true/false |
Add an accordion, p.e. used for bosssuite things in the portal modules.
$jquery->Accordion(NAME, LIST){;
| Name | Description | Possible Values |
|---|---|---|
| NAME | Name/ID of the accordion (must be unique) | string |
| LIST | Content array in the format: title => content | array |
This function is used in the $core->message() function. Please use this function instead of the direct jquery function, i see no need in describing the growl functionality. It is based on the Growl notification sytsem for MacOS X.
The jQuery UI Datepicker is a highly configurable plugin that adds datepicker functionality to your pages. You can customize the date format and language, restrict the selectable date ranges and add in buttons and other navigation options easily.
By default, the datepicker calendar opens in a small overlay onFocus and closes automatically onBlur or when a date is selected. For an inline calendar, simply attach the datepicker to a div or span.
$jquery->Calendar(NAME, VALUE, JSCODE, OPTIONS):
| Name | Description | Possible Values |
|---|---|---|
| ID | Name/ID of the calendar (must be unique) | string |
| VALUE | Value for the input field | string |
| JSCODE | additional javascript code attached to the input field | string |
| OPTIONS | Additional Options | array |
| Option Name | Description | Default Value |
|---|---|---|
| class | The class of the input field (optional value) | null |
| id | The id of the input field (optional value) | null |
| format | Date format | user->style[datenotimeshort] |
| cal_icons | Show calendar icon in text field | true |
| show_buttons | Show Button panel in Calendar | false |
| number_months | How many months should be shown | 1 |
| year_range | Use the year range | false |
| other_months | Show other months | false |
| change_fields | (text needed here) | false |
| timepicker | use timepicker | false |
| timeformat | timeformat to use | user->style[time] |
| return_function | return js-function | false |
Use the UI Tabs. This function is hardly used, you must insert all data into the tab dataarray. If you want to use it on an existing page, have a look at tab_header()
$jquery->Tab(NAME, DATAARRAY, COOKIE, OPTIONS){
| Name | Description | Possible Values |
|---|---|---|
| NAME | Name/ID of the tab (must be unique) | string |
| DATAARRAY | Array with tabs data | array |
| COOKIE | Save the selection in a cookie | true/false |
| OPTIONS | Use own options for tabs, not the preselected ones | true/false |
Use the UI Tabs.
$jquery->Tab_header(NAME, COOKIE, OPTIONS);
| Name | Description | Possible Values |
|---|---|---|
| NAME | Name/ID of the tab (must be unique) | string |
| COOKIE | Save the selection in a cookie | true/false |
| OPTIONS | Use own options for tabs, not the preselected ones | true/false |
$jquery->Tab_Select(NAME, SELECTION);
If you want to select a tab, use this one: The name is the same as in the Tab_header function, the SELECTION value is the number of the tab, starting with 0. The first tab == 0, the second tab == 1, etc
Add a rightclick menu . Used in Raidplaner p.e. to handle the twink signin/change for admins
$jquery->RightClickMenu(ID, DIVID, DATA, WIDTH)
| Name | Description | Possible Values |
|---|---|---|
| ID | name and ID of the menue (must be unique) | string |
| DIVID | ID of the div to attach the menu to | array |
| DATA | Array with menu items | array |
| WIDTH | Array with autocomplete items | default: 170px |
| RETURNJS | boolean, wether to return js-function | false |
Add a colorpicker to the page. The function returns the input field
$jquery->colorpicker(ID, VALUE, SIZE='14', JSCODE);
| Name | Description | Possible Values |
|---|---|---|
| ID | name and ID of the colorpicker | string |
| VALUE | Default Value to be shown, p.e. config value | string |
| VALUE | Size of the input field | default: 14 |
| JSCODE | Additional javascript Code for the input field | string |
Add a styled Progress bar to the page, Value & bar progress can be changed during runtime using jquery
$jquery->ProgressBar(ID, VALUE, TEXT='', TEXTALIGN='center', DIRECTOUT=false);
| Name | Description | Default Values |
|---|---|---|
| ID | name and ID of the Progressbar (must be unique) | -- |
| VALUE | Array with autocomplete items | -- |
| TEXT | text shown into the progress bar | null |
| TEXTALIGN | align for the text shown into the progress bar | center |
| DIRECTOUT | Direct output of the code, using jquery | false |
$jquery->SetProgressbarValue(ID, VALUE);
If you want to change the Progressbar value in your script (maybe using ajax), this is your friend.
Ajax Starrating
MultiSelect with checkboxes
Provide RSS Feeds fetched by Async. AJAX, p.e. the News on the admin index
A time picker. Hopefullly this will be integrated into the datepicker till release of 0.7
Part of a jquery Plot plugin, output pie charts
Part of a jquery Plot plugin, output line charts
Add a tooltip
$jquery->qtip(NAME, CONTENT, OPTIONS);
| Name | Description | Default Values |
|---|---|---|
| NAME | name and ID of the qTip (must be unique) | -- |
| CONTENT | The content of the tooltip | -- |
| OPTIONS | additional options to use | (my, at, classes, contfunc |
| Option Name | Description | Default Value |
|---|---|---|
| at | at the bottom right (jQuery UI Position plugin) | bottom center |
| my | Position my top left (jQuery UI Position plugin) | top center |
| classes | Use extra classes | |
| contfunc | Use a javascript function instead of a content text/html | content |
Create collapsable content, used p.e. in the portal module headers
$jquery->Collapse(ID, HIDE, PERSIST);
| Name | Description | Default Values |
|---|---|---|
| ID | name and ID of the collapsable box (must be unique) | -- |
| HIDE | Hidden on default | -- |
| PERSIST | set a cookie to save the state of the collapsable box | -- |
Two dropdowns, the second one reads content via ajax & is attached to first one. p.e. used in the game-language selector
A powefull jquery Form validation. Validate your forms.
$jquery->Validate(ID, MESSAGES, CUSTOMCODE);
| Name | Description | Default Values |
|---|---|---|
| ID | ID of the form to validate (must be unique) | -- |
| MESSAGES | An array with the error messages | false |
| CUSTOMCODE | Use custom code/functions instead of messages |
It is possible to validate forms in tabs. See user settings for Demo. The code itsself is nearly the same
$jquery->ValidateTab(ID, MESSAGES);
If you want to reset the validation for a form element, use this function
$jquery->ResetValidate(ID);
An ajax image uploader, using the forms plugin. Usefull if you want to upload a single image file.
Init the Image Uploader by using this code. You need a form field (input) with an unique ID. This ID is your INPUTID and will be filled with the temporary file name.
$jquery->imageUploader(ID, INPUTID, IMGNAME, IMGPATH, OPTIONS);
In your save function, use this code to convert & move the temporary file to the destination folder
$jquery->MoveUploadedImage(TEMPFILE, FOLDERPATH);
The TEMPFILE is the file written to your form input field (see above) (format: timestamp__filename.extension). The folderpath should be achieved using the pcache, p.e. $pcache->FolderPath('test', 'eqdkp')
| Name | Description | Default Values |
|---|---|---|
| ID | ID of the image uploader (must be unique) | -- |
| INPUTID | The id of the input field where the image name should be copied to | -- |
| IMGNAME | The name of the image to be shown on load | -- |
| IMGPATH | The image path where the final image is saved to, use $pcache->FolderPath('test', 'eqdkp') | -- |
| OPTIONS | additional options to use | width, height |
| Option Name | Description | Default Value |
|---|---|---|
| width | The allowed width for images | 3000 |
| height | The allowed height for images | 3000 |
| resize | Resize the images to the width & height given | false |
| prevheight | The height of the preview image | 150 |
| noimgfile | Define a custom "no image available" image (eoor path already set!) | 'images/no_pic.png' |
| deletelink | Set a link to a delete function if you want to use this feature. If a link is set, a delete button is shown | false |
Quote Input to be used as Javascript input