Notify your administrator!
The lincense can be obtained from ".$this->componentData->companyname.".
You can add more tabs to the component dashboard.
" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BOTTON_COMPONENT_DASHBOARD_LABEL="Customize the Component Dashboard" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BUILDCOMP_DYNAMIC_MYSQL_DESCRIPTION="You can dynamically build the components back-end views and fields by adding a mySql table dump, that has all the tables, or some more tables with its columns and data types. A very basic and generic set of fields and tables will be created, and added to the existing fields and tables of this component." COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_BUILDCOMP_DYNAMIC_MYSQL_LABEL="Dynamic Builder (mySql) Option" -COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_MYSQL_TWEAK_OPTIONS_DESCRIPTION="In each admin view you can add data from a MySQL Table (this is done in the admin view MySQL tab). Here you can limit that data in relation to this component. This feature is useful when an admin view with demo data is used in more then one component, and you would like to exclude some demo data without creating a new admin view." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_COMPONENT_FILES_FOLDERS_DESCRIPTION="You can add custom files and folders to the component, simply add the files to the administrator/components/com_componentbuilder/custom folder and then select them here." +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_COMPONENT_FILES_FOLDERS_LABEL="Adding Custom Files & Folder" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_DISPLAY_COMPONENT_ADMIN_VIEWS_DESCRIPTION="Need help, visit Markdown-Cheatsheet
# ###Component_name### (###VERSION###)
@@ -3213,41 +4161,17 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_ZIP_DESCRIPTION="T
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_ZIP_LABEL="The ZIP Option"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_WHMCS_LISENCING_NOTE_DESCRIPTION="You can use WHMCS licensing addon in your component
Helpful Links
https://www.whmcs.com/addons/licensing-addon/
http://docs.whmcs.com/Licensing_Addon"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_WHMCS_LISENCING_NOTE_LABEL="Licensing addon module for WHMCS"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTIFICATION="Notification"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTIFICATION_CIRCLE="Notification Circle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTNEW_DESCRIPTION="Should file be updated."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTNEW_LABEL="Update"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOT_REQUIRED="Not Required"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER="Number"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NUMBER_LABEL="Number"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ORDERING_LABEL="Ordering"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ORDER_DESCRIPTION="Overide the default order"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ORDER_LABEL="Order"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_OTHER="Other"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PALETTE="Palette"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PARAGRAPH_CENTER="Paragraph Center"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PARAGRAPH_JUSTIFY="Paragraph Justify"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PARAGRAPH_LEFT="Paragraph Left"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PARAGRAPH_RIGHT="Paragraph Right"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PATH_DESCRIPTION="Path in relation to the folder structure in the install package, unzip the compiled file to see the structure. "
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PATH_HINT="Target Path Here"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PATH_LABEL="Target Path"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PAUSE="Pause"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PAUSE_CIRCLE="Pause Circle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PENCIL="Pencil"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PENCIL_TWO="Pencil 2"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PERMISSION="Permissions"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHONE="Phone"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHONE_TWO="Phone 2"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP="PHP"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT="Php Admin Event"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_DESCRIPTION="PHP script for the global helper admin event method."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_HINT="// add custom PHP script to the global helper admin event method."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_ADMIN_EVENT_LABEL="Global Helper Admin Event"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_DASHBOARD_METHODS="Php Dashboard Methods"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_DASHBOARD_METHODS_DESCRIPTION="PHP methods to place in the dashboard model."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_DASHBOARD_METHODS_HINT="// add custom PHP methods to dashboard model. Use the [public function getMethodname()] to insure the data is set to the view, note the convention [public function get...()] replace the .... with the unique method name."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_DASHBOARD_METHODS_LABEL="PHP Dashboard Methods"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN="Php Helper Admin"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_HELPER_ADMIN_HINT="// The PHP abstract Methods to add to the component helper class. Only Methods! as it will directly be add as methods to the helper class!"
@@ -3284,97 +4208,30 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT="Php Site Event"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_DESCRIPTION="PHP script for the global helper site event method."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_HINT="// add custom PHP script to the global helper site event method."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PHP_SITE_EVENT_LABEL="Global Helper Site Event"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PIE="Pie"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PIN="Pin"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PLAY="Play"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PLAY_CIRCLE="Play Circle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PLUS="Plus"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PLUS_CIRCLE="Plus Circle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PORT_DESCRIPTION="add import/export option to this admin view."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PORT_LABEL="Export/Import Data"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_POWER_CORD="Power Cord"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PREVIOUS="Previous"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PRINT="Print"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLIC_DESCRIPTION="if view uses Access,
should default be public."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLIC_LABEL="Public Access"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLISH="Publish"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUBLISHING="Publishing"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PURGE="Purge"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_PUZZLE="Puzzle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_QUESTION="Question"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_QUESTION_TWO="Question 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_QUOTES_LEFT="Quotes Left"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_QUOTES_RIGHT="Quotes Right"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_RADIO_UNCHECKED="Radio Unchecked"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README="Readme"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_README_LABEL="README.md"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_RENAME_LABEL="Rename"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_REPLY="Reply"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_FTP="Sales Server Ftp"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_FTP_DESCRIPTION="Select your sales server (FTP) for this component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SALES_SERVER_FTP_LABEL="Sales Server (FTP)"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SAVE_COPY="Save Copy"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SAVE_NEW="Save New"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Joomla Component to customise the alias."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SCISSORS="Scissors"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SCREEN="Screen"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SCREWDRIVER="Screwdriver"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SEARCH="Search"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SELECT_AN_OPTION="Select an option"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SETTINGS="Settings"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHARE="Share"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHARE_ALT="Share Alt"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHIELD="Shield"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION="Short Description"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_DESCRIPTION="Enter short description"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_HINT="Your Short Description Here"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHORT_DESCRIPTION_LABEL="Short Description"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHOW_DESCRIPTION="Select where you want this contributor to show in the component."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHOW_LABEL="Show"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SHUFFLE="Shuffle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SIGNUP="Signup"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SITEVIEW="Siteview"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SITEVIEW_DESCRIPTION="Select a site view"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SITEVIEW_LABEL="View"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SITE_VIEWS="Site Views"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SMILEY="Smiley"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SMILEY_NEUTRAL="Smiley Neutral"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SMILEY_NEUTRAL_TWO="Smiley Neutral 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SMILEY_SAD="Smiley Sad"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SMILEY_SAD_TWO="Smiley Sad 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SMILEY_TWO="Smiley 2"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL="Sql"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_DESCRIPTION="Add your MySQL here!"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_HINT="// Add MySQL Table Dump Here"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_LABEL="MySQL"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_TWEAK="Sql Tweak"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_TWEAK_DESCRIPTION="Tweak the view MySql dump settings."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_TWEAK_LABEL="MySql (tweak)"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQL_TWEAK_SELECT="Open"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SQUARE="Square"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STACK="Stack"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STAR_TWO="Star 2"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STATUS="Status"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STOP="Stop"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_STOP_CIRCLE="Stop Circle"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SUBMENU_DESCRIPTION="Select if the view should show in the submenu."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SUBMENU_LABEL="Submenu"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SUPPORT="Support"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SWITCH="Switch"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME="System Name"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_DESCRIPTION="Used only in the system."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_HINT="The System Name Here"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_SYSTEM_NAME_LABEL="System Name"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TABLET="Tablet"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TABNAME_DESCRIPTION="The name of the tab this field belongs to."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TABNAME_HINT="Global"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TABNAME_LABEL="Tab Name"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TAG="Tag"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TAGS="Tags"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TAGS_TWO="Tags 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TAG_TWO="Tag 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_THUMBS_DOWN="Thumbs Down"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_THUMBS_UP="Thumbs Up"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TITLE_DESCRIPTION="Enter contributor's title in relation to this component"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TITLE_HINT="Contributor's Role"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TITLE_LABEL="Job Title"
@@ -3385,15 +4242,6 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TOIGNORE_LABEL="Repository Folders or File
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TO_IGNORE_NOTE_DESCRIPTION="During compilation JCB deletes all files and folders from the repository folder, and then adds the newly created files and folders back into the repository folder. Yet there may be files or folders you may not want deleted, like the .git folder, since JCB does not dynamically create that folder and so it will not be placed back, but simply delete it, unless you add it in this text field below, so that it will be ignored, and therefore not deleted in the first place. You can add multiple folders and files, separated by commas. Like: .git, .hg
"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TO_IGNORE_NOTE_LABEL="Repository Folders or Files to Ignore"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION="Translation"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TREE="Tree"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TREE_TWO="Tree 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNARCHIVE="Unarchive"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNBLOCK="Unblock"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNDO="Undo"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNDO_TWO="Undo 2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNFEATURED="Unfeatured"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNLOCK="Unlock"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNPUBLISH="Unpublish"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATES_USED_IN_JOOMLA_UPDATER="Updates (used in Joomla updater)"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER="Update Server"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_DESCRIPTION="Enter Update Server URL"
@@ -3405,28 +4253,12 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_LABEL="Update Server"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_TARGET="Update Server Target"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_TARGET_DESCRIPTION="Select the type of way you would like the update server to be set."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPDATE_SERVER_TARGET_LABEL="Update Server Target"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UPLOAD="Upload"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_URL_DESCRIPTION="Enter Download Link"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_URL_HINT="http://www.example.com/file.zip"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_URL_LABEL="Version URL"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_USER="User"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_USERS="Users"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_USE_DESCRIPTION="How should we link to this contributor."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_USE_LABEL="Use"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VCARD="Vcard"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_DESC="A count of the number of times this Joomla Component has been revised."
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_DESCRIPTION="1.0.0"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_HINT="1.0.0"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_LABEL="SQL Update Version"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_UPDATE="Version Update"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_UPDATE_DESCRIPTION="Add Version Updates Here!"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_UPDATE_LABEL="Version Updates"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_UPDATE_SELECT="Add Update SQL"
+COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VERSION_LABEL="Revision"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VTHREE="V3"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_VTWO="V2"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WAND="Wand"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WARNING="Warning"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WARNING_CIRCLE="Warning Circle"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE="Website"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_DESCRIPTION="Enter website address"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WEBSITE_HINT="http://www.example.com"
@@ -3439,13 +4271,9 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL="Whmcs Url"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_DESCRIPTION="Enter whmcs address"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_HINT="http://www.yoursite.com/whmcs"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WHMCS_URL_LABEL="URL to your WHMCS install"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WIFI="Wifi"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_WRENCH="Wrench"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YES="Yes"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_YOUTUBE="Youtube"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZIP="ZIP"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZOOM_IN="Zoom In"
-COM_COMPONENTBUILDER_JOOMLA_COMPONENT_ZOOM_OUT="Zoom Out"
+COM_COMPONENTBUILDER_KEEP_HISTORY="Keep History"
COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS="- Keep Original Access -"
COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY="- Keep Original Category -"
COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE="- Keep Original State -"
@@ -3711,6 +4539,11 @@ COM_COMPONENTBUILDER_LEFT_IN_TAB="Left in Tab"
COM_COMPONENTBUILDER_LEFT_OF_TABS="Left of Tabs"
COM_COMPONENTBUILDER_LICENSE="License"
COM_COMPONENTBUILDER_LICENSE_S="License: %s"
+COM_COMPONENTBUILDER_LINK="Link"
+COM_COMPONENTBUILDER_MAIN_MENU="Main Menu"
+COM_COMPONENTBUILDER_MATCH_BEHAVIOR="Match Behavior"
+COM_COMPONENTBUILDER_MATCH_FIELD="Match Field"
+COM_COMPONENTBUILDER_MATCH_OPTIONS="Match Options"
COM_COMPONENTBUILDER_MAX_LENGTH_ONLY_FOUR_TEXT_FIELD="Max Length (only 4 text_field)"
COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)"
COM_COMPONENTBUILDER_NEW="New"
@@ -3724,14 +4557,18 @@ COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!"
COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN="No components were selected, please make a selection and try again!"
COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_FOR_S="No cronjob path found for (%s)"
COM_COMPONENTBUILDER_NO_CRONJOB_PATH_FOUND_SINCE_INCORRECT_TYPE_REQUESTED="No cronjob path found since incorrect type requested."
-COM_COMPONENTBUILDER_NO_FIELD_FOUND="No Field Found"
+COM_COMPONENTBUILDER_NO_ITEM_FOUND="No Item Found"
COM_COMPONENTBUILDER_NO_KEYS_WERE_FOUND_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="No keys were found. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
+COM_COMPONENTBUILDER_NO_S_FOUND="No %s Found"
COM_COMPONENTBUILDER_NO_S_HAVE_BEEN_LINKED_TO_THIS_VIEW_SOON_AS_THIS_IS_DONE_IT_WILL_BE_DISPLAYED_HERE="No %s have been linked to this view. Soon as this is done it will be displayed here."
COM_COMPONENTBUILDER_ON_GITHUB="on Github"
COM_COMPONENTBUILDER_OPEN="Open"
COM_COMPONENTBUILDER_OPENED="opened"
COM_COMPONENTBUILDER_OPENED_THIS="opened this"
COM_COMPONENTBUILDER_OPEN_ON_GITHUB="Open on Github"
+COM_COMPONENTBUILDER_ORDER_BEFORE="Order Before"
+COM_COMPONENTBUILDER_ORDER_IN_EDIT="Order in Edit"
+COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS="Order in list views"
COM_COMPONENTBUILDER_OUT_OF_DATE="Out of date"
COM_COMPONENTBUILDER_OWNER_DETAILS_WAS_SET="Owner details was set"
COM_COMPONENTBUILDER_OWNER_S="Owner: %s"
@@ -3739,11 +4576,15 @@ COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS="Package Owner Details"
COM_COMPONENTBUILDER_PACKAGE_OWNER_DETAILS_NOT_FOUND="Package owner details not found!"
COM_COMPONENTBUILDER_PACKAGE_OWNER_NOT_SET="Package Owner Not Set"
COM_COMPONENTBUILDER_PATH_TO_THE_ZIPPED_PACKAGE_IS_CODESCODE_BR_S_S="Path to the zipped package is: %s
%s %s"
+COM_COMPONENTBUILDER_PERMISSIONS="Permissions"
COM_COMPONENTBUILDER_PLEASE_ADD_FILES_TO_S="Please add files to (%s)"
COM_COMPONENTBUILDER_PLEASE_ADD_FOLDERS_TO_S="Please add folders to (%s)"
COM_COMPONENTBUILDER_PLEASE_CHECK_AGAIN_LATTER="Please check again latter."
COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="Please select a component that you would like to compile."
COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder"
+COM_COMPONENTBUILDER_PUBLIC_ACCESS="Public Access"
+COM_COMPONENTBUILDER_PUBLISHED="Published"
+COM_COMPONENTBUILDER_PUBLISHING="Publishing"
COM_COMPONENTBUILDER_READY_TO_COMPILE_A_COMPONENT="Ready to compile a component"
COM_COMPONENTBUILDER_RELEASED_THIS="released this"
COM_COMPONENTBUILDER_RESPOND_TO_THIS_ISSUE_ON_GITHUB="Respond to this issue on Github"
@@ -3752,6 +4593,7 @@ COM_COMPONENTBUILDER_RIGHT_IN_TAB="Right in Tab"
COM_COMPONENTBUILDER_RIGHT_OF_TABS="Right of Tabs"
COM_COMPONENTBUILDER_SAVE_SUCCESS="Great! Item successfully saved."
COM_COMPONENTBUILDER_SAVE_WARNING="The value already existed so please select another."
+COM_COMPONENTBUILDER_SEARCHABLE="Searchable"
COM_COMPONENTBUILDER_SELECT_THE_COMPONENT_TO_COMPILE="Select the component to compile"
COM_COMPONENTBUILDER_SHOULD_JCB_INSERT_THE_CUSTOM_CODE_PLACEHOLDERS_THIS_IS_ONLY_APPLICABLE_IF_THIS_COMPONENT_HAS_CUSTOM_CODE="Should JCB insert the custom code placeholders? This is only applicable if this component has custom code."
COM_COMPONENTBUILDER_SHOULD_THE_COMPONENT_BE_MOVED_TO_YOUR_LOCAL_REPOSITORY_FOLDER="Should the component be moved to your local repository folder?"
@@ -4297,6 +5139,8 @@ COM_COMPONENTBUILDER_SNIPPET_USAGE_LABEL="Usage"
COM_COMPONENTBUILDER_SNIPPET_VERSION_DESC="A count of the number of times this Snippet has been revised."
COM_COMPONENTBUILDER_SNIPPET_VERSION_LABEL="Revision"
COM_COMPONENTBUILDER_SORRY_THIS_FUNCTION_NAME_IS_ALREADY_IN_USE="Sorry this function name is already in use!"
+COM_COMPONENTBUILDER_SORTABLE="Sortable"
+COM_COMPONENTBUILDER_SUBMENU="Submenu"
COM_COMPONENTBUILDER_SUBMENU_ADMIN_VIEWS="Admin Views"
COM_COMPONENTBUILDER_SUBMENU_COMPILER="Compiler"
COM_COMPONENTBUILDER_SUBMENU_CUSTOM_ADMIN_VIEWS="Custom Admin Views"
@@ -4316,6 +5160,10 @@ COM_COMPONENTBUILDER_SUBMENU_SNIPPETS="Snippets"
COM_COMPONENTBUILDER_SUBMENU_TEMPLATES="Templates"
COM_COMPONENTBUILDER_S_BEING_IMPORTED="%s Being Imported"
COM_COMPONENTBUILDER_S_PLEASE_WAIT_THE_COMPONENT_IS_BEING_COMPILED="%s, please wait! The component is being compiled"
+COM_COMPONENTBUILDER_TAB="Tab"
+COM_COMPONENTBUILDER_TARGET_BEHAVIOR="Target Behavior"
+COM_COMPONENTBUILDER_TARGET_FIELDS="Target Field/s"
+COM_COMPONENTBUILDER_TARGET_RELATION="Target Relation"
COM_COMPONENTBUILDER_TEMPLATE="Template"
COM_COMPONENTBUILDER_TEMPLATES="Templates"
COM_COMPONENTBUILDER_TEMPLATES_ACCESS="Templates Access"
@@ -4422,6 +5270,15 @@ COM_COMPONENTBUILDER_TEMPLATE_YES="Yes"
COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_BSETTINGSB_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_BEXPORT_KEYB="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
COM_COMPONENTBUILDER_THAT_MEANS_ANYONE_WHO_HAS_THIS_PACKAGE_CAN_INSTALL_IT_INTO_JCB_TO_ADD_AN_EXPORT_KEY_SIMPLY_OPEN_THE_COMPONENT_GO_TO_THE_TAB_CALLED_SETTINGS_BOTTOM_RIGHT_THERE_IS_A_FIELD_CALLED_EXPORT_KEY="That means anyone who has this package can install it into JCB. To add an export key simply open the component, go to the tab called settings, bottom right there is a field called Export Key."
COM_COMPONENTBUILDER_THERE_HAS_BEEN_AN_ERROR_IF_THIS_CONTINUES_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR_OF_A_TYPE_ERROR_IN_THE_FIELDS_DISPLAY_REQUEST="There has been an error, if this continues please inform your system administrator of a type error in the fields display request!"
+COM_COMPONENTBUILDER_THE_COMPONENT_ADMIN_VIEWS="The component admin views"
+COM_COMPONENTBUILDER_THE_COMPONENT_CONFIG="The component config"
+COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_MENUS="The component custom admin menus"
+COM_COMPONENTBUILDER_THE_COMPONENT_CUSTOM_ADMIN_VIEWS="The component custom admin views"
+COM_COMPONENTBUILDER_THE_COMPONENT_DASHBOARD="The component dashboard"
+COM_COMPONENTBUILDER_THE_COMPONENT_FILES_FOLDERS="The component files & folders"
+COM_COMPONENTBUILDER_THE_COMPONENT_MYSQL_TWEAKS="The component mysql tweaks"
+COM_COMPONENTBUILDER_THE_COMPONENT_SITE_VIEWS="The component site views"
+COM_COMPONENTBUILDER_THE_COMPONENT_UPDATES="The component updates"
COM_COMPONENTBUILDER_THE_KEY_OF_THIS_PACKAGE="The key of this package."
COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING="The notice board is loading"
COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_CODESCODE="The package key is: %s
"
@@ -4429,9 +5286,11 @@ COM_COMPONENTBUILDER_THE_PACKAGE_KEY_IS_S="The package key is: %s"
COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading"
COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading"
COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key."
+COM_COMPONENTBUILDER_TITLE="Title"
COM_COMPONENTBUILDER_TOTAL_DOWNLOADS="total downloads"
COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the JCB Global Options, go to the Company tab and add the correct company details there."
COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_JCB_GLOBAL_OPTIONS_GO_TO_THE_COMPANY_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the JCB Global Options, go to the Company tab and add the correct company details there."
+COM_COMPONENTBUILDER_TRASHED="Trashed"
COM_COMPONENTBUILDER_TYPE_ERROR="Type Error"
COM_COMPONENTBUILDER_UNACTIVE_ONLY_FOUR_TEXT_FIELD="Unactive (only 4 text_field)"
COM_COMPONENTBUILDER_UNDERNEATH_TABS="Underneath Tabs"
@@ -4442,6 +5301,8 @@ COM_COMPONENTBUILDER_USE_BATCH_DESC=" Allows users in this group to use batch co
COM_COMPONENTBUILDER_USE_KEY="Use Key"
COM_COMPONENTBUILDER_VDM_NOTICE_BOARD="VDM Notice Board"
COM_COMPONENTBUILDER_VERSION="Version"
+COM_COMPONENTBUILDER_VIEW="View"
+COM_COMPONENTBUILDER_VIEWS="Views"
COM_COMPONENTBUILDER_VIEW_MORE_ISSUES_ON_GITHUB="View more issues on Github"
COM_COMPONENTBUILDER_VIEW_MORE_RELEASES_ON_GITHUB="View more releases on Github"
COM_COMPONENTBUILDER_WEBSITE="Website"
diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini
index 2a16ad8a9..f4fd7fd63 100644
--- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini
+++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini
@@ -77,6 +77,186 @@ COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST="Compiler Dashboard List"
COM_COMPONENTBUILDER_COMPILER_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the Compiler"
COM_COMPONENTBUILDER_COMPILER_SUBMENU="Compiler Submenu"
COM_COMPONENTBUILDER_COMPILER_SUBMENU_DESC="Allows the users in this group to update the submenu of the Compiler"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS="Components Admin Views Access"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_BATCH_USE="Components Admin Views Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_CREATE="Components Admin Views Create"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_DELETE="Components Admin Views Delete"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_DELETE_DESC="Allows the users in this group to delete delete components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT="Components Admin Views Edit"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_CREATED_BY="Components Admin Views Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_CREATED_DATE="Components Admin Views Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_DESC="Allows the users in this group to edit the component admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN="Components Admin Views Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components admin views created by them"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_STATE="Components Admin Views Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component admin views"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_VERSION="Components Admin Views Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_ACCESS="Components Config Access"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_ACCESS_DESC="Allows the users in this group to access access components config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_BATCH_USE="Components Config Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_CREATE="Components Config Create"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_CREATE_DESC="Allows the users in this group to create create components config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_DELETE="Components Config Delete"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_DELETE_DESC="Allows the users in this group to delete delete components config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT="Components Config Edit"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_CREATED_BY="Components Config Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_CREATED_DATE="Components Config Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_DESC="Allows the users in this group to edit the component config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_OWN="Components Config Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_OWN_DESC="Allows the users in this group to edit edit own components config created by them"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_STATE="Components Config Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_STATE_DESC="Allows the users in this group to update the state of the component config"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_VERSION="Components Config Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_CONFIG_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components config"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_ACCESS="Components Custom Admin Menus Access"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_ACCESS_DESC="Allows the users in this group to access access components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_BATCH_USE="Components Custom Admin Menus Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_CREATE="Components Custom Admin Menus Create"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_CREATE_DESC="Allows the users in this group to create create components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_DELETE="Components Custom Admin Menus Delete"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_DELETE_DESC="Allows the users in this group to delete delete components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT="Components Custom Admin Menus Edit"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_CREATED_BY="Components Custom Admin Menus Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_CREATED_DATE="Components Custom Admin Menus Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_DESC="Allows the users in this group to edit the component custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_OWN="Components Custom Admin Menus Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components custom admin menus created by them"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_STATE="Components Custom Admin Menus Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_VERSION="Components Custom Admin Menus Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components custom admin menus"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_ACCESS="Components Custom Admin Views Access"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_BATCH_USE="Components Custom Admin Views Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_CREATE="Components Custom Admin Views Create"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_CREATE_DESC="Allows the users in this group to create create components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_DELETE="Components Custom Admin Views Delete"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_DELETE_DESC="Allows the users in this group to delete delete components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT="Components Custom Admin Views Edit"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_CREATED_BY="Components Custom Admin Views Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_CREATED_DATE="Components Custom Admin Views Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_DESC="Allows the users in this group to edit the component custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_OWN="Components Custom Admin Views Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components custom admin views created by them"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_STATE="Components Custom Admin Views Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_VERSION="Components Custom Admin Views Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components custom admin views"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_ACCESS="Components Dashboard Access"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_ACCESS_DESC="Allows the users in this group to access access components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_BATCH_USE="Components Dashboard Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_CREATE="Components Dashboard Create"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_CREATE_DESC="Allows the users in this group to create create components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_DELETE="Components Dashboard Delete"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_DELETE_DESC="Allows the users in this group to delete delete components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT="Components Dashboard Edit"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_CREATED_BY="Components Dashboard Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_CREATED_DATE="Components Dashboard Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_DESC="Allows the users in this group to edit the component dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_OWN="Components Dashboard Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_OWN_DESC="Allows the users in this group to edit edit own components dashboard created by them"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_STATE="Components Dashboard Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_STATE_DESC="Allows the users in this group to update the state of the component dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_VERSION="Components Dashboard Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components dashboard"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_ACCESS="Components Files Folders Access"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_ACCESS_DESC="Allows the users in this group to access access components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_BATCH_USE="Components Files Folders Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_CREATE="Components Files Folders Create"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_CREATE_DESC="Allows the users in this group to create create components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_DELETE="Components Files Folders Delete"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_DELETE_DESC="Allows the users in this group to delete delete components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT="Components Files Folders Edit"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_CREATED_BY="Components Files Folders Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_CREATED_DATE="Components Files Folders Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_DESC="Allows the users in this group to edit the component files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_OWN="Components Files Folders Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components files folders created by them"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_STATE="Components Files Folders Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component files folders"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION="Components Files Folders Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components files folders"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_ACCESS="Components Mysql Tweaks Access"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_ACCESS_DESC="Allows the users in this group to access access components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_BATCH_USE="Components Mysql Tweaks Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_CREATE="Components Mysql Tweaks Create"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_CREATE_DESC="Allows the users in this group to create create components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_DELETE="Components Mysql Tweaks Delete"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_DELETE_DESC="Allows the users in this group to delete delete components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT="Components Mysql Tweaks Edit"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_CREATED_BY="Components Mysql Tweaks Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_CREATED_DATE="Components Mysql Tweaks Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_DESC="Allows the users in this group to edit the component mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_OWN="Components Mysql Tweaks Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components mysql tweaks created by them"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_STATE="Components Mysql Tweaks Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_VERSION="Components Mysql Tweaks Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components mysql tweaks"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS="Components Site Views Access"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_ACCESS_DESC="Allows the users in this group to access access components site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE="Components Site Views Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_CREATE="Components Site Views Create"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_CREATE_DESC="Allows the users in this group to create create components site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_DELETE="Components Site Views Delete"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_DELETE_DESC="Allows the users in this group to delete delete components site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT="Components Site Views Edit"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_CREATED_BY="Components Site Views Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_CREATED_DATE="Components Site Views Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_DESC="Allows the users in this group to edit the component site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_OWN="Components Site Views Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_OWN_DESC="Allows the users in this group to edit edit own components site views created by them"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_STATE="Components Site Views Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_STATE_DESC="Allows the users in this group to update the state of the component site views"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_VERSION="Components Site Views Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components site views"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_ACCESS="Components Updates Access"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_ACCESS_DESC="Allows the users in this group to access access components updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_BATCH_USE="Components Updates Batch Use"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch components updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_CREATE="Components Updates Create"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_CREATE_DESC="Allows the users in this group to create create components updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_DELETE="Components Updates Delete"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_DELETE_DESC="Allows the users in this group to delete delete components updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT="Components Updates Edit"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_CREATED_BY="Components Updates Edit Created By"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_CREATED_BY_DESC="Allows the users in this group to update the created by of the edit created by components updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_CREATED_DATE="Components Updates Edit Created Date"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_CREATED_DATE_DESC="Allows the users in this group to update the created date of the edit created components updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_DESC="Allows the users in this group to edit the component updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_OWN="Components Updates Edit Own"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_OWN_DESC="Allows the users in this group to edit edit own components updates created by them"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_STATE="Components Updates Edit State"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_STATE_DESC="Allows the users in this group to update the state of the component updates"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_VERSION="Components Updates Edit Version"
+COM_COMPONENTBUILDER_COMPONENTS_UPDATES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version components updates"
COM_COMPONENTBUILDER_CONFIGURATION="Component Builder Configuration"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_ACCESS="Custom Admin Views Access"
COM_COMPONENTBUILDER_CUSTOM_ADMIN_VIEWS_ACCESS_DESC="Allows the users in this group to access access custom admin views"
diff --git a/admin/layouts/admin_fields/fields_above.php b/admin/layouts/admin_fields/fields_above.php
index 9e61e72a7..84cf93e9b 100644
--- a/admin/layouts/admin_fields/fields_above.php
+++ b/admin/layouts/admin_fields/fields_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_above.php
diff --git a/admin/layouts/admin_fields/fields_fullwidth.php b/admin/layouts/admin_fields/fields_fullwidth.php
index c70763c94..f78cda3bc 100644
--- a/admin/layouts/admin_fields/fields_fullwidth.php
+++ b/admin/layouts/admin_fields/fields_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_fullwidth.php
diff --git a/admin/layouts/admin_fields/publishing.php b/admin/layouts/admin_fields/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/admin_fields/publishing.php
+++ b/admin/layouts/admin_fields/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/admin_fields/publlshing.php b/admin/layouts/admin_fields/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/admin_fields/publlshing.php
+++ b/admin/layouts/admin_fields/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/admin_fields_conditions/conditions_above.php b/admin/layouts/admin_fields_conditions/conditions_above.php
index 1c8421ef8..0ade4b2f8 100644
--- a/admin/layouts/admin_fields_conditions/conditions_above.php
+++ b/admin/layouts/admin_fields_conditions/conditions_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage conditions_above.php
diff --git a/admin/layouts/admin_fields_conditions/conditions_fullwidth.php b/admin/layouts/admin_fields_conditions/conditions_fullwidth.php
index 68e5f629c..7031b5a00 100644
--- a/admin/layouts/admin_fields_conditions/conditions_fullwidth.php
+++ b/admin/layouts/admin_fields_conditions/conditions_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage conditions_fullwidth.php
diff --git a/admin/layouts/admin_fields_conditions/publishing.php b/admin/layouts/admin_fields_conditions/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/admin_fields_conditions/publishing.php
+++ b/admin/layouts/admin_fields_conditions/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/admin_fields_conditions/publlshing.php b/admin/layouts/admin_fields_conditions/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/admin_fields_conditions/publlshing.php
+++ b/admin/layouts/admin_fields_conditions/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/admin_view/css_fullwidth.php b/admin/layouts/admin_view/css_fullwidth.php
index 98c56d307..f4278dd76 100644
--- a/admin/layouts/admin_view/css_fullwidth.php
+++ b/admin/layouts/admin_view/css_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage css_fullwidth.php
diff --git a/admin/layouts/admin_view/custom_buttons_fullwidth.php b/admin/layouts/admin_view/custom_buttons_fullwidth.php
index 524507c63..c1f1fad70 100644
--- a/admin/layouts/admin_view/custom_buttons_fullwidth.php
+++ b/admin/layouts/admin_view/custom_buttons_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_fullwidth.php
diff --git a/admin/layouts/admin_view/custom_buttons_left.php b/admin/layouts/admin_view/custom_buttons_left.php
index 1943b6a00..b4f873c84 100644
--- a/admin/layouts/admin_view/custom_buttons_left.php
+++ b/admin/layouts/admin_view/custom_buttons_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_left.php
diff --git a/admin/layouts/admin_view/custom_import_fullwidth.php b/admin/layouts/admin_view/custom_import_fullwidth.php
index 5c54400db..f535db2f6 100644
--- a/admin/layouts/admin_view/custom_import_fullwidth.php
+++ b/admin/layouts/admin_view/custom_import_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_import_fullwidth.php
diff --git a/admin/layouts/admin_view/details_above.php b/admin/layouts/admin_view/details_above.php
index c3abf1866..759c1e10c 100644
--- a/admin/layouts/admin_view/details_above.php
+++ b/admin/layouts/admin_view/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/admin_view/details_left.php b/admin/layouts/admin_view/details_left.php
index beeeb1249..9a873c882 100644
--- a/admin/layouts/admin_view/details_left.php
+++ b/admin/layouts/admin_view/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/admin_view/details_right.php b/admin/layouts/admin_view/details_right.php
index c9eb90ea3..74d44185c 100644
--- a/admin/layouts/admin_view/details_right.php
+++ b/admin/layouts/admin_view/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/admin_view/details_under.php b/admin/layouts/admin_view/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/admin_view/details_under.php
+++ b/admin/layouts/admin_view/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/admin_view/fields_conditions_fullwidth.php b/admin/layouts/admin_view/fields_conditions_fullwidth.php
index 4746a0da3..013c4d01b 100644
--- a/admin/layouts/admin_view/fields_conditions_fullwidth.php
+++ b/admin/layouts/admin_view/fields_conditions_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_conditions_fullwidth.php
diff --git a/admin/layouts/admin_view/fields_conditions_left.php b/admin/layouts/admin_view/fields_conditions_left.php
index 45454fb0c..fc367e9da 100644
--- a/admin/layouts/admin_view/fields_conditions_left.php
+++ b/admin/layouts/admin_view/fields_conditions_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_conditions_left.php
diff --git a/admin/layouts/admin_view/fields_conditions_right.php b/admin/layouts/admin_view/fields_conditions_right.php
index ffcc671de..8713fb471 100644
--- a/admin/layouts/admin_view/fields_conditions_right.php
+++ b/admin/layouts/admin_view/fields_conditions_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_conditions_right.php
diff --git a/admin/layouts/admin_view/javascript_fullwidth.php b/admin/layouts/admin_view/javascript_fullwidth.php
index d0c7bab24..13b6d36fd 100644
--- a/admin/layouts/admin_view/javascript_fullwidth.php
+++ b/admin/layouts/admin_view/javascript_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage javascript_fullwidth.php
diff --git a/admin/layouts/admin_view/linked_components_fullwidth.php b/admin/layouts/admin_view/linked_components_fullwidth.php
deleted file mode 100644
index 4745da795..000000000
--- a/admin/layouts/admin_view/linked_components_fullwidth.php
+++ /dev/null
@@ -1,138 +0,0 @@
-
- @copyright Copyright (C) 2015. All Rights Reserved
- @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
-
- Builds Complex Joomla Components
-
-/-----------------------------------------------------------------------------------------------------------------------------*/
-
-// No direct access to this file
-
-defined('_JEXEC') or die('Restricted access');
-
-// set the defaults
-$items = $displayData->vxzlinked_components;
-$user = JFactory::getUser();
-$id = $displayData->item->id;
-$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
-
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $item): ?>
- authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
- $userChkOut = JFactory::getUser($item->checked_out);
- $canDo = ComponentbuilderHelper::getActions('joomla_component',$item,'joomla_components');
- ?>
-
-
- get('joomla_component.edit')): ?>
- escape($item->system_name); ?>
- checked_out): ?>
- name, $item->checked_out_time, 'joomla_components.', $canCheckin); ?>
-
-
- escape($item->system_name); ?>
-
-
-
- escape($item->name_code); ?>
-
-
- escape($item->component_version); ?>
-
-
- escape($item->short_description); ?>
-
-
- escape($item->companyname); ?>
-
-
- escape($item->author); ?>
-
- published == 1):?>
-
-
-
-
-
- published == 0):?>
-
-
-
-
-
- published == 2):?>
-
-
-
-
-
- published == -2):?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/admin/layouts/admin_view/mysql_fullwidth.php b/admin/layouts/admin_view/mysql_fullwidth.php
index 861df5159..f0602b0bc 100644
--- a/admin/layouts/admin_view/mysql_fullwidth.php
+++ b/admin/layouts/admin_view/mysql_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage mysql_fullwidth.php
diff --git a/admin/layouts/admin_view/mysql_left.php b/admin/layouts/admin_view/mysql_left.php
index f857eb5bd..d7ff8d593 100644
--- a/admin/layouts/admin_view/mysql_left.php
+++ b/admin/layouts/admin_view/mysql_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage mysql_left.php
diff --git a/admin/layouts/admin_view/php_fullwidth.php b/admin/layouts/admin_view/php_fullwidth.php
index b2ec70ebc..48d1a10ad 100644
--- a/admin/layouts/admin_view/php_fullwidth.php
+++ b/admin/layouts/admin_view/php_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage php_fullwidth.php
diff --git a/admin/layouts/admin_view/publishing.php b/admin/layouts/admin_view/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/admin_view/publishing.php
+++ b/admin/layouts/admin_view/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/admin_view/publlshing.php b/admin/layouts/admin_view/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/admin_view/publlshing.php
+++ b/admin/layouts/admin_view/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/admin_view/settings_fullwidth.php b/admin/layouts/admin_view/settings_fullwidth.php
index 449100827..7d59f72d4 100644
--- a/admin/layouts/admin_view/settings_fullwidth.php
+++ b/admin/layouts/admin_view/settings_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_fullwidth.php
diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php
index e5f637e40..09ed8f8fc 100644
--- a/admin/layouts/batchselection.php
+++ b/admin/layouts/batchselection.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage batchselection.php
diff --git a/admin/layouts/component_admin_views/index.html b/admin/layouts/component_admin_views/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_admin_views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_admin_views/publishing.php b/admin/layouts/component_admin_views/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_admin_views/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_admin_views/publlshing.php b/admin/layouts/component_admin_views/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_admin_views/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/language_translation/details_above.php b/admin/layouts/component_admin_views/views_above.php
similarity index 93%
rename from admin/layouts/language_translation/details_above.php
rename to admin/layouts/component_admin_views/views_above.php
index 1af7819cb..4fcb6e5c1 100644
--- a/admin/layouts/language_translation/details_above.php
+++ b/admin/layouts/component_admin_views/views_above.php
@@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
- @subpackage details_above.php
+ @subpackage views_above.php
@author Llewellyn van der Merwe
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = array(
- 'components'
+ 'joomla_component'
);
?>
diff --git a/admin/layouts/component_admin_views/views_fullwidth.php b/admin/layouts/component_admin_views/views_fullwidth.php
new file mode 100644
index 000000000..b83507eda
--- /dev/null
+++ b/admin/layouts/component_admin_views/views_fullwidth.php
@@ -0,0 +1,49 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_on_admin_views',
+ 'addadmin_views'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_config/index.html b/admin/layouts/component_config/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_config/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_config/publishing.php b/admin/layouts/component_config/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_config/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_config/publlshing.php b/admin/layouts/component_config/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_config/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_config/tweaks_above.php b/admin/layouts/component_config/tweaks_above.php
new file mode 100644
index 000000000..1cf1fb850
--- /dev/null
+++ b/admin/layouts/component_config/tweaks_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_config/tweaks_fullwidth.php b/admin/layouts/component_config/tweaks_fullwidth.php
new file mode 100644
index 000000000..f69325b7d
--- /dev/null
+++ b/admin/layouts/component_config/tweaks_fullwidth.php
@@ -0,0 +1,48 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'addconfig'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_custom_admin_menus/index.html b/admin/layouts/component_custom_admin_menus/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_custom_admin_menus/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_custom_admin_menus/publishing.php b/admin/layouts/component_custom_admin_menus/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_custom_admin_menus/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_custom_admin_menus/publlshing.php b/admin/layouts/component_custom_admin_menus/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_custom_admin_menus/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_custom_admin_menus/tweaks_above.php b/admin/layouts/component_custom_admin_menus/tweaks_above.php
new file mode 100644
index 000000000..1cf1fb850
--- /dev/null
+++ b/admin/layouts/component_custom_admin_menus/tweaks_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_custom_admin_menus/tweaks_fullwidth.php b/admin/layouts/component_custom_admin_menus/tweaks_fullwidth.php
new file mode 100644
index 000000000..5a9713b5b
--- /dev/null
+++ b/admin/layouts/component_custom_admin_menus/tweaks_fullwidth.php
@@ -0,0 +1,48 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'addcustommenus'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_custom_admin_views/index.html b/admin/layouts/component_custom_admin_views/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_custom_admin_views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_custom_admin_views/publishing.php b/admin/layouts/component_custom_admin_views/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_custom_admin_views/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_custom_admin_views/publlshing.php b/admin/layouts/component_custom_admin_views/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_custom_admin_views/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_custom_admin_views/views_above.php b/admin/layouts/component_custom_admin_views/views_above.php
new file mode 100644
index 000000000..4fcb6e5c1
--- /dev/null
+++ b/admin/layouts/component_custom_admin_views/views_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_custom_admin_views/views_fullwidth.php b/admin/layouts/component_custom_admin_views/views_fullwidth.php
new file mode 100644
index 000000000..5651212b6
--- /dev/null
+++ b/admin/layouts/component_custom_admin_views/views_fullwidth.php
@@ -0,0 +1,49 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_on_custom_admin_views',
+ 'addcustom_admin_views'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_dashboard/dashboard_above.php b/admin/layouts/component_dashboard/dashboard_above.php
new file mode 100644
index 000000000..7761a3ad2
--- /dev/null
+++ b/admin/layouts/component_dashboard/dashboard_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_dashboard/dashboard_fullwidth.php b/admin/layouts/component_dashboard/dashboard_fullwidth.php
new file mode 100644
index 000000000..7bce81e6f
--- /dev/null
+++ b/admin/layouts/component_dashboard/dashboard_fullwidth.php
@@ -0,0 +1,49 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'php_dashboard_methods',
+ 'dashboard_tab'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_dashboard/index.html b/admin/layouts/component_dashboard/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_dashboard/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_dashboard/publishing.php b/admin/layouts/component_dashboard/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_dashboard/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_dashboard/publlshing.php b/admin/layouts/component_dashboard/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_dashboard/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_files_folders/index.html b/admin/layouts/component_files_folders/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_files_folders/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_files_folders/publishing.php b/admin/layouts/component_files_folders/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_files_folders/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_files_folders/publlshing.php b/admin/layouts/component_files_folders/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_files_folders/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_files_folders/settings_above.php b/admin/layouts/component_files_folders/settings_above.php
new file mode 100644
index 000000000..a429f2f6d
--- /dev/null
+++ b/admin/layouts/component_files_folders/settings_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_files_folders/settings_fullwidth.php b/admin/layouts/component_files_folders/settings_fullwidth.php
new file mode 100644
index 000000000..dc5894ccf
--- /dev/null
+++ b/admin/layouts/component_files_folders/settings_fullwidth.php
@@ -0,0 +1,51 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_add_files',
+ 'addfiles',
+ 'note_add_folders',
+ 'addfolders'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_mysql_tweaks/index.html b/admin/layouts/component_mysql_tweaks/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_mysql_tweaks/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_mysql_tweaks/publishing.php b/admin/layouts/component_mysql_tweaks/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_mysql_tweaks/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_mysql_tweaks/publlshing.php b/admin/layouts/component_mysql_tweaks/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_mysql_tweaks/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_mysql_tweaks/tweaks_above.php b/admin/layouts/component_mysql_tweaks/tweaks_above.php
new file mode 100644
index 000000000..1cf1fb850
--- /dev/null
+++ b/admin/layouts/component_mysql_tweaks/tweaks_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_mysql_tweaks/tweaks_fullwidth.php b/admin/layouts/component_mysql_tweaks/tweaks_fullwidth.php
new file mode 100644
index 000000000..2ae0bda5b
--- /dev/null
+++ b/admin/layouts/component_mysql_tweaks/tweaks_fullwidth.php
@@ -0,0 +1,48 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'sql_tweak'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_site_views/index.html b/admin/layouts/component_site_views/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_site_views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_site_views/publishing.php b/admin/layouts/component_site_views/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_site_views/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_site_views/publlshing.php b/admin/layouts/component_site_views/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_site_views/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_site_views/views_above.php b/admin/layouts/component_site_views/views_above.php
new file mode 100644
index 000000000..4fcb6e5c1
--- /dev/null
+++ b/admin/layouts/component_site_views/views_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_site_views/views_fullwidth.php b/admin/layouts/component_site_views/views_fullwidth.php
new file mode 100644
index 000000000..50fe4c8e5
--- /dev/null
+++ b/admin/layouts/component_site_views/views_fullwidth.php
@@ -0,0 +1,49 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_on_site_views',
+ 'addsite_views'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/component_updates/index.html b/admin/layouts/component_updates/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/layouts/component_updates/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/layouts/component_updates/publishing.php b/admin/layouts/component_updates/publishing.php
new file mode 100644
index 000000000..fc48afcf3
--- /dev/null
+++ b/admin/layouts/component_updates/publishing.php
@@ -0,0 +1,58 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'created',
+ 'created_by',
+ 'modified',
+ 'modified_by'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_updates/publlshing.php b/admin/layouts/component_updates/publlshing.php
new file mode 100644
index 000000000..8bc963975
--- /dev/null
+++ b/admin/layouts/component_updates/publlshing.php
@@ -0,0 +1,60 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$app = JFactory::getApplication();
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'published',
+ 'ordering',
+ 'access',
+ 'version',
+ 'hits',
+ 'id'
+);
+
+$hiddenFields = $displayData->get('hidden_fields') ?: array();
+
+foreach ($fields as $field)
+{
+ $field = is_array($field) ? $field : array($field);
+ foreach ($field as $f)
+ {
+ if ($form->getField($f))
+ {
+ if (in_array($f, $hiddenFields))
+ {
+ $form->setFieldAttribute($f, 'type', 'hidden');
+ }
+
+ echo $form->renderField($f);
+ break;
+ }
+ }
+}
diff --git a/admin/layouts/component_updates/updates_above.php b/admin/layouts/component_updates/updates_above.php
new file mode 100644
index 000000000..d5bd4bdce
--- /dev/null
+++ b/admin/layouts/component_updates/updates_above.php
@@ -0,0 +1,41 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = array(
+ 'joomla_component'
+);
+
+?>
+
+ renderField($field);
+ } ?>
+
diff --git a/admin/layouts/component_updates/updates_fullwidth.php b/admin/layouts/component_updates/updates_fullwidth.php
new file mode 100644
index 000000000..6312b7a7a
--- /dev/null
+++ b/admin/layouts/component_updates/updates_fullwidth.php
@@ -0,0 +1,48 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'version_update'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php
index 31bc44240..8a129fe2e 100644
--- a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php
+++ b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_fullwidth.php
diff --git a/admin/layouts/custom_admin_view/custom_buttons_left.php b/admin/layouts/custom_admin_view/custom_buttons_left.php
index 1943b6a00..b4f873c84 100644
--- a/admin/layouts/custom_admin_view/custom_buttons_left.php
+++ b/admin/layouts/custom_admin_view/custom_buttons_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_left.php
diff --git a/admin/layouts/custom_admin_view/custom_script_fullwidth.php b/admin/layouts/custom_admin_view/custom_script_fullwidth.php
index 025b27fd0..00dc0557f 100644
--- a/admin/layouts/custom_admin_view/custom_script_fullwidth.php
+++ b/admin/layouts/custom_admin_view/custom_script_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_script_fullwidth.php
diff --git a/admin/layouts/custom_admin_view/details_above.php b/admin/layouts/custom_admin_view/details_above.php
index c3abf1866..759c1e10c 100644
--- a/admin/layouts/custom_admin_view/details_above.php
+++ b/admin/layouts/custom_admin_view/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/custom_admin_view/details_fullwidth.php b/admin/layouts/custom_admin_view/details_fullwidth.php
index 21b529eed..e36e76c00 100644
--- a/admin/layouts/custom_admin_view/details_fullwidth.php
+++ b/admin/layouts/custom_admin_view/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/custom_admin_view/details_left.php b/admin/layouts/custom_admin_view/details_left.php
index 356259a6e..681d2f1ac 100644
--- a/admin/layouts/custom_admin_view/details_left.php
+++ b/admin/layouts/custom_admin_view/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/custom_admin_view/details_right.php b/admin/layouts/custom_admin_view/details_right.php
index cea59422e..8443b113b 100644
--- a/admin/layouts/custom_admin_view/details_right.php
+++ b/admin/layouts/custom_admin_view/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/custom_admin_view/details_rightside.php b/admin/layouts/custom_admin_view/details_rightside.php
index 2feb0423b..25581f16c 100644
--- a/admin/layouts/custom_admin_view/details_rightside.php
+++ b/admin/layouts/custom_admin_view/details_rightside.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_rightside.php
diff --git a/admin/layouts/custom_admin_view/details_under.php b/admin/layouts/custom_admin_view/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/custom_admin_view/details_under.php
+++ b/admin/layouts/custom_admin_view/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/custom_admin_view/linked_components_fullwidth.php b/admin/layouts/custom_admin_view/linked_components_fullwidth.php
index eddee645d..86bafd684 100644
--- a/admin/layouts/custom_admin_view/linked_components_fullwidth.php
+++ b/admin/layouts/custom_admin_view/linked_components_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage linked_components_fullwidth.php
@@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
-$items = $displayData->vyjlinked_components;
+$items = $displayData->vyelinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
@@ -100,26 +100,26 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
published == 1):?>
-
-
+
+
published == 0):?>
-
-
+
+
published == 2):?>
-
-
+
+
published == -2):?>
-
-
+
+
diff --git a/admin/layouts/custom_admin_view/publishing.php b/admin/layouts/custom_admin_view/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/custom_admin_view/publishing.php
+++ b/admin/layouts/custom_admin_view/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/custom_admin_view/publlshing.php b/admin/layouts/custom_admin_view/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/custom_admin_view/publlshing.php
+++ b/admin/layouts/custom_admin_view/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/custom_code/details_above.php b/admin/layouts/custom_code/details_above.php
index 185c82ce8..b24ebca7b 100644
--- a/admin/layouts/custom_code/details_above.php
+++ b/admin/layouts/custom_code/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/custom_code/details_fullwidth.php b/admin/layouts/custom_code/details_fullwidth.php
index a9f1bcabc..c2542935a 100644
--- a/admin/layouts/custom_code/details_fullwidth.php
+++ b/admin/layouts/custom_code/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/custom_code/details_left.php b/admin/layouts/custom_code/details_left.php
index 4593d0445..e73cb141b 100644
--- a/admin/layouts/custom_code/details_left.php
+++ b/admin/layouts/custom_code/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/custom_code/details_right.php b/admin/layouts/custom_code/details_right.php
index 4c691af70..2e88ca35e 100644
--- a/admin/layouts/custom_code/details_right.php
+++ b/admin/layouts/custom_code/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/custom_code/details_under.php b/admin/layouts/custom_code/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/custom_code/details_under.php
+++ b/admin/layouts/custom_code/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/custom_code/publishing.php b/admin/layouts/custom_code/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/custom_code/publishing.php
+++ b/admin/layouts/custom_code/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/custom_code/publlshing.php b/admin/layouts/custom_code/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/custom_code/publlshing.php
+++ b/admin/layouts/custom_code/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/dynamic_get/abacus_fullwidth.php b/admin/layouts/dynamic_get/abacus_fullwidth.php
index bc2352829..1f7e5f99d 100644
--- a/admin/layouts/dynamic_get/abacus_fullwidth.php
+++ b/admin/layouts/dynamic_get/abacus_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage abacus_fullwidth.php
diff --git a/admin/layouts/dynamic_get/abacus_left.php b/admin/layouts/dynamic_get/abacus_left.php
index 30be370b9..f2c271025 100644
--- a/admin/layouts/dynamic_get/abacus_left.php
+++ b/admin/layouts/dynamic_get/abacus_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage abacus_left.php
diff --git a/admin/layouts/dynamic_get/custom_script_fullwidth.php b/admin/layouts/dynamic_get/custom_script_fullwidth.php
index 8805741e7..e02480e1d 100644
--- a/admin/layouts/dynamic_get/custom_script_fullwidth.php
+++ b/admin/layouts/dynamic_get/custom_script_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_script_fullwidth.php
diff --git a/admin/layouts/dynamic_get/joint_fullwidth.php b/admin/layouts/dynamic_get/joint_fullwidth.php
index e48658bf3..9c930a2b9 100644
--- a/admin/layouts/dynamic_get/joint_fullwidth.php
+++ b/admin/layouts/dynamic_get/joint_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage joint_fullwidth.php
diff --git a/admin/layouts/dynamic_get/main_above.php b/admin/layouts/dynamic_get/main_above.php
index 883efc488..70eada551 100644
--- a/admin/layouts/dynamic_get/main_above.php
+++ b/admin/layouts/dynamic_get/main_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage main_above.php
diff --git a/admin/layouts/dynamic_get/main_fullwidth.php b/admin/layouts/dynamic_get/main_fullwidth.php
index 2c4e298db..3d800b7a2 100644
--- a/admin/layouts/dynamic_get/main_fullwidth.php
+++ b/admin/layouts/dynamic_get/main_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage main_fullwidth.php
diff --git a/admin/layouts/dynamic_get/main_left.php b/admin/layouts/dynamic_get/main_left.php
index b2e0c254e..5667ea8d2 100644
--- a/admin/layouts/dynamic_get/main_left.php
+++ b/admin/layouts/dynamic_get/main_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage main_left.php
diff --git a/admin/layouts/dynamic_get/main_under.php b/admin/layouts/dynamic_get/main_under.php
index 7963b0e95..3e1dedd1c 100644
--- a/admin/layouts/dynamic_get/main_under.php
+++ b/admin/layouts/dynamic_get/main_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage main_under.php
diff --git a/admin/layouts/dynamic_get/publishing.php b/admin/layouts/dynamic_get/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/dynamic_get/publishing.php
+++ b/admin/layouts/dynamic_get/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/dynamic_get/publlshing.php b/admin/layouts/dynamic_get/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/dynamic_get/publlshing.php
+++ b/admin/layouts/dynamic_get/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/dynamic_get/tweak_fullwidth.php b/admin/layouts/dynamic_get/tweak_fullwidth.php
new file mode 100644
index 000000000..98633b3b3
--- /dev/null
+++ b/admin/layouts/dynamic_get/tweak_fullwidth.php
@@ -0,0 +1,51 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'filter',
+ 'where',
+ 'order',
+ 'global'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/field/details_fullwidth.php b/admin/layouts/field/details_fullwidth.php
index a1ebb183b..e1127edbd 100644
--- a/admin/layouts/field/details_fullwidth.php
+++ b/admin/layouts/field/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/field/details_left.php b/admin/layouts/field/details_left.php
index 559c834e0..226325cae 100644
--- a/admin/layouts/field/details_left.php
+++ b/admin/layouts/field/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/field/details_right.php b/admin/layouts/field/details_right.php
index 20d2a7278..cdda55c57 100644
--- a/admin/layouts/field/details_right.php
+++ b/admin/layouts/field/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/field/details_under.php b/admin/layouts/field/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/field/details_under.php
+++ b/admin/layouts/field/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/field/publishing.php b/admin/layouts/field/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/field/publishing.php
+++ b/admin/layouts/field/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/field/publlshing.php b/admin/layouts/field/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/field/publlshing.php
+++ b/admin/layouts/field/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/field/scripts_left.php b/admin/layouts/field/scripts_left.php
index 260d306f6..8b1fe3722 100644
--- a/admin/layouts/field/scripts_left.php
+++ b/admin/layouts/field/scripts_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage scripts_left.php
diff --git a/admin/layouts/field/scripts_right.php b/admin/layouts/field/scripts_right.php
index d910ef3f8..09e0bbc13 100644
--- a/admin/layouts/field/scripts_right.php
+++ b/admin/layouts/field/scripts_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage scripts_right.php
diff --git a/admin/layouts/fieldtype/details_fullwidth.php b/admin/layouts/fieldtype/details_fullwidth.php
index dc37cfa90..2fbe36bd6 100644
--- a/admin/layouts/fieldtype/details_fullwidth.php
+++ b/admin/layouts/fieldtype/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/fieldtype/details_left.php b/admin/layouts/fieldtype/details_left.php
index 7edd5c76b..cad20310a 100644
--- a/admin/layouts/fieldtype/details_left.php
+++ b/admin/layouts/fieldtype/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/fieldtype/details_right.php b/admin/layouts/fieldtype/details_right.php
index d485a61cc..486b38628 100644
--- a/admin/layouts/fieldtype/details_right.php
+++ b/admin/layouts/fieldtype/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php
index e648ba43e..d247159e5 100644
--- a/admin/layouts/fieldtype/fields_fullwidth.php
+++ b/admin/layouts/fieldtype/fields_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields_fullwidth.php
@@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
-$items = $displayData->wabfields;
+$items = $displayData->vzwfields;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";
@@ -116,26 +116,26 @@ $can = ComponentbuilderHelper::getActions('field');
published == 1):?>
-
-
+
+
published == 0):?>
-
-
+
+
published == 2):?>
-
-
+
+
published == -2):?>
-
-
+
+
diff --git a/admin/layouts/fieldtype/publishing.php b/admin/layouts/fieldtype/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/fieldtype/publishing.php
+++ b/admin/layouts/fieldtype/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/fieldtype/publlshing.php b/admin/layouts/fieldtype/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/fieldtype/publlshing.php
+++ b/admin/layouts/fieldtype/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/ftp/details_above.php b/admin/layouts/ftp/details_above.php
index 63a78bd5a..b5b343521 100644
--- a/admin/layouts/ftp/details_above.php
+++ b/admin/layouts/ftp/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/ftp/details_fullwidth.php b/admin/layouts/ftp/details_fullwidth.php
index 4efc112fd..f069476ce 100644
--- a/admin/layouts/ftp/details_fullwidth.php
+++ b/admin/layouts/ftp/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/ftp/linked_components_fullwidth.php b/admin/layouts/ftp/linked_components_fullwidth.php
index 8fbecd518..d2cc2e319 100644
--- a/admin/layouts/ftp/linked_components_fullwidth.php
+++ b/admin/layouts/ftp/linked_components_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage linked_components_fullwidth.php
@@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
-$items = $displayData->waclinked_components;
+$items = $displayData->vzxlinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
@@ -100,26 +100,26 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
published == 1):?>
-
-
+
+
published == 0):?>
-
-
+
+
published == 2):?>
-
-
+
+
published == -2):?>
-
-
+
+
diff --git a/admin/layouts/ftp/publishing.php b/admin/layouts/ftp/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/ftp/publishing.php
+++ b/admin/layouts/ftp/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/ftp/publlshing.php b/admin/layouts/ftp/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/ftp/publlshing.php
+++ b/admin/layouts/ftp/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php
index 2f4a2fe4f..0e14bbd43 100644
--- a/admin/layouts/help_document/details_above.php
+++ b/admin/layouts/help_document/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php
index c21aa69f1..866af2b99 100644
--- a/admin/layouts/help_document/details_fullwidth.php
+++ b/admin/layouts/help_document/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php
index a36ceed8d..86dd65b8e 100644
--- a/admin/layouts/help_document/details_left.php
+++ b/admin/layouts/help_document/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php
index 6e6d6c87b..b660b68ae 100644
--- a/admin/layouts/help_document/details_right.php
+++ b/admin/layouts/help_document/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/help_document/details_under.php
+++ b/admin/layouts/help_document/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/help_document/publishing.php
+++ b/admin/layouts/help_document/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/help_document/publlshing.php
+++ b/admin/layouts/help_document/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/joomla_component/admin_views_fullwidth.php b/admin/layouts/joomla_component/admin_views_fullwidth.php
index affd61f9e..55de303fb 100644
--- a/admin/layouts/joomla_component/admin_views_fullwidth.php
+++ b/admin/layouts/joomla_component/admin_views_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views_fullwidth.php
@@ -27,106 +27,23 @@
defined('_JEXEC') or die('Restricted access');
-// set the defaults
-$items = $displayData->vwnadmin_views;
-$user = JFactory::getUser();
-$id = $displayData->item->id;
-$edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit";
-$ref = ($id) ? "&ref=joomla_component&refid=".$id : "";
-$new = "index.php?option=com_componentbuilder&view=admin_view&layout=edit".$ref;
-$can = ComponentbuilderHelper::getActions('admin_view');
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_on_admin_views',
+ 'note_display_component_admin_views'
+);
?>
-get('admin_view.create')): ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $item): ?>
- authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
- $userChkOut = JFactory::getUser($item->checked_out);
- $canDo = ComponentbuilderHelper::getActions('admin_view',$item,'admin_views');
- ?>
-
-
- get('admin_view.edit')): ?>
- escape($item->system_name); ?>
- checked_out): ?>
- name, $item->checked_out_time, 'admin_views.', $canCheckin); ?>
-
-
- escape($item->system_name); ?>
-
-
-
- escape($item->name_single); ?>
-
-
- escape($item->name_list); ?>
-
-
- escape($item->short_description); ?>
-
- published == 1):?>
-
-
-
-
-
- published == 0):?>
-
-
-
-
-
- published == 2):?>
-
-
-
-
-
- published == -2):?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
diff --git a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php
index c8ef5d768..332c58cca 100644
--- a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php
+++ b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_admin_views_fullwidth.php
@@ -27,112 +27,23 @@
defined('_JEXEC') or die('Restricted access');
-// set the defaults
-$items = $displayData->vwocustom_admin_views;
-$user = JFactory::getUser();
-$id = $displayData->item->id;
-$edit = "index.php?option=com_componentbuilder&view=custom_admin_views&task=custom_admin_view.edit";
-$ref = ($id) ? "&ref=joomla_component&refid=".$id : "";
-$new = "index.php?option=com_componentbuilder&view=custom_admin_view&layout=edit".$ref;
-$can = ComponentbuilderHelper::getActions('custom_admin_view');
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_on_custom_admin_views',
+ 'note_display_component_custom_admin_views'
+);
?>
-get('core.create')): ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $item): ?>
- authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
- $userChkOut = JFactory::getUser($item->checked_out);
- $canDo = ComponentbuilderHelper::getActions('custom_admin_view',$item,'custom_admin_views');
- ?>
-
-
- get('core.edit')): ?>
- escape($item->system_name); ?>
- checked_out): ?>
- name, $item->checked_out_time, 'custom_admin_views.', $canCheckin); ?>
-
-
- escape($item->system_name); ?>
-
-
-
- escape($item->name); ?>
-
-
- escape($item->codename); ?>
-
-
- escape($item->description); ?>
-
-
- escape($item->snippet_name); ?>
-
- published == 1):?>
-
-
-
-
-
- published == 0):?>
-
-
-
-
-
- published == 2):?>
-
-
-
-
-
- published == -2):?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
diff --git a/admin/layouts/joomla_component/details_above.php b/admin/layouts/joomla_component/details_above.php
index c3abf1866..759c1e10c 100644
--- a/admin/layouts/joomla_component/details_above.php
+++ b/admin/layouts/joomla_component/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/joomla_component/details_left.php b/admin/layouts/joomla_component/details_left.php
index 6de7dd96a..79c667065 100644
--- a/admin/layouts/joomla_component/details_left.php
+++ b/admin/layouts/joomla_component/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
@@ -33,7 +33,6 @@ $fields = $displayData->get('fields') ?: array(
'name',
'name_code',
'component_version',
- 'version_update',
'debug_linenr',
'add_placeholders',
'mvc_versiondate',
diff --git a/admin/layouts/joomla_component/details_right.php b/admin/layouts/joomla_component/details_right.php
index 39721c8f3..3e6612956 100644
--- a/admin/layouts/joomla_component/details_right.php
+++ b/admin/layouts/joomla_component/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/joomla_component/details_under.php b/admin/layouts/joomla_component/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/joomla_component/details_under.php
+++ b/admin/layouts/joomla_component/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php
index 61c9b35ab..8a4b9cd38 100644
--- a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php
+++ b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_build_beta_fullwidth.php
diff --git a/admin/layouts/joomla_component/dynamic_integration_fullwidth.php b/admin/layouts/joomla_component/dynamic_integration_fullwidth.php
index 33e0137a1..7b783d167 100644
--- a/admin/layouts/joomla_component/dynamic_integration_fullwidth.php
+++ b/admin/layouts/joomla_component/dynamic_integration_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamic_integration_fullwidth.php
diff --git a/admin/layouts/joomla_component/libs_helpers_fullwidth.php b/admin/layouts/joomla_component/libs_helpers_fullwidth.php
index c4914ff90..200351bf8 100644
--- a/admin/layouts/joomla_component/libs_helpers_fullwidth.php
+++ b/admin/layouts/joomla_component/libs_helpers_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage libs_helpers_fullwidth.php
diff --git a/admin/layouts/joomla_component/metadata.php b/admin/layouts/joomla_component/metadata.php
index 174f1a19b..354812f5a 100644
--- a/admin/layouts/joomla_component/metadata.php
+++ b/admin/layouts/joomla_component/metadata.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage metadata.php
diff --git a/admin/layouts/joomla_component/mysql_fullwidth.php b/admin/layouts/joomla_component/mysql_fullwidth.php
index f9c2695f6..26adc0e40 100644
--- a/admin/layouts/joomla_component/mysql_fullwidth.php
+++ b/admin/layouts/joomla_component/mysql_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage mysql_fullwidth.php
diff --git a/admin/layouts/joomla_component/php_fullwidth.php b/admin/layouts/joomla_component/php_fullwidth.php
index b64ec0ccd..c31cee3cc 100644
--- a/admin/layouts/joomla_component/php_fullwidth.php
+++ b/admin/layouts/joomla_component/php_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage php_fullwidth.php
@@ -30,9 +30,6 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
- 'add_php_dashboard_methods',
- 'php_dashboard_methods',
- 'dashboard_tab',
'add_php_preflight_install',
'php_preflight_install',
'add_php_preflight_update',
diff --git a/admin/layouts/dynamic_get/main_right.php b/admin/layouts/joomla_component/php_left.php
similarity index 92%
rename from admin/layouts/dynamic_get/main_right.php
rename to admin/layouts/joomla_component/php_left.php
index 073d79db6..5eb10394a 100644
--- a/admin/layouts/dynamic_get/main_right.php
+++ b/admin/layouts/joomla_component/php_left.php
@@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
- @subpackage main_right.php
+ @subpackage php_left.php
@author Llewellyn van der Merwe
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@@ -30,10 +30,7 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
- 'filter',
- 'where',
- 'order',
- 'global'
+ 'note_botton_component_dashboard'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/layouts/joomla_component/publishing.php b/admin/layouts/joomla_component/publishing.php
index 90be72273..b0e961c2c 100644
--- a/admin/layouts/joomla_component/publishing.php
+++ b/admin/layouts/joomla_component/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/joomla_component/readme_left.php b/admin/layouts/joomla_component/readme_left.php
index 3e2221aff..73f91748f 100644
--- a/admin/layouts/joomla_component/readme_left.php
+++ b/admin/layouts/joomla_component/readme_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage readme_left.php
diff --git a/admin/layouts/joomla_component/readme_right.php b/admin/layouts/joomla_component/readme_right.php
index 3fa3b302b..b71dd4e8f 100644
--- a/admin/layouts/joomla_component/readme_right.php
+++ b/admin/layouts/joomla_component/readme_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage readme_right.php
diff --git a/admin/layouts/joomla_component/settings_fullwidth.php b/admin/layouts/joomla_component/settings_fullwidth.php
new file mode 100644
index 000000000..5eef11dee
--- /dev/null
+++ b/admin/layouts/joomla_component/settings_fullwidth.php
@@ -0,0 +1,52 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+
+defined('_JEXEC') or die('Restricted access');
+
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'spacer_hr_f',
+ 'note_on_contributors',
+ 'addcontributors',
+ 'emptycontributors',
+ 'number'
+);
+
+?>
+
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
+
diff --git a/admin/layouts/joomla_component/settings_left.php b/admin/layouts/joomla_component/settings_left.php
index 0bdc0287a..c4f12df87 100644
--- a/admin/layouts/joomla_component/settings_left.php
+++ b/admin/layouts/joomla_component/settings_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_left.php
@@ -30,19 +30,13 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
- 'note_on_views',
- 'addadmin_views',
- 'addcustom_admin_views',
- 'addsite_views',
+ 'note_moved_views',
'spacer_hr_a',
'note_mysql_tweak_options',
- 'sql_tweak',
'spacer_hr_b',
'note_add_custom_menus',
- 'addcustommenus',
'spacer_hr_c',
- 'note_add_config',
- 'addconfig'
+ 'note_add_config'
);
$hiddenFields = $displayData->get('hidden_fields') ?: array();
diff --git a/admin/layouts/joomla_component/settings_right.php b/admin/layouts/joomla_component/settings_right.php
index a27ecca0e..567ff02b1 100644
--- a/admin/layouts/joomla_component/settings_right.php
+++ b/admin/layouts/joomla_component/settings_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage settings_right.php
@@ -30,20 +30,11 @@ defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
- 'note_on_contributors',
- 'addcontributors',
- 'emptycontributors',
- 'number',
+ 'note_component_files_folders',
'spacer_hr_d',
- 'note_add_files',
- 'addfiles',
- 'spacer_hr_e',
- 'note_add_folders',
- 'addfolders',
- 'spacer_hr_f',
'to_ignore_note',
'toignore',
- 'spacer_hr_g',
+ 'spacer_hr_e',
'jcb_export_package_note',
'export_key',
'export_package_link',
diff --git a/admin/layouts/joomla_component/site_views_fullwidth.php b/admin/layouts/joomla_component/site_views_fullwidth.php
index d27b37289..43e818a5f 100644
--- a/admin/layouts/joomla_component/site_views_fullwidth.php
+++ b/admin/layouts/joomla_component/site_views_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage site_views_fullwidth.php
@@ -27,112 +27,23 @@
defined('_JEXEC') or die('Restricted access');
-// set the defaults
-$items = $displayData->vwpsite_views;
-$user = JFactory::getUser();
-$id = $displayData->item->id;
-$edit = "index.php?option=com_componentbuilder&view=site_views&task=site_view.edit";
-$ref = ($id) ? "&ref=joomla_component&refid=".$id : "";
-$new = "index.php?option=com_componentbuilder&view=site_view&layout=edit".$ref;
-$can = ComponentbuilderHelper::getActions('site_view');
+$form = $displayData->getForm();
+
+$fields = $displayData->get('fields') ?: array(
+ 'note_on_site_views',
+ 'note_display_component_site_views'
+);
?>
-get('core.create')): ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- $item): ?>
- authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0;
- $userChkOut = JFactory::getUser($item->checked_out);
- $canDo = ComponentbuilderHelper::getActions('site_view',$item,'site_views');
- ?>
-
-
- get('core.edit')): ?>
- escape($item->system_name); ?>
- checked_out): ?>
- name, $item->checked_out_time, 'site_views.', $canCheckin); ?>
-
-
- escape($item->system_name); ?>
-
-
-
- escape($item->name); ?>
-
-
- escape($item->codename); ?>
-
-
- escape($item->description); ?>
-
-
- escape($item->snippet_name); ?>
-
- published == 1):?>
-
-
-
-
-
- published == 0):?>
-
-
-
-
-
- published == 2):?>
-
-
-
-
-
- published == -2):?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ getLabel($field); ?>
+
+
+ getInput($field); ?>
+
+
+
diff --git a/admin/layouts/joomla_component/translation_fullwidth.php b/admin/layouts/joomla_component/translation_fullwidth.php
index 8ee24c7da..d2625f2eb 100644
--- a/admin/layouts/joomla_component/translation_fullwidth.php
+++ b/admin/layouts/joomla_component/translation_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage translation_fullwidth.php
@@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
-$items = $displayData->vwqtranslation;
+$items = $displayData->vwmtranslation;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=language_translations&task=language_translation.edit";
@@ -70,26 +70,26 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
published == 1):?>
-
-
+
+
published == 0):?>
-
-
+
+
published == 2):?>
-
-
+
+
published == -2):?>
-
-
+
+
diff --git a/admin/layouts/language/details_left.php b/admin/layouts/language/details_left.php
index 259fa1157..87ab2fb3e 100644
--- a/admin/layouts/language/details_left.php
+++ b/admin/layouts/language/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/language/details_right.php b/admin/layouts/language/details_right.php
index 386c4044f..4634c1262 100644
--- a/admin/layouts/language/details_right.php
+++ b/admin/layouts/language/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/language/publishing.php b/admin/layouts/language/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/language/publishing.php
+++ b/admin/layouts/language/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/language/publlshing.php b/admin/layouts/language/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/language/publlshing.php
+++ b/admin/layouts/language/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/language_translation/details_fullwidth.php b/admin/layouts/language_translation/details_fullwidth.php
index 3c68a0536..7438aabde 100644
--- a/admin/layouts/language_translation/details_fullwidth.php
+++ b/admin/layouts/language_translation/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
@@ -31,7 +31,8 @@ $form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'entranslation',
- 'translation'
+ 'translation',
+ 'components'
);
?>
diff --git a/admin/layouts/language_translation/publishing.php b/admin/layouts/language_translation/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/language_translation/publishing.php
+++ b/admin/layouts/language_translation/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/language_translation/publlshing.php b/admin/layouts/language_translation/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/language_translation/publlshing.php
+++ b/admin/layouts/language_translation/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/layout/custom_script_fullwidth.php b/admin/layouts/layout/custom_script_fullwidth.php
index 6b68deade..977017064 100644
--- a/admin/layouts/layout/custom_script_fullwidth.php
+++ b/admin/layouts/layout/custom_script_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_script_fullwidth.php
diff --git a/admin/layouts/layout/details_fullwidth.php b/admin/layouts/layout/details_fullwidth.php
index 27249e024..acc4db039 100644
--- a/admin/layouts/layout/details_fullwidth.php
+++ b/admin/layouts/layout/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/layout/details_left.php b/admin/layouts/layout/details_left.php
index 1c99798ab..eefffe7aa 100644
--- a/admin/layouts/layout/details_left.php
+++ b/admin/layouts/layout/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/layout/details_right.php b/admin/layouts/layout/details_right.php
index fae90925f..edac82528 100644
--- a/admin/layouts/layout/details_right.php
+++ b/admin/layouts/layout/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/layout/details_rightside.php b/admin/layouts/layout/details_rightside.php
index 0110e2439..85f7360eb 100644
--- a/admin/layouts/layout/details_rightside.php
+++ b/admin/layouts/layout/details_rightside.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_rightside.php
diff --git a/admin/layouts/layout/details_under.php b/admin/layouts/layout/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/layout/details_under.php
+++ b/admin/layouts/layout/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/layout/publishing.php b/admin/layouts/layout/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/layout/publishing.php
+++ b/admin/layouts/layout/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/layout/publlshing.php b/admin/layouts/layout/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/layout/publlshing.php
+++ b/admin/layouts/layout/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/site_view/custom_buttons_fullwidth.php b/admin/layouts/site_view/custom_buttons_fullwidth.php
index 4bbfa9ec5..ab1f0b025 100644
--- a/admin/layouts/site_view/custom_buttons_fullwidth.php
+++ b/admin/layouts/site_view/custom_buttons_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_fullwidth.php
diff --git a/admin/layouts/site_view/custom_buttons_left.php b/admin/layouts/site_view/custom_buttons_left.php
index 093c249f0..a3e846f6a 100644
--- a/admin/layouts/site_view/custom_buttons_left.php
+++ b/admin/layouts/site_view/custom_buttons_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_left.php
diff --git a/admin/layouts/site_view/custom_buttons_right.php b/admin/layouts/site_view/custom_buttons_right.php
index 7e7b82d32..64efb78d8 100644
--- a/admin/layouts/site_view/custom_buttons_right.php
+++ b/admin/layouts/site_view/custom_buttons_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_buttons_right.php
diff --git a/admin/layouts/site_view/details_above.php b/admin/layouts/site_view/details_above.php
index c3abf1866..759c1e10c 100644
--- a/admin/layouts/site_view/details_above.php
+++ b/admin/layouts/site_view/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/site_view/details_fullwidth.php b/admin/layouts/site_view/details_fullwidth.php
index 21b529eed..e36e76c00 100644
--- a/admin/layouts/site_view/details_fullwidth.php
+++ b/admin/layouts/site_view/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/site_view/details_left.php b/admin/layouts/site_view/details_left.php
index 356259a6e..681d2f1ac 100644
--- a/admin/layouts/site_view/details_left.php
+++ b/admin/layouts/site_view/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/site_view/details_right.php b/admin/layouts/site_view/details_right.php
index fae90925f..edac82528 100644
--- a/admin/layouts/site_view/details_right.php
+++ b/admin/layouts/site_view/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/site_view/details_rightside.php b/admin/layouts/site_view/details_rightside.php
index 2feb0423b..25581f16c 100644
--- a/admin/layouts/site_view/details_rightside.php
+++ b/admin/layouts/site_view/details_rightside.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_rightside.php
diff --git a/admin/layouts/site_view/details_under.php b/admin/layouts/site_view/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/site_view/details_under.php
+++ b/admin/layouts/site_view/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/site_view/javascript_css_fullwidth.php b/admin/layouts/site_view/javascript_css_fullwidth.php
index 7b897e9f3..866d91dd5 100644
--- a/admin/layouts/site_view/javascript_css_fullwidth.php
+++ b/admin/layouts/site_view/javascript_css_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage javascript_css_fullwidth.php
diff --git a/admin/layouts/site_view/linked_components_fullwidth.php b/admin/layouts/site_view/linked_components_fullwidth.php
index 4c33f5016..204a262bd 100644
--- a/admin/layouts/site_view/linked_components_fullwidth.php
+++ b/admin/layouts/site_view/linked_components_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage linked_components_fullwidth.php
@@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access');
// set the defaults
-$items = $displayData->vyulinked_components;
+$items = $displayData->vyplinked_components;
$user = JFactory::getUser();
$id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit";
@@ -100,26 +100,26 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
published == 1):?>
-
-
+
+
published == 0):?>
-
-
+
+
published == 2):?>
-
-
+
+
published == -2):?>
-
-
+
+
diff --git a/admin/layouts/site_view/php_fullwidth.php b/admin/layouts/site_view/php_fullwidth.php
index 9bef8eede..01eb7664f 100644
--- a/admin/layouts/site_view/php_fullwidth.php
+++ b/admin/layouts/site_view/php_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage php_fullwidth.php
diff --git a/admin/layouts/site_view/publishing.php b/admin/layouts/site_view/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/site_view/publishing.php
+++ b/admin/layouts/site_view/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/site_view/publlshing.php b/admin/layouts/site_view/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/site_view/publlshing.php
+++ b/admin/layouts/site_view/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/snippet/details_above.php b/admin/layouts/snippet/details_above.php
index d1c38ca9d..96eaf7a69 100644
--- a/admin/layouts/snippet/details_above.php
+++ b/admin/layouts/snippet/details_above.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_above.php
diff --git a/admin/layouts/snippet/details_left.php b/admin/layouts/snippet/details_left.php
index 0eefb5500..1951f1cdf 100644
--- a/admin/layouts/snippet/details_left.php
+++ b/admin/layouts/snippet/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/snippet/details_right.php b/admin/layouts/snippet/details_right.php
index e47dc84a8..bede6719b 100644
--- a/admin/layouts/snippet/details_right.php
+++ b/admin/layouts/snippet/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/snippet/publishing.php b/admin/layouts/snippet/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/snippet/publishing.php
+++ b/admin/layouts/snippet/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/snippet/publlshing.php b/admin/layouts/snippet/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/snippet/publlshing.php
+++ b/admin/layouts/snippet/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/layouts/template/custom_script_fullwidth.php b/admin/layouts/template/custom_script_fullwidth.php
index 6b68deade..977017064 100644
--- a/admin/layouts/template/custom_script_fullwidth.php
+++ b/admin/layouts/template/custom_script_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage custom_script_fullwidth.php
diff --git a/admin/layouts/template/details_fullwidth.php b/admin/layouts/template/details_fullwidth.php
index 83df7489e..8370b69df 100644
--- a/admin/layouts/template/details_fullwidth.php
+++ b/admin/layouts/template/details_fullwidth.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_fullwidth.php
diff --git a/admin/layouts/template/details_left.php b/admin/layouts/template/details_left.php
index 1c99798ab..eefffe7aa 100644
--- a/admin/layouts/template/details_left.php
+++ b/admin/layouts/template/details_left.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_left.php
diff --git a/admin/layouts/template/details_right.php b/admin/layouts/template/details_right.php
index fae90925f..edac82528 100644
--- a/admin/layouts/template/details_right.php
+++ b/admin/layouts/template/details_right.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_right.php
diff --git a/admin/layouts/template/details_rightside.php b/admin/layouts/template/details_rightside.php
index 0110e2439..85f7360eb 100644
--- a/admin/layouts/template/details_rightside.php
+++ b/admin/layouts/template/details_rightside.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_rightside.php
diff --git a/admin/layouts/template/details_under.php b/admin/layouts/template/details_under.php
index 5b2b24f66..b5ba7bc61 100644
--- a/admin/layouts/template/details_under.php
+++ b/admin/layouts/template/details_under.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage details_under.php
diff --git a/admin/layouts/template/publishing.php b/admin/layouts/template/publishing.php
index b6c0d3f1f..fc48afcf3 100644
--- a/admin/layouts/template/publishing.php
+++ b/admin/layouts/template/publishing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publishing.php
diff --git a/admin/layouts/template/publlshing.php b/admin/layouts/template/publlshing.php
index 979e11f42..8bc963975 100644
--- a/admin/layouts/template/publlshing.php
+++ b/admin/layouts/template/publlshing.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage publlshing.php
diff --git a/admin/models/admin_fields.php b/admin/models/admin_fields.php
index 6578a1abb..67e5ff043 100644
--- a/admin/models/admin_fields.php
+++ b/admin/models/admin_fields.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 23 of this MVC
- @build 16th October, 2017
+ @version @update number 25 of this MVC
+ @build 26th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields.php
@@ -812,6 +812,16 @@ class ComponentbuilderModelAdmin_fields extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
+ if (isset($data['addfields']) && ComponentbuilderHelper::checkArray($data['addfields']))
+ {
+ // Sort fields by 'Tab' ASC, 'Alignment' ASC, 'Order in Edit' ASC
+ usort($data['addfields'], function ($a, $b) {
+ $val_a = sprintf('%02u', $a['tab']) . sprintf('%02u', $a['alignment']) . sprintf('%03u', $a['order_edit']);
+ $val_b = sprintf('%02u', $b['tab']) . sprintf('%02u', $b['alignment']) . sprintf('%03u', $b['order_edit']);
+ return strcmp($val_a, $val_b);
+ });
+ }
+
// Set the addfields items to data.
if (isset($data['addfields']) && is_array($data['addfields']))
{
diff --git a/admin/models/admin_fields_conditions.php b/admin/models/admin_fields_conditions.php
index 5cad61656..f90445b97 100644
--- a/admin/models/admin_fields_conditions.php
+++ b/admin/models/admin_fields_conditions.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
- @build 16th October, 2017
+ @build 25th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields_conditions.php
diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php
index 5878e6f11..75f0a4990 100644
--- a/admin/models/admin_view.php
+++ b/admin/models/admin_view.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 192 of this MVC
- @build 16th October, 2017
+ @version @update number 247 of this MVC
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.php
@@ -148,16 +148,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->ajax_input = $ajax_input->toArray();
}
- if (!empty($item->php_getitems))
+ if (!empty($item->php_after_delete))
{
- // base64 Decode php_getitems.
- $item->php_getitems = base64_decode($item->php_getitems);
- }
-
- if (!empty($item->php_batchmove))
- {
- // base64 Decode php_batchmove.
- $item->php_batchmove = base64_decode($item->php_batchmove);
+ // base64 Decode php_after_delete.
+ $item->php_after_delete = base64_decode($item->php_after_delete);
}
if (!empty($item->php_save))
@@ -166,10 +160,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_save = base64_decode($item->php_save);
}
- if (!empty($item->php_after_delete))
+ if (!empty($item->php_batchmove))
{
- // base64 Decode php_after_delete.
- $item->php_after_delete = base64_decode($item->php_after_delete);
+ // base64 Decode php_batchmove.
+ $item->php_batchmove = base64_decode($item->php_batchmove);
}
if (!empty($item->php_getlistquery))
@@ -190,6 +184,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->php_after_publish = base64_decode($item->php_after_publish);
}
+ if (!empty($item->php_getitems))
+ {
+ // base64 Decode php_getitems.
+ $item->php_getitems = base64_decode($item->php_getitems);
+ }
+
if (!empty($item->php_import))
{
// base64 Decode php_import.
@@ -370,95 +370,32 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// update the fields
$objectUpdate = new stdClass();
$objectUpdate->id = (int) $item->id;
- // check what type of linked_views array we have here (should be subform... but just incase)
- // This could happen due to huge data sets
- if (isset($item->addlinked_views) && isset($item->addlinked_views['adminview']))
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addlinked_views' => 'adminview',
+ 'ajax_input' => 'value_name',
+ 'custom_button' => 'name',
+ 'addpermissions' => 'action',
+ 'addtables' => 'table',
+ 'addtabs' => 'name'
+ );
+ foreach ($arrayChecker as $_value => $checker)
{
- $bucket = array();
- foreach($item->addlinked_views as $option => $values)
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
{
- foreach($values as $nr => $value)
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
{
- $bucket['addlinked_views'.$nr][$option] = $value;
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
}
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
}
- $item->addlinked_views = $bucket;
- $objectUpdate->addconditions = json_encode($bucket);
- }
- // check what type of ajax_input array we have here (should be subform... but just incase)
- // This could happen due to huge data sets
- if (isset($item->ajax_input) && isset($item->ajax_input['value_name']))
- {
- $bucket = array();
- foreach($item->ajax_input as $option => $values)
- {
- foreach($values as $nr => $value)
- {
- $bucket['ajax_input'.$nr][$option] = $value;
- }
- }
- $item->ajax_input = $bucket;
- $objectUpdate->ajax_input = json_encode($bucket);
- }
- // check what type of custom_button array we have here (should be subform... but just incase)
- // This could happen due to huge data sets
- if (isset($item->custom_button) && isset($item->custom_button['name']))
- {
- $bucket = array();
- foreach($item->custom_button as $option => $values)
- {
- foreach($values as $nr => $value)
- {
- $bucket['custom_button'.$nr][$option] = $value;
- }
- }
- $item->custom_button = $bucket;
- $objectUpdate->custom_button = json_encode($bucket);
- }
- // check what type of permissions array we have here (should be subform... but just incase)
- // This could happen due to huge data sets
- if (isset($item->addpermissions) && isset($item->addpermissions['action']))
- {
- $bucket = array();
- foreach($item->addpermissions as $option => $values)
- {
- foreach($values as $nr => $value)
- {
- $bucket['addpermissions'.$nr][$option] = $value;
- }
- }
- $item->addpermissions = $bucket;
- $objectUpdate->addpermissions = json_encode($bucket);
- }
- // check what type of table array we have here (should be subform... but just incase)
- // This could happen due to huge data sets
- if (isset($item->addtables) && isset($item->addtables['table']))
- {
- $bucket = array();
- foreach($item->addtables as $option => $values)
- {
- foreach($values as $nr => $value)
- {
- $bucket['addtables'.$nr][$option] = $value;
- }
- }
- $item->addtables = $bucket;
- $objectUpdate->addtables = json_encode($bucket);
- }
- // check what type of tabs array we have here (should be subform... but just incase)
- // This could happen due to huge data sets
- if (isset($item->addtabs) && isset($item->addtabs['name']))
- {
- $bucket = array();
- foreach($item->addtabs as $option => $values)
- {
- foreach($values as $nr => $value)
- {
- $bucket['addtabs'.$nr][$option] = $value;
- }
- }
- $item->addtabs = $bucket;
- $objectUpdate->addtabs = json_encode($bucket);
}
// be sure to update the table if we found repeatable fields that are still not converted
if (count((array) $objectUpdate) > 1)
@@ -471,102 +408,9 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$item->tags = new JHelperTags;
$item->tags->getTagIds($item->id, 'com_componentbuilder.admin_view');
}
- }
- $this->addadmin_viewsvvvz = $item->id;
+ }
return $item;
- }
-
- /**
- * Method to get list data.
- *
- * @return mixed An array of data items on success, false on failure.
- */
- public function getVxzlinked_components()
- {
- // Get the user object.
- $user = JFactory::getUser();
- // Create a new query object.
- $db = JFactory::getDBO();
- $query = $db->getQuery(true);
-
- // Select some fields
- $query->select('a.*');
-
- // From the componentbuilder_joomla_component table
- $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
-
- // Join over the asset groups.
- $query->select('ag.title AS access_level');
- $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
- // Filter by access level.
- if ($access = $this->getState('filter.access'))
- {
- $query->where('a.access = ' . (int) $access);
- }
- // Implement View Level Access
- if (!$user->authorise('core.options', 'com_componentbuilder'))
- {
- $groups = implode(',', $user->getAuthorisedViewLevels());
- $query->where('a.access IN (' . $groups . ')');
- }
-
- // Order the results by ordering
- $query->order('a.published ASC');
- $query->order('a.ordering ASC');
-
- // Load the items
- $db->setQuery($query);
- $db->execute();
- if ($db->getNumRows())
- {
- $items = $db->loadObjectList();
-
- // set values to display correctly.
- if (ComponentbuilderHelper::checkArray($items))
- {
- // get user object.
- $user = JFactory::getUser();
- foreach ($items as $nr => &$item)
- {
- $access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder'));
- if (!$access)
- {
- unset($items[$nr]);
- continue;
- }
-
- }
- }
-
- // Filter by addadmin_viewsvvvz in this Repetable Field
- if (ComponentbuilderHelper::checkArray($items) && isset($this->addadmin_viewsvvvz))
- {
- foreach ($items as $nr => &$item)
- {
- if (isset($item->addadmin_views) && ComponentbuilderHelper::checkJson($item->addadmin_views))
- {
- $tmpArray = json_decode($item->addadmin_views,true);
- if (!isset($tmpArray['adminview']) || !ComponentbuilderHelper::checkArray($tmpArray['adminview']) || !in_array($this->addadmin_viewsvvvz, $tmpArray['adminview']))
- {
- unset($items[$nr]);
- continue;
- }
- }
- else
- {
- unset($items[$nr]);
- continue;
- }
- }
- }
- else
- {
- return false;
- }
- return $items;
- }
- return false;
}
/**
@@ -878,6 +722,26 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (!parent::delete($pks))
{
return false;
+ }
+
+ // we must also delete the linked tables found
+ if (ComponentbuilderHelper::checkArray($pks))
+ {
+ $_tablesArray = array(
+ 'admin_fields',
+ 'admin_fields_conditions'
+ );
+ foreach($_tablesArray as $_updateTable)
+ {
+ // get the linked IDs
+ if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'admin_view', 'id'))
+ {
+ // load the model
+ $_Model = ComponentbuilderHelper::getModel($_updateTable);
+ // change publish state
+ $_Model->delete($_pks);
+ }
+ }
}
return true;
@@ -898,6 +762,26 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
if (!parent::publish($pks, $value))
{
return false;
+ }
+
+ // we must also update all linked tables
+ if (ComponentbuilderHelper::checkArray($pks))
+ {
+ $_tablesArray = array(
+ 'admin_fields',
+ 'admin_fields_conditions'
+ );
+ foreach($_tablesArray as $_updateTable)
+ {
+ // get the linked IDs
+ if ($_pks = ComponentbuilderHelper::getVars($_updateTable, $pks, 'admin_view', 'id'))
+ {
+ // load the model
+ $_Model = ComponentbuilderHelper::getModel($_updateTable);
+ // change publish state
+ $_Model->publish($_pks, $value);
+ }
+ }
}
return true;
@@ -1139,6 +1023,26 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
// Add the new ID to the array
$newIds[$pk] = $newId;
}
+
+ if (ComponentbuilderHelper::checkArray($newIds))
+ {
+ foreach($newIds as $oldID => $newID)
+ {
+ // get the linked ID
+ if ($field = ComponentbuilderHelper::getVar('admin_fields', $oldID, 'admin_view', 'id'))
+ {
+ // copy fields to new admin view
+ ComponentbuilderHelper::copyItem(/*id->*/ $field, /*table->*/ 'admin_fields', /*change->*/ array('admin_view' => $newID));
+ }
+ // get the linked ID
+ if ($condition = ComponentbuilderHelper::getVar('admin_fields_conditions', $oldID, 'admin_view', 'id'))
+ {
+ // copy conditions to new admin view
+ ComponentbuilderHelper::copyItem(/*id->*/ $condition, /*table->*/ 'admin_fields_conditions', /*change->*/ array('admin_view' => $newID));
+ }
+ }
+ }
+
// Clean the cache
$this->cleanCache();
@@ -1360,16 +1264,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['ajax_input'] = '';
}
- // Set the php_getitems string to base64 string.
- if (isset($data['php_getitems']))
+ // Set the php_after_delete string to base64 string.
+ if (isset($data['php_after_delete']))
{
- $data['php_getitems'] = base64_encode($data['php_getitems']);
- }
-
- // Set the php_batchmove string to base64 string.
- if (isset($data['php_batchmove']))
- {
- $data['php_batchmove'] = base64_encode($data['php_batchmove']);
+ $data['php_after_delete'] = base64_encode($data['php_after_delete']);
}
// Set the php_save string to base64 string.
@@ -1378,10 +1276,10 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_save'] = base64_encode($data['php_save']);
}
- // Set the php_after_delete string to base64 string.
- if (isset($data['php_after_delete']))
+ // Set the php_batchmove string to base64 string.
+ if (isset($data['php_batchmove']))
{
- $data['php_after_delete'] = base64_encode($data['php_after_delete']);
+ $data['php_batchmove'] = base64_encode($data['php_batchmove']);
}
// Set the php_getlistquery string to base64 string.
@@ -1402,6 +1300,12 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin
$data['php_after_publish'] = base64_encode($data['php_after_publish']);
}
+ // Set the php_getitems string to base64 string.
+ if (isset($data['php_getitems']))
+ {
+ $data['php_getitems'] = base64_encode($data['php_getitems']);
+ }
+
// Set the php_import string to base64 string.
if (isset($data['php_import']))
{
diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php
index e97139cac..3831b8119 100644
--- a/admin/models/admin_views.php
+++ b/admin/models/admin_views.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 192 of this MVC
- @build 16th October, 2017
+ @version @update number 247 of this MVC
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_views.php
@@ -262,20 +262,20 @@ class ComponentbuilderModelAdmin_views extends JModelList
continue;
}
- // decode php_getitems
- $item->php_getitems = base64_decode($item->php_getitems);
- // decode php_batchmove
- $item->php_batchmove = base64_decode($item->php_batchmove);
- // decode php_save
- $item->php_save = base64_decode($item->php_save);
// decode php_after_delete
$item->php_after_delete = base64_decode($item->php_after_delete);
+ // decode php_save
+ $item->php_save = base64_decode($item->php_save);
+ // decode php_batchmove
+ $item->php_batchmove = base64_decode($item->php_batchmove);
// decode php_getlistquery
$item->php_getlistquery = base64_decode($item->php_getlistquery);
// decode php_allowedit
$item->php_allowedit = base64_decode($item->php_allowedit);
// decode php_after_publish
$item->php_after_publish = base64_decode($item->php_after_publish);
+ // decode php_getitems
+ $item->php_getitems = base64_decode($item->php_getitems);
// decode php_import
$item->php_import = base64_decode($item->php_import);
// decode php_getitems_after_all
diff --git a/admin/models/admins_fields.php b/admin/models/admins_fields.php
index c87b2bfa0..5801d2ed1 100644
--- a/admin/models/admins_fields.php
+++ b/admin/models/admins_fields.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 23 of this MVC
- @build 16th October, 2017
+ @version @update number 25 of this MVC
+ @build 26th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admins_fields.php
diff --git a/admin/models/admins_fields_conditions.php b/admin/models/admins_fields_conditions.php
index 72ea7266c..9e0d74f41 100644
--- a/admin/models/admins_fields_conditions.php
+++ b/admin/models/admins_fields_conditions.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
- @build 16th October, 2017
+ @build 25th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admins_fields_conditions.php
diff --git a/admin/models/ajax.php b/admin/models/ajax.php
index 3075281bc..adcd59c67 100644
--- a/admin/models/ajax.php
+++ b/admin/models/ajax.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage ajax.php
@@ -214,6 +214,15 @@ class ComponentbuilderModelAjax extends JModelList
'admin_fields' => 'admins_fields',
'admin_fields_conditions' => 'admins_fields_conditions',
'field' => 'fields',
+ 'component_admin_views' => 'components_admin_views' ,
+ 'component_site_views' => 'components_site_views',
+ 'component_custom_admin_views' => 'components_custom_views',
+ 'component_updates' => 'components_updates',
+ 'component_mysql_tweaks' => 'components_mysql_tweaks',
+ 'component_custom_admin_menus' => 'components_custom_admin_menus',
+ 'component_config' => 'components_config',
+ 'component_dashboard' => 'components_dashboard',
+ 'component_files_folders' => 'components_files_folders',
'language' => true);
public function getButton($type)
@@ -329,7 +338,8 @@ class ComponentbuilderModelAjax extends JModelList
}
protected $functionArray = array(
- 'field' => 'setFieldsNames',
+ // Admin View
+ 'field' => 'setItemNames',
'list' => 'setYesNo',
'title' => 'setYesNo',
'alias' => 'setYesNo',
@@ -340,12 +350,91 @@ class ComponentbuilderModelAjax extends JModelList
'permission' => 'setYesNo',
'tab' => 'setTabName',
'alignment' => 'setAlignmentName',
- 'target_field' => 'setFieldsNames',
+ 'target_field' => 'setItemNames',
'target_behavior' => 'setTargetBehavior',
'target_relation' => 'setTargetRelation',
- 'match_field' => 'setFieldsNames',
+ 'match_field' => 'setItemNames',
'match_behavior' => 'setMatchBehavior',
- 'match_options' => 'setMatchOptions');
+ 'match_options' => 'setMatchOptions',
+ // Joomla Component
+ 'menu' => 'setYesNo',
+ 'metadata' => 'setYesNo',
+ 'default_view' => 'setYesNo',
+ 'access' => 'setYesNo',
+ 'mainmenu' => 'setYesNo',
+ 'dashboard_list' => 'setYesNo',
+ 'submenu' => 'setYesNo',
+ 'dashboard_add' => 'setYesNo',
+ 'checkin' => 'setYesNo',
+ 'history' => 'setYesNo',
+ 'port' => 'setYesNo',
+ 'edit_create_site_view' => 'setYesNo',
+ 'icomoon' => 'setIcoMoon',
+ 'customadminview' => 'setItemNames',
+ 'adminviews' => 'setItemNames',
+ 'adminview' => 'setItemNames',
+ 'siteview' => 'setItemNames',
+ 'before' => 'setItemNames');
+
+ protected function getLanguage($key)
+ {
+ $language = array(
+ // Admin View (fields)
+ 'field' => JText::_('COM_COMPONENTBUILDER_FIELD'),
+ 'list' => JText::_('COM_COMPONENTBUILDER_ADMIN_LIST'),
+ 'order_list' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_LIST_VIEWS'),
+ 'title' => JText::_('COM_COMPONENTBUILDER_TITLE'),
+ 'alias' => JText::_('COM_COMPONENTBUILDER_ALIAS'),
+ 'sort' => JText::_('COM_COMPONENTBUILDER_SORTABLE'),
+ 'search' => JText::_('COM_COMPONENTBUILDER_SEARCHABLE'),
+ 'filter' => JText::_('COM_COMPONENTBUILDER_FILTER'),
+ 'link' => JText::_('COM_COMPONENTBUILDER_LINK'),
+ 'permission' => JText::_('COM_COMPONENTBUILDER_PERMISSIONS'),
+ 'tab' => JText::_('COM_COMPONENTBUILDER_TAB'),
+ 'alignment' => JText::_('COM_COMPONENTBUILDER_ALIGNMENT'),
+ 'order_edit' => JText::_('COM_COMPONENTBUILDER_ORDER_IN_EDIT'),
+ // Admin View (conditions)
+ 'target_field' => JText::_('COM_COMPONENTBUILDER_TARGET_FIELDS'),
+ 'target_behavior' => JText::_('COM_COMPONENTBUILDER_TARGET_BEHAVIOR'),
+ 'target_relation' => JText::_('COM_COMPONENTBUILDER_TARGET_RELATION'),
+ 'match_field' => JText::_('COM_COMPONENTBUILDER_MATCH_FIELD'),
+ 'match_behavior' => JText::_('COM_COMPONENTBUILDER_MATCH_BEHAVIOR'),
+ 'match_options' => JText::_('COM_COMPONENTBUILDER_MATCH_OPTIONS'),
+ // Joomla Component
+ 'menu' => JText::_('COM_COMPONENTBUILDER_ADD_MENU'),
+ 'metadata' => JText::_('COM_COMPONENTBUILDER_HAS_METADATA'),
+ 'default_view' => JText::_('COM_COMPONENTBUILDER_DEFAULT_VIEW'),
+ 'access' => JText::_('COM_COMPONENTBUILDER_ADD_ACCESS'),
+ 'component_site_views|=VDM=|access' => JText::_('COM_COMPONENTBUILDER_PUBLIC_ACCESS'),
+ 'mainmenu' => JText::_('COM_COMPONENTBUILDER_MAIN_MENU'),
+ 'dashboard_list' => JText::_('COM_COMPONENTBUILDER_DASHBOARD_LIST_OF_RECORDS'),
+ 'dashboard_add' => JText::_('COM_COMPONENTBUILDER_DASHBOARD_ADD_RECORD'),
+ 'submenu' => JText::_('COM_COMPONENTBUILDER_SUBMENU'),
+ 'checkin' => JText::_('COM_COMPONENTBUILDER_AUTO_CHECKIN'),
+ 'history' => JText::_('COM_COMPONENTBUILDER_KEEP_HISTORY'),
+ 'port' => JText::_('COM_COMPONENTBUILDER_EXPORTIMPORT_DATA'),
+ 'edit_create_site_view' => JText::_('COM_COMPONENTBUILDER_EDITCREATE_SITE_VIEW'),
+ 'icomoon' => JText::_('COM_COMPONENTBUILDER_ICON'),
+ 'customadminview' => JText::_('COM_COMPONENTBUILDER_VIEW'),
+ 'adminviews' => JText::_('COM_COMPONENTBUILDER_VIEWS'),
+ 'adminview' => JText::_('COM_COMPONENTBUILDER_VIEW'),
+ 'siteview' => JText::_('COM_COMPONENTBUILDER_VIEW'),
+ 'before' => JText::_('COM_COMPONENTBUILDER_ORDER_BEFORE')
+ );
+ // check if a unique value is available
+ if (isset($language[$key]))
+ {
+ return $language[$key];
+ }
+ // check a shared value is available
+ $keys = explode('|=VDM=|', $key);
+ if (isset($language[$keys[1]]))
+ {
+ return $language[$keys[1]];
+ }
+ return ComponentbuilderHelper::safeString($keys[1], 'Ww');
+ }
+
protected function getSubformTable($idName, $data)
{
@@ -363,7 +452,10 @@ class ComponentbuilderModelAjax extends JModelList
{
foreach ($headers as $header => $value)
{
- $head[$header] = '' . ComponentbuilderHelper::safeString($header, 'Ww');
+ if (!isset($head[$header]))
+ {
+ $head[$header] = $this->getLanguage($idName . '|=VDM=|' . $header);
+ }
}
}
// build the rows
@@ -372,16 +464,16 @@ class ComponentbuilderModelAjax extends JModelList
{
foreach ($data as $nr => $values)
{
- foreach ($head as $key => $t)
+ foreach ($head as $key => $_header)
{
// set the value for the row
if (isset($values[$key]))
{
- $this->setSubformRows($nr, $this->setSubformValue($key, $values[$key]), $rows);
+ $this->setSubformRows($nr, $this->setSubformValue($key, $values[$key]), $rows, $_header);
}
else
{
- $this->setSubformRows($nr, $this->setSubformValue($key, ''), $rows);
+ $this->setSubformRows($nr, $this->setSubformValue($key, ''), $rows, $_header);
}
}
}
@@ -406,7 +498,7 @@ class ComponentbuilderModelAjax extends JModelList
$table[] = "\t\t\t";
$table[] = "\t\t\t\t";
$table[] = "\t\t\t\t\t";
- $table[] = "\t\t\t\t\t\t". implode("", $head);
+ $table[] = "\t\t\t\t\t\t" . implode(" ", $head) . " ";
$table[] = "\t\t\t\t\t ";
$table[] = "\t\t\t\t";
$table[] = "\t\t\t\t";
@@ -439,25 +531,28 @@ class ComponentbuilderModelAjax extends JModelList
return $value;
}
- protected function setSubformRows($nr, $value, &$rows)
+ protected function setSubformRows($nr, $value, &$rows, $_header)
{
// build rows
if (!isset($rows[$nr]))
{
- $rows[$nr] = ''.$value.' ';
+ $rows[$nr] = ''.$value.' ';
}
else
{
- $rows[$nr] .= ''.$value.' ';
+ $rows[$nr] .= ''.$value.' ';
}
}
protected $ref;
protected $fieldsArray = array(
'admin_fields' => 'addfields',
- 'admin_fields_conditions' => 'addconditions');
+ 'admin_fields_conditions' => 'addconditions',
+ 'component_admin_views' => 'addadmin_views',
+ 'component_site_views' => 'addsite_views',
+ 'component_custom_admin_views' => 'addcustom_admin_views');
- public function getFieldsDisplay($type)
+ public function getAjaxDisplay($type)
{
if (isset($this->fieldsArray[$type]))
{
@@ -466,23 +561,23 @@ class ComponentbuilderModelAjax extends JModelList
// get the view name & id
$values = $this->getViewID();
// check if we are in the correct view.
- if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']) && $values['a_view'] === 'admin_view')
+ if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view']) && ($values['a_view'] === 'admin_view' || $values['a_view'] === 'joomla_component'))
{
- $this->ref = '&ref=admin_view&refid=' . $values['a_id'];
+ $this->ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id'];
// get the field data
- if ($fieldsData = ComponentbuilderHelper::getVar($type, (int) $values['a_id'], 'admin_view', $this->fieldsArray[$type]))
+ if ($fieldsData = ComponentbuilderHelper::getVar($type, (int) $values['a_id'], $values['a_view'], $this->fieldsArray[$type]))
{
// check repeatable conversion
- $this->checkRepeatableConversion($fieldsData, $type, $values['a_id']);
+ $this->checkRepeatableConversion($fieldsData, $type, $values['a_id'], $values['a_view']);
// get the table
$table = $this->getSubformTable($type, $fieldsData);
// set notice of bad practice
$notice = '';
- if (isset($this->rowNumber) && $this->rowNumber > 50)
+ if ($values['a_view'] === 'admin_view' && isset($this->rowNumber) && $this->rowNumber > 50)
{
$notice = '' . JText::sprintf('COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_FIFTY_S_IS_CONSIDERED_BAD_PRACTICE_YOUR_S_PAGE_LOAD_IN_JCB_WILL_SLOWDOWN_YOU_SHOULD_CONSIDER_DECOUPLING_SOME_OF_THESE_S', $this->rowNumber, $typeName, $typeName, $typeName, $typeName) . '';
}
- elseif (isset($this->rowNumber))
+ elseif ($values['a_view'] === 'admin_view' && isset($this->rowNumber))
{
$notice = '' . JText::sprintf('COM_COMPONENTBUILDER_YOU_HAVE_S_S_ADDING_MORE_THEN_FIFTY_S_IS_CONSIDERED_BAD_PRACTICE', $this->rowNumber, $typeName, $typeName) . '';
}
@@ -497,9 +592,16 @@ class ComponentbuilderModelAjax extends JModelList
protected $conversionCheck = array(
'addfields' => 'field',
- 'addconditions' => 'target_field');
+ 'addconditions' => 'target_field',
+ 'addadmin_views' => 'adminview',
+ 'addconfig' => 'field',
+ 'addcustom_admin_views' => 'customadminview',
+ 'addcustommenus' => 'name',
+ 'addsite_views' => 'siteview',
+ 'sql_tweak' => 'adminview',
+ 'version_update' => 'version');
- protected function checkRepeatableConversion(&$fieldsData, $type, $id)
+ protected function checkRepeatableConversion(&$fieldsData, $type, $id, $linked_id_name)
{
if (ComponentbuilderHelper::checkJson($fieldsData))
{
@@ -517,13 +619,93 @@ class ComponentbuilderModelAjax extends JModelList
$fieldsData = json_encode($bucket);
// update the fields
$objectUpdate = new stdClass();
- $objectUpdate->admin_view = (int) $id;
+ $objectUpdate->{$linked_id_name} = (int) $id;
$objectUpdate->{$this->fieldsArray[$type]} = $fieldsData;
JFactory::getDbo()->updateObject('#__componentbuilder_'.$type, $objectUpdate, 'admin_view');
}
}
}
+ protected $itemNames = array(
+ 'field' => array(),
+ 'admin_view' => array(),
+ 'site_view' => array(),
+ 'custom_admin_view' => array()
+ );
+
+ protected $itemKeys = array(
+ // admin view
+ 'field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field'),
+ 'target_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field'),
+ 'match_field' => array('table' => 'field', 'tables' => 'fields', 'id' => 'id', 'name' => 'name', 'text' => 'Field'),
+ // joomla component view
+ 'siteview' => array('table' => 'site_view', 'tables' => 'site_views', 'id' => 'id', 'name' => 'name', 'text' => 'Site View'),
+ 'customadminview' => array('table' => 'custom_admin_view', 'tables' => 'custom_admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Custom Admin View'),
+ 'adminviews' => array('table' => 'admin_view', 'tables' => 'admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Admin View'),
+ 'adminview' => array('table' => 'admin_view', 'tables' => 'admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Admin View'),
+ 'before' => array('table' => 'admin_view', 'tables' => 'admin_views', 'id' => 'id', 'name' => 'system_name', 'text' => 'Admin View')
+ );
+
+ protected function setItemNames($header, $value)
+ {
+ if (isset($this->itemKeys[$header]) && isset($this->itemKeys[$header]['table']) && isset($this->itemNames[$this->itemKeys[$header]['table']]))
+ {
+ // reset bucket
+ $bucket = array();
+ if (ComponentbuilderHelper::checkArray($value))
+ {
+ foreach ($value as $item)
+ {
+ $edit = true;
+ if (!isset($this->itemNames[$this->itemKeys[$header]['table']][$item]))
+ {
+ if (!$this->itemNames[$this->itemKeys[$header]['table']][$item] = ComponentbuilderHelper::getVar($this->itemKeys[$header]['table'], (int) $item, $this->itemKeys[$header]['id'], $this->itemKeys[$header]['name']))
+ {
+ $this->itemNames[$this->itemKeys[$header]['table']][$item] = JText::sprintf('COM_COMPONENTBUILDER_NO_S_FOUND', $this->itemKeys[$header]['text']);
+ $edit = false;
+ }
+ }
+ // set edit link
+ $link = ($edit) ? $this->addEditLink($item, $this->itemKeys[$header]['table'], $this->itemKeys[$header]['tables']) : '';
+ // load item
+ $bucket[] = $this->itemNames[$this->itemKeys[$header]['table']][$item] . $link;
+ }
+ }
+ elseif (is_numeric($value))
+ {
+ $edit = true;
+ if (!isset($this->itemNames[$this->itemKeys[$header]['table']][$value]))
+ {
+ if (!$this->itemNames[$this->itemKeys[$header]['table']][$value] = ComponentbuilderHelper::getVar($this->itemKeys[$header]['table'], (int) $value, $this->itemKeys[$header]['id'], $this->itemKeys[$header]['name']))
+ {
+ $this->itemNames[$this->itemKeys[$header]['table']][$value] = JText::sprintf('COM_COMPONENTBUILDER_NO_S_FOUND', $this->itemKeys[$header]['text']);
+ $edit = false;
+ }
+ }
+ // set edit link
+ $link = ($edit) ? $this->addEditLink($value, $this->itemKeys[$header]['table'], $this->itemKeys[$header]['tables']) : '';
+ // load item
+ $bucket[] = $this->itemNames[$this->itemKeys[$header]['table']][$value] . $link;
+ }
+ // return found items
+ if (ComponentbuilderHelper::checkArray($bucket))
+ {
+ return implode('
', $bucket);
+ }
+ return JText::sprintf('COM_COMPONENTBUILDER_NO_S_FOUND', $this->itemKeys[$header]['text']);
+ }
+ return JText::_('COM_COMPONENTBUILDER_NO_ITEM_FOUND');
+ }
+
+ protected function setIcoMoon($header, $value)
+ {
+ if (ComponentbuilderHelper::checkString($value))
+ {
+ return '';
+ }
+ return '-';
+ }
+
protected function setAlignmentName($header, $value)
{
switch ($value)
@@ -553,44 +735,6 @@ class ComponentbuilderModelAjax extends JModelList
return JText::_('COM_COMPONENTBUILDER_NOT_SET');
}
- protected $fieldNames = array();
-
- protected function setFieldsNames($header, $value)
- {
- $bucket = array();
- if (ComponentbuilderHelper::checkArray($value))
- {
- foreach ($value as $field)
- {
- if (!isset($this->fieldNames[$field]))
- {
- if (!$this->fieldNames[$field] = ComponentbuilderHelper::getVar('field', (int) $field, 'id', 'name'))
- {
- $this->fieldNames[$field] = JText::_('COM_COMPONENTBUILDER_NO_FIELD_FOUND');
- }
- }
- $bucket[] = $this->fieldNames[$field] . $this->addEditLink($field, 'field', 'fields');
- }
- }
- elseif (is_numeric($value))
- {
- if (!isset($this->fieldNames[$value]))
- {
- if (!$this->fieldNames[$value] = ComponentbuilderHelper::getVar('field', (int) $value, 'id', 'name'))
- {
- $this->fieldNames[$value] = JText::_('COM_COMPONENTBUILDER_NO_FIELD_FOUND');
- }
- }
- $bucket[] = $this->fieldNames[$value] . $this->addEditLink($value, 'field', 'fields');
- }
- // return found fields
- if (ComponentbuilderHelper::checkArray($bucket))
- {
- return implode('
', $bucket);
- }
- return JText::_('COM_COMPONENTBUILDER_NO_FIELD_FOUND');
- }
-
protected function addEditLink($id, $view, $views)
{
// can edit
@@ -619,6 +763,11 @@ class ComponentbuilderModelAjax extends JModelList
protected function setTabName($header, $value)
{
+ // return published if set to 15 (since this is the default number for it)
+ if (15 == $value)
+ {
+ return JText::_('COM_COMPONENTBUILDER_PUBLISHING');
+ }
if (!ComponentbuilderHelper::checkArray($this->tabNames))
{
// get the view name & id
@@ -655,9 +804,9 @@ class ComponentbuilderModelAjax extends JModelList
{
if (1 == $value)
{
- return JText::_('COM_COMPONENTBUILDER_YES');
+ return '';
}
- return JText::_('COM_COMPONENTBUILDER_NO');
+ return '';
}
protected function setTargetBehavior($header, $value)
@@ -1434,8 +1583,8 @@ class ComponentbuilderModelAjax extends JModelList
$query['a']['select'] = array('id', 'system_name', 'php_preflight_install','php_postflight_install',
'php_preflight_update','php_postflight_update','php_method_uninstall',
'php_helper_admin','php_admin_event','php_helper_both','php_helper_site',
- 'php_site_event','php_dashboard_methods','dashboard_tab','javascript');
- $query['a']['not_base64'] = array('dashboard_tab' => 'json');
+ 'php_site_event','javascript');
+ $query['a']['not_base64'] = array();
$query['a']['name'] = 'system_name';
// #__componentbuilder_admin_view as b
@@ -1502,6 +1651,15 @@ class ComponentbuilderModelAjax extends JModelList
$query['h']['not_base64'] = array();
$query['h']['name'] = 'name';
+ $query = array();
+ // #__componentbuilder_component_dashboard as i
+ $query['i'] = array();
+ $query['i']['table'] = 'component_dashboard';
+ $query['i']['view'] = 'components_dashboard';
+ $query['i']['select'] = array('id', 'joomla_component', 'php_dashboard_methods','dashboard_tab');
+ $query['i']['not_base64'] = array('dashboard_tab' => 'json');
+ $query['i']['name'] = 'joomla_component';
+
// return the query string to search
if (isset($query[$target]))
{
diff --git a/admin/models/component_admin_views.php b/admin/models/component_admin_views.php
new file mode 100644
index 000000000..1cb10cdac
--- /dev/null
+++ b/admin/models/component_admin_views.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_admin_views Model
+ */
+class ComponentbuilderModelComponent_admin_views extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_admin_views';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_admin_views', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->addadmin_views))
+ {
+ // Convert the addadmin_views field to an array.
+ $addadmin_views = new Registry;
+ $addadmin_views->loadString($item->addadmin_views);
+ $item->addadmin_views = $addadmin_views->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addadmin_views' => 'adminview'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_admin_views', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_admin_views');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_admin_views', 'component_admin_views', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_admin_views.edit.state', 'com_componentbuilder.component_admin_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_admin_views.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_admin_views.edit.created_by', 'com_componentbuilder.component_admin_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_admin_views.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_admin_views.edit.created', 'com_componentbuilder.component_admin_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_admin_views.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_admin_views.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_admin_views.delete', 'com_componentbuilder.component_admin_views.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_admin_views.edit.state', 'com_componentbuilder.component_admin_views.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_admin_views.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_admin_views.edit', 'com_componentbuilder.component_admin_views.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_admin_views.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_admin_views'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_admin_views.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
+ }
+
+ if (!$this->canDo->get('component_admin_views.create') && !$this->canDo->get('component_admin_views.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_admin_views.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
+ }
+
+ if (!$this->canDo->get('component_admin_views.edit') && !$this->canDo->get('component_admin_views.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_admin_views.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_admin_views.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the addadmin_views items to data.
+ if (isset($data['addadmin_views']) && is_array($data['addadmin_views']))
+ {
+ $addadmin_views = new JRegistry;
+ $addadmin_views->loadArray($data['addadmin_views']);
+ $data['addadmin_views'] = (string) $addadmin_views;
+ }
+ elseif (!isset($data['addadmin_views']))
+ {
+ // Set the empty addadmin_views to data
+ $data['addadmin_views'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_config.php b/admin/models/component_config.php
new file mode 100644
index 000000000..b7ef6d054
--- /dev/null
+++ b/admin/models/component_config.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_config Model
+ */
+class ComponentbuilderModelComponent_config extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_config';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_config', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->addconfig))
+ {
+ // Convert the addconfig field to an array.
+ $addconfig = new Registry;
+ $addconfig->loadString($item->addconfig);
+ $item->addconfig = $addconfig->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addconfig' => 'field'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_config', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_config');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_config', 'component_config', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_config.edit.state', 'com_componentbuilder.component_config.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_config.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_config.edit.created_by', 'com_componentbuilder.component_config.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_config.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_config.edit.created', 'com_componentbuilder.component_config.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_config.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_config.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_config.delete', 'com_componentbuilder.component_config.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_config.edit.state', 'com_componentbuilder.component_config.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_config.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_config.edit', 'com_componentbuilder.component_config.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_config.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_config'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_config.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_config');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_config');
+ }
+
+ if (!$this->canDo->get('component_config.create') && !$this->canDo->get('component_config.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_config.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_config.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_config');
+ }
+
+ if (!$this->canDo->get('component_config.edit') && !$this->canDo->get('component_config.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_config.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_config.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the addconfig items to data.
+ if (isset($data['addconfig']) && is_array($data['addconfig']))
+ {
+ $addconfig = new JRegistry;
+ $addconfig->loadArray($data['addconfig']);
+ $data['addconfig'] = (string) $addconfig;
+ }
+ elseif (!isset($data['addconfig']))
+ {
+ // Set the empty addconfig to data
+ $data['addconfig'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_custom_admin_menus.php b/admin/models/component_custom_admin_menus.php
new file mode 100644
index 000000000..a092ac249
--- /dev/null
+++ b/admin/models/component_custom_admin_menus.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_custom_admin_menus Model
+ */
+class ComponentbuilderModelComponent_custom_admin_menus extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_custom_admin_menus';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_custom_admin_menus', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->addcustommenus))
+ {
+ // Convert the addcustommenus field to an array.
+ $addcustommenus = new Registry;
+ $addcustommenus->loadString($item->addcustommenus);
+ $item->addcustommenus = $addcustommenus->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addcustommenus' => 'name'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_custom_admin_menus', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_custom_admin_menus');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_custom_admin_menus', 'component_custom_admin_menus', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_custom_admin_menus.edit.state', 'com_componentbuilder.component_custom_admin_menus.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_custom_admin_menus.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_custom_admin_menus.edit.created_by', 'com_componentbuilder.component_custom_admin_menus.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_custom_admin_menus.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_custom_admin_menus.edit.created', 'com_componentbuilder.component_custom_admin_menus.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_custom_admin_menus.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_custom_admin_menus.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_custom_admin_menus.delete', 'com_componentbuilder.component_custom_admin_menus.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_custom_admin_menus.edit.state', 'com_componentbuilder.component_custom_admin_menus.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_custom_admin_menus.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_custom_admin_menus.edit', 'com_componentbuilder.component_custom_admin_menus.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_custom_admin_menus.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_custom_admin_menus'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_custom_admin_menus.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
+ }
+
+ if (!$this->canDo->get('component_custom_admin_menus.create') && !$this->canDo->get('component_custom_admin_menus.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_custom_admin_menus.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
+ }
+
+ if (!$this->canDo->get('component_custom_admin_menus.edit') && !$this->canDo->get('component_custom_admin_menus.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_custom_admin_menus.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_custom_admin_menus.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the addcustommenus items to data.
+ if (isset($data['addcustommenus']) && is_array($data['addcustommenus']))
+ {
+ $addcustommenus = new JRegistry;
+ $addcustommenus->loadArray($data['addcustommenus']);
+ $data['addcustommenus'] = (string) $addcustommenus;
+ }
+ elseif (!isset($data['addcustommenus']))
+ {
+ // Set the empty addcustommenus to data
+ $data['addcustommenus'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_custom_admin_views.php b/admin/models/component_custom_admin_views.php
new file mode 100644
index 000000000..e066f6090
--- /dev/null
+++ b/admin/models/component_custom_admin_views.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_custom_admin_views Model
+ */
+class ComponentbuilderModelComponent_custom_admin_views extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_custom_admin_views';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_custom_admin_views', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->addcustom_admin_views))
+ {
+ // Convert the addcustom_admin_views field to an array.
+ $addcustom_admin_views = new Registry;
+ $addcustom_admin_views->loadString($item->addcustom_admin_views);
+ $item->addcustom_admin_views = $addcustom_admin_views->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addcustom_admin_views' => 'customadminview'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_custom_admin_views', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_custom_admin_views');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_custom_admin_views', 'component_custom_admin_views', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_custom_admin_views.edit.state', 'com_componentbuilder.component_custom_admin_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_custom_admin_views.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_custom_admin_views.edit.created_by', 'com_componentbuilder.component_custom_admin_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_custom_admin_views.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_custom_admin_views.edit.created', 'com_componentbuilder.component_custom_admin_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_custom_admin_views.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_custom_admin_views.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_custom_admin_views.delete', 'com_componentbuilder.component_custom_admin_views.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_custom_admin_views.edit.state', 'com_componentbuilder.component_custom_admin_views.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_custom_admin_views.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_custom_admin_views.edit', 'com_componentbuilder.component_custom_admin_views.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_custom_admin_views.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_custom_admin_views'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_custom_admin_views.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
+ }
+
+ if (!$this->canDo->get('component_custom_admin_views.create') && !$this->canDo->get('component_custom_admin_views.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_custom_admin_views.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
+ }
+
+ if (!$this->canDo->get('component_custom_admin_views.edit') && !$this->canDo->get('component_custom_admin_views.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_custom_admin_views.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_custom_admin_views.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the addcustom_admin_views items to data.
+ if (isset($data['addcustom_admin_views']) && is_array($data['addcustom_admin_views']))
+ {
+ $addcustom_admin_views = new JRegistry;
+ $addcustom_admin_views->loadArray($data['addcustom_admin_views']);
+ $data['addcustom_admin_views'] = (string) $addcustom_admin_views;
+ }
+ elseif (!isset($data['addcustom_admin_views']))
+ {
+ // Set the empty addcustom_admin_views to data
+ $data['addcustom_admin_views'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_dashboard.php b/admin/models/component_dashboard.php
new file mode 100644
index 000000000..50f5a2080
--- /dev/null
+++ b/admin/models/component_dashboard.php
@@ -0,0 +1,925 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_dashboard Model
+ */
+class ComponentbuilderModelComponent_dashboard extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_dashboard';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_dashboard', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->dashboard_tab))
+ {
+ // Convert the dashboard_tab field to an array.
+ $dashboard_tab = new Registry;
+ $dashboard_tab->loadString($item->dashboard_tab);
+ $item->dashboard_tab = $dashboard_tab->toArray();
+ }
+
+ if (!empty($item->php_dashboard_methods))
+ {
+ // base64 Decode php_dashboard_methods.
+ $item->php_dashboard_methods = base64_decode($item->php_dashboard_methods);
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'dashboard_tab' => 'name'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_dashboard', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_dashboard');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_dashboard', 'component_dashboard', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_dashboard.edit.state', 'com_componentbuilder.component_dashboard.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_dashboard.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_dashboard.edit.created_by', 'com_componentbuilder.component_dashboard.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_dashboard.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_dashboard.edit.created', 'com_componentbuilder.component_dashboard.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_dashboard.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_dashboard.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_dashboard.delete', 'com_componentbuilder.component_dashboard.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_dashboard.edit.state', 'com_componentbuilder.component_dashboard.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_dashboard.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_dashboard.edit', 'com_componentbuilder.component_dashboard.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_dashboard.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_dashboard'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_dashboard.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
+ }
+
+ if (!$this->canDo->get('component_dashboard.create') && !$this->canDo->get('component_dashboard.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_dashboard.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
+ }
+
+ if (!$this->canDo->get('component_dashboard.edit') && !$this->canDo->get('component_dashboard.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_dashboard.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_dashboard.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the dashboard_tab items to data.
+ if (isset($data['dashboard_tab']) && is_array($data['dashboard_tab']))
+ {
+ $dashboard_tab = new JRegistry;
+ $dashboard_tab->loadArray($data['dashboard_tab']);
+ $data['dashboard_tab'] = (string) $dashboard_tab;
+ }
+ elseif (!isset($data['dashboard_tab']))
+ {
+ // Set the empty dashboard_tab to data
+ $data['dashboard_tab'] = '';
+ }
+
+ // Set the php_dashboard_methods string to base64 string.
+ if (isset($data['php_dashboard_methods']))
+ {
+ $data['php_dashboard_methods'] = base64_encode($data['php_dashboard_methods']);
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_files_folders.php b/admin/models/component_files_folders.php
new file mode 100644
index 000000000..4229dacb0
--- /dev/null
+++ b/admin/models/component_files_folders.php
@@ -0,0 +1,935 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_files_folders Model
+ */
+class ComponentbuilderModelComponent_files_folders extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_files_folders';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_files_folders', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->addfiles))
+ {
+ // Convert the addfiles field to an array.
+ $addfiles = new Registry;
+ $addfiles->loadString($item->addfiles);
+ $item->addfiles = $addfiles->toArray();
+ }
+
+ if (!empty($item->addfolders))
+ {
+ // Convert the addfolders field to an array.
+ $addfolders = new Registry;
+ $addfolders->loadString($item->addfolders);
+ $item->addfolders = $addfolders->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addfiles' => 'file',
+ 'addfolders' => 'folder'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_files_folders', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_files_folders');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_files_folders', 'component_files_folders', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_files_folders.edit.state', 'com_componentbuilder.component_files_folders.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_files_folders.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_files_folders.edit.created_by', 'com_componentbuilder.component_files_folders.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_files_folders.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_files_folders.edit.created', 'com_componentbuilder.component_files_folders.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_files_folders.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_files_folders.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_files_folders.delete', 'com_componentbuilder.component_files_folders.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_files_folders.edit.state', 'com_componentbuilder.component_files_folders.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_files_folders.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_files_folders.edit', 'com_componentbuilder.component_files_folders.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_files_folders.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_files_folders'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_files_folders.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
+ }
+
+ if (!$this->canDo->get('component_files_folders.create') && !$this->canDo->get('component_files_folders.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_files_folders.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
+ }
+
+ if (!$this->canDo->get('component_files_folders.edit') && !$this->canDo->get('component_files_folders.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_files_folders.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_files_folders.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the addfiles items to data.
+ if (isset($data['addfiles']) && is_array($data['addfiles']))
+ {
+ $addfiles = new JRegistry;
+ $addfiles->loadArray($data['addfiles']);
+ $data['addfiles'] = (string) $addfiles;
+ }
+ elseif (!isset($data['addfiles']))
+ {
+ // Set the empty addfiles to data
+ $data['addfiles'] = '';
+ }
+
+ // Set the addfolders items to data.
+ if (isset($data['addfolders']) && is_array($data['addfolders']))
+ {
+ $addfolders = new JRegistry;
+ $addfolders->loadArray($data['addfolders']);
+ $data['addfolders'] = (string) $addfolders;
+ }
+ elseif (!isset($data['addfolders']))
+ {
+ // Set the empty addfolders to data
+ $data['addfolders'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_mysql_tweaks.php b/admin/models/component_mysql_tweaks.php
new file mode 100644
index 000000000..0dd8d7e1c
--- /dev/null
+++ b/admin/models/component_mysql_tweaks.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_mysql_tweaks Model
+ */
+class ComponentbuilderModelComponent_mysql_tweaks extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_mysql_tweaks';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_mysql_tweaks', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->sql_tweak))
+ {
+ // Convert the sql_tweak field to an array.
+ $sql_tweak = new Registry;
+ $sql_tweak->loadString($item->sql_tweak);
+ $item->sql_tweak = $sql_tweak->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'sql_tweak' => 'adminview'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_mysql_tweaks', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_mysql_tweaks');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_mysql_tweaks', 'component_mysql_tweaks', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_mysql_tweaks.edit.state', 'com_componentbuilder.component_mysql_tweaks.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_mysql_tweaks.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_mysql_tweaks.edit.created_by', 'com_componentbuilder.component_mysql_tweaks.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_mysql_tweaks.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_mysql_tweaks.edit.created', 'com_componentbuilder.component_mysql_tweaks.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_mysql_tweaks.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_mysql_tweaks.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_mysql_tweaks.delete', 'com_componentbuilder.component_mysql_tweaks.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_mysql_tweaks.edit.state', 'com_componentbuilder.component_mysql_tweaks.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_mysql_tweaks.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_mysql_tweaks.edit', 'com_componentbuilder.component_mysql_tweaks.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_mysql_tweaks.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_mysql_tweaks'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_mysql_tweaks.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
+ }
+
+ if (!$this->canDo->get('component_mysql_tweaks.create') && !$this->canDo->get('component_mysql_tweaks.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_mysql_tweaks.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
+ }
+
+ if (!$this->canDo->get('component_mysql_tweaks.edit') && !$this->canDo->get('component_mysql_tweaks.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_mysql_tweaks.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_mysql_tweaks.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the sql_tweak items to data.
+ if (isset($data['sql_tweak']) && is_array($data['sql_tweak']))
+ {
+ $sql_tweak = new JRegistry;
+ $sql_tweak->loadArray($data['sql_tweak']);
+ $data['sql_tweak'] = (string) $sql_tweak;
+ }
+ elseif (!isset($data['sql_tweak']))
+ {
+ // Set the empty sql_tweak to data
+ $data['sql_tweak'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_site_views.php b/admin/models/component_site_views.php
new file mode 100644
index 000000000..f3c533d12
--- /dev/null
+++ b/admin/models/component_site_views.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_site_views Model
+ */
+class ComponentbuilderModelComponent_site_views extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_site_views';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_site_views', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->addsite_views))
+ {
+ // Convert the addsite_views field to an array.
+ $addsite_views = new Registry;
+ $addsite_views->loadString($item->addsite_views);
+ $item->addsite_views = $addsite_views->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'addsite_views' => 'siteview'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_site_views', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_site_views');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_site_views', 'component_site_views', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_site_views.edit.state', 'com_componentbuilder.component_site_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_site_views.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_site_views.edit.created_by', 'com_componentbuilder.component_site_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_site_views.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_site_views.edit.created', 'com_componentbuilder.component_site_views.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_site_views.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_site_views.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_site_views.delete', 'com_componentbuilder.component_site_views.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_site_views.edit.state', 'com_componentbuilder.component_site_views.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_site_views.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_site_views.edit', 'com_componentbuilder.component_site_views.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_site_views.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_site_views'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_site_views.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
+ }
+
+ if (!$this->canDo->get('component_site_views.create') && !$this->canDo->get('component_site_views.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_site_views.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_site_views.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
+ }
+
+ if (!$this->canDo->get('component_site_views.edit') && !$this->canDo->get('component_site_views.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_site_views.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_site_views.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the addsite_views items to data.
+ if (isset($data['addsite_views']) && is_array($data['addsite_views']))
+ {
+ $addsite_views = new JRegistry;
+ $addsite_views->loadArray($data['addsite_views']);
+ $data['addsite_views'] = (string) $addsite_views;
+ }
+ elseif (!isset($data['addsite_views']))
+ {
+ // Set the empty addsite_views to data
+ $data['addsite_views'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/component_updates.php b/admin/models/component_updates.php
new file mode 100644
index 000000000..ce3a5edda
--- /dev/null
+++ b/admin/models/component_updates.php
@@ -0,0 +1,913 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+use Joomla\Registry\Registry;
+
+// import Joomla modelform library
+jimport('joomla.application.component.modeladmin');
+
+/**
+ * Componentbuilder Component_updates Model
+ */
+class ComponentbuilderModelComponent_updates extends JModelAdmin
+{
+ /**
+ * @var string The prefix to use with controller messages.
+ * @since 1.6
+ */
+ protected $text_prefix = 'COM_COMPONENTBUILDER';
+
+ /**
+ * The type alias for this content type.
+ *
+ * @var string
+ * @since 3.2
+ */
+ public $typeAlias = 'com_componentbuilder.component_updates';
+
+ /**
+ * Returns a Table object, always creating it
+ *
+ * @param type $type The table type to instantiate
+ * @param string $prefix A prefix for the table class name. Optional.
+ * @param array $config Configuration array for model. Optional.
+ *
+ * @return JTable A database object
+ *
+ * @since 1.6
+ */
+ public function getTable($type = 'component_updates', $prefix = 'ComponentbuilderTable', $config = array())
+ {
+ return JTable::getInstance($type, $prefix, $config);
+ }
+
+ /**
+ * Method to get a single record.
+ *
+ * @param integer $pk The id of the primary key.
+ *
+ * @return mixed Object on success, false on failure.
+ *
+ * @since 1.6
+ */
+ public function getItem($pk = null)
+ {
+ if ($item = parent::getItem($pk))
+ {
+ if (!empty($item->params))
+ {
+ // Convert the params field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->params);
+ $item->params = $registry->toArray();
+ }
+
+ if (!empty($item->metadata))
+ {
+ // Convert the metadata field to an array.
+ $registry = new Registry;
+ $registry->loadString($item->metadata);
+ $item->metadata = $registry->toArray();
+ }
+
+ if (!empty($item->version_update))
+ {
+ // Convert the version_update field to an array.
+ $version_update = new Registry;
+ $version_update->loadString($item->version_update);
+ $item->version_update = $version_update->toArray();
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'version_update' => 'version'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_component_updates', $objectUpdate, 'id');
+ }
+
+ if (!empty($item->id))
+ {
+ $item->tags = new JHelperTags;
+ $item->tags->getTagIds($item->id, 'com_componentbuilder.component_updates');
+ }
+ }
+
+ return $item;
+ }
+
+ /**
+ * Method to get the record form.
+ *
+ * @param array $data Data for the form.
+ * @param boolean $loadData True if the form is to load its own data (default case), false if not.
+ *
+ * @return mixed A JForm object on success, false on failure
+ *
+ * @since 1.6
+ */
+ public function getForm($data = array(), $loadData = true)
+ {
+ // Get the form.
+ $form = $this->loadForm('com_componentbuilder.component_updates', 'component_updates', array('control' => 'jform', 'load_data' => $loadData));
+
+ if (empty($form))
+ {
+ return false;
+ }
+
+ $jinput = JFactory::getApplication()->input;
+
+ // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
+ if ($jinput->get('a_id'))
+ {
+ $id = $jinput->get('a_id', 0, 'INT');
+ }
+ // The back end uses id so we use that the rest of the time and set it to 0 by default.
+ else
+ {
+ $id = $jinput->get('id', 0, 'INT');
+ }
+
+ $user = JFactory::getUser();
+
+ // Check for existing item.
+ // Modify the form based on Edit State access controls.
+ if ($id != 0 && (!$user->authorise('component_updates.edit.state', 'com_componentbuilder.component_updates.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_updates.edit.state', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('ordering', 'disabled', 'true');
+ $form->setFieldAttribute('published', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('ordering', 'filter', 'unset');
+ $form->setFieldAttribute('published', 'filter', 'unset');
+ }
+ // If this is a new item insure the greated by is set.
+ if (0 == $id)
+ {
+ // Set the created_by to this user
+ $form->setValue('created_by', null, $user->id);
+ }
+ // Modify the form based on Edit Creaded By access controls.
+ if ($id != 0 && (!$user->authorise('component_updates.edit.created_by', 'com_componentbuilder.component_updates.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_updates.edit.created_by', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'disabled', 'true');
+ // Disable fields for display.
+ $form->setFieldAttribute('created_by', 'readonly', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created_by', 'filter', 'unset');
+ }
+ // Modify the form based on Edit Creaded Date access controls.
+ if ($id != 0 && (!$user->authorise('component_updates.edit.created', 'com_componentbuilder.component_updates.' . (int) $id))
+ || ($id == 0 && !$user->authorise('component_updates.edit.created', 'com_componentbuilder')))
+ {
+ // Disable fields for display.
+ $form->setFieldAttribute('created', 'disabled', 'true');
+ // Disable fields while saving.
+ $form->setFieldAttribute('created', 'filter', 'unset');
+ }
+ // Only load these values if no id is found
+ if (0 == $id)
+ {
+ // Set redirected field name
+ $redirectedField = $jinput->get('ref', null, 'STRING');
+ // Set redirected field value
+ $redirectedValue = $jinput->get('refid', 0, 'INT');
+ if (0 != $redirectedValue && $redirectedField)
+ {
+ // Now set the local-redirected field default value
+ $form->setValue($redirectedField, null, $redirectedValue);
+ }
+ }
+
+ return $form;
+ }
+
+ /**
+ * Method to get the script that have to be included on the form
+ *
+ * @return string script files
+ */
+ public function getScript()
+ {
+ return 'administrator/components/com_componentbuilder/models/forms/component_updates.js';
+ }
+
+ /**
+ * Method to test whether a record can be deleted.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to delete the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canDelete($record)
+ {
+ if (!empty($record->id))
+ {
+ if ($record->published != -2)
+ {
+ return;
+ }
+
+ $user = JFactory::getUser();
+ // The record has been set. Check the record permissions.
+ return $user->authorise('component_updates.delete', 'com_componentbuilder.component_updates.' . (int) $record->id);
+ }
+ return false;
+ }
+
+ /**
+ * Method to test whether a record can have its state edited.
+ *
+ * @param object $record A record object.
+ *
+ * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component.
+ *
+ * @since 1.6
+ */
+ protected function canEditState($record)
+ {
+ $user = JFactory::getUser();
+ $recordId = (!empty($record->id)) ? $record->id : 0;
+
+ if ($recordId)
+ {
+ // The record has been set. Check the record permissions.
+ $permission = $user->authorise('component_updates.edit.state', 'com_componentbuilder.component_updates.' . (int) $recordId);
+ if (!$permission && !is_null($permission))
+ {
+ return false;
+ }
+ }
+ // In the absense of better information, revert to the component permissions.
+ return $user->authorise('component_updates.edit.state', 'com_componentbuilder');
+ }
+
+ /**
+ * Method override to check if you can edit an existing record.
+ *
+ * @param array $data An array of input data.
+ * @param string $key The name of the key for the primary key.
+ *
+ * @return boolean
+ * @since 2.5
+ */
+ protected function allowEdit($data = array(), $key = 'id')
+ {
+ // Check specific edit permission then general edit permission.
+ $user = JFactory::getUser();
+
+ return $user->authorise('component_updates.edit', 'com_componentbuilder.component_updates.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('component_updates.edit', 'com_componentbuilder');
+ }
+
+ /**
+ * Prepare and sanitise the table data prior to saving.
+ *
+ * @param JTable $table A JTable object.
+ *
+ * @return void
+ *
+ * @since 1.6
+ */
+ protected function prepareTable($table)
+ {
+ $date = JFactory::getDate();
+ $user = JFactory::getUser();
+
+ if (isset($table->name))
+ {
+ $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES);
+ }
+
+ if (isset($table->alias) && empty($table->alias))
+ {
+ $table->generateAlias();
+ }
+
+ if (empty($table->id))
+ {
+ $table->created = $date->toSql();
+ // set the user
+ if ($table->created_by == 0 || empty($table->created_by))
+ {
+ $table->created_by = $user->id;
+ }
+ // Set ordering to the last item if not set
+ if (empty($table->ordering))
+ {
+ $db = JFactory::getDbo();
+ $query = $db->getQuery(true)
+ ->select('MAX(ordering)')
+ ->from($db->quoteName('#__componentbuilder_component_updates'));
+ $db->setQuery($query);
+ $max = $db->loadResult();
+
+ $table->ordering = $max + 1;
+ }
+ }
+ else
+ {
+ $table->modified = $date->toSql();
+ $table->modified_by = $user->id;
+ }
+
+ if (!empty($table->id))
+ {
+ // Increment the items version number.
+ $table->version++;
+ }
+ }
+
+ /**
+ * Method to get the data that should be injected in the form.
+ *
+ * @return mixed The data for the form.
+ *
+ * @since 1.6
+ */
+ protected function loadFormData()
+ {
+ // Check the session for previously entered form data.
+ $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.component_updates.data', array());
+
+ if (empty($data))
+ {
+ $data = $this->getItem();
+ }
+
+ return $data;
+ }
+
+ /**
+ * Method to get the unique fields of this table.
+ *
+ * @return mixed An array of field names, boolean false if none is set.
+ *
+ * @since 3.0
+ */
+ protected function getUniqeFields()
+ {
+ return false;
+ }
+
+ /**
+ * Method to delete one or more records.
+ *
+ * @param array &$pks An array of record primary keys.
+ *
+ * @return boolean True if successful, false if an error occurs.
+ *
+ * @since 12.2
+ */
+ public function delete(&$pks)
+ {
+ if (!parent::delete($pks))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to change the published state of one or more records.
+ *
+ * @param array &$pks A list of the primary keys to change.
+ * @param integer $value The value of the published state.
+ *
+ * @return boolean True on success.
+ *
+ * @since 12.2
+ */
+ public function publish(&$pks, $value = 1)
+ {
+ if (!parent::publish($pks, $value))
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Method to perform batch operations on an item or a set of items.
+ *
+ * @param array $commands An array of commands to perform.
+ * @param array $pks An array of item ids.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean Returns true on success, false on failure.
+ *
+ * @since 12.2
+ */
+ public function batch($commands, $pks, $contexts)
+ {
+ // Sanitize ids.
+ $pks = array_unique($pks);
+ JArrayHelper::toInteger($pks);
+
+ // Remove any values of zero.
+ if (array_search(0, $pks, true))
+ {
+ unset($pks[array_search(0, $pks, true)]);
+ }
+
+ if (empty($pks))
+ {
+ $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED'));
+ return false;
+ }
+
+ $done = false;
+
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_updates');
+ $this->batchSet = true;
+
+ if (!$this->canDo->get('core.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+ return false;
+ }
+
+ if ($this->type == false)
+ {
+ $type = new JUcmType;
+ $this->type = $type->getTypeByAlias($this->typeAlias);
+ }
+
+ $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags');
+
+ if (!empty($commands['move_copy']))
+ {
+ $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c');
+
+ if ($cmd == 'c')
+ {
+ $result = $this->batchCopy($commands, $pks, $contexts);
+
+ if (is_array($result))
+ {
+ foreach ($result as $old => $new)
+ {
+ $contexts[$new] = $contexts[$old];
+ }
+ $pks = array_values($result);
+ }
+ else
+ {
+ return false;
+ }
+ }
+ elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts))
+ {
+ return false;
+ }
+
+ $done = true;
+ }
+
+ if (!$done)
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION'));
+
+ return false;
+ }
+
+ // Clear the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Batch copy items to a new category or current.
+ *
+ * @param integer $values The new values.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return mixed An array of new IDs on success, boolean false on failure.
+ *
+ * @since 12.2
+ */
+ protected function batchCopy($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_updates');
+ }
+
+ if (!$this->canDo->get('component_updates.create') && !$this->canDo->get('component_updates.batch'))
+ {
+ return false;
+ }
+
+ // get list of uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // make sure published is set
+ if (!isset($values['published']))
+ {
+ $values['published'] = 0;
+ }
+ elseif (isset($values['published']) && !$this->canDo->get('component_updates.edit.state'))
+ {
+ $values['published'] = 0;
+ }
+
+ $newIds = array();
+
+ // Parent exists so let's proceed
+ while (!empty($pks))
+ {
+ // Pop the first ID off the stack
+ $pk = array_shift($pks);
+
+ $this->table->reset();
+
+ // only allow copy if user may edit this item.
+
+ if (!$this->user->authorise('component_updates.edit', $contexts[$pk]))
+
+ {
+
+ // Not fatal error
+
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+
+ continue;
+
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ $this->table->joomla_component = $this->generateUniqe('joomla_component',$this->table->joomla_component);
+
+ // insert all set values
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ if (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+ // update all uniqe fields
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField);
+ }
+ }
+
+ // Reset the ID because we are making a copy
+ $this->table->id = 0;
+
+ // TODO: Deal with ordering?
+ // $this->table->ordering = 1;
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ // Get the new item ID
+ $newId = $this->table->get('id');
+
+ // Add the new ID to the array
+ $newIds[$pk] = $newId;
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return $newIds;
+ }
+
+ /**
+ * Batch move items to a new category
+ *
+ * @param integer $value The new category ID.
+ * @param array $pks An array of row IDs.
+ * @param array $contexts An array of item contexts.
+ *
+ * @return boolean True if successful, false otherwise and internal error is set.
+ *
+ * @since 12.2
+ */
+ protected function batchMove($values, $pks, $contexts)
+ {
+ if (empty($this->batchSet))
+ {
+ // Set some needed variables.
+ $this->user = JFactory::getUser();
+ $this->table = $this->getTable();
+ $this->tableClassName = get_class($this->table);
+ $this->contentType = new JUcmType;
+ $this->type = $this->contentType->getTypeByTable($this->tableClassName);
+ $this->canDo = ComponentbuilderHelper::getActions('component_updates');
+ }
+
+ if (!$this->canDo->get('component_updates.edit') && !$this->canDo->get('component_updates.batch'))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+ return false;
+ }
+
+ // make sure published only updates if user has the permission.
+ if (isset($values['published']) && !$this->canDo->get('component_updates.edit.state'))
+ {
+ unset($values['published']);
+ }
+ // remove move_copy from array
+ unset($values['move_copy']);
+
+ // Parent exists so we proceed
+ foreach ($pks as $pk)
+ {
+ if (!$this->user->authorise('component_updates.edit', $contexts[$pk]))
+ {
+ $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT'));
+
+ return false;
+ }
+
+ // Check that the row actually exists
+ if (!$this->table->load($pk))
+ {
+ if ($error = $this->table->getError())
+ {
+ // Fatal error
+ $this->setError($error);
+
+ return false;
+ }
+ else
+ {
+ // Not fatal error
+ $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
+ continue;
+ }
+ }
+
+ // insert all set values.
+ if (ComponentbuilderHelper::checkArray($values))
+ {
+ foreach ($values as $key => $value)
+ {
+ // Do special action for access.
+ if ('access' === $key && strlen($value) > 0)
+ {
+ $this->table->$key = $value;
+ }
+ elseif (strlen($value) > 0 && isset($this->table->$key))
+ {
+ $this->table->$key = $value;
+ }
+ }
+ }
+
+
+ // Check the row.
+ if (!$this->table->check())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+
+ if (!empty($this->type))
+ {
+ $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
+ }
+
+ // Store the row.
+ if (!$this->table->store())
+ {
+ $this->setError($this->table->getError());
+
+ return false;
+ }
+ }
+
+ // Clean the cache
+ $this->cleanCache();
+
+ return true;
+ }
+
+ /**
+ * Method to save the form data.
+ *
+ * @param array $data The form data.
+ *
+ * @return boolean True on success.
+ *
+ * @since 1.6
+ */
+ public function save($data)
+ {
+ $input = JFactory::getApplication()->input;
+ $filter = JFilterInput::getInstance();
+
+ // set the metadata to the Item Data
+ if (isset($data['metadata']) && isset($data['metadata']['author']))
+ {
+ $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM');
+
+ $metadata = new JRegistry;
+ $metadata->loadArray($data['metadata']);
+ $data['metadata'] = (string) $metadata;
+ }
+
+ // Set the version_update items to data.
+ if (isset($data['version_update']) && is_array($data['version_update']))
+ {
+ $version_update = new JRegistry;
+ $version_update->loadArray($data['version_update']);
+ $data['version_update'] = (string) $version_update;
+ }
+ elseif (!isset($data['version_update']))
+ {
+ // Set the empty version_update to data
+ $data['version_update'] = '';
+ }
+
+ // Set the Params Items to data
+ if (isset($data['params']) && is_array($data['params']))
+ {
+ $params = new JRegistry;
+ $params->loadArray($data['params']);
+ $data['params'] = (string) $params;
+ }
+
+ // Alter the uniqe field for save as copy
+ if ($input->get('task') === 'save2copy')
+ {
+ // Automatic handling of other uniqe fields
+ $uniqeFields = $this->getUniqeFields();
+ if (ComponentbuilderHelper::checkArray($uniqeFields))
+ {
+ foreach ($uniqeFields as $uniqeField)
+ {
+ $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]);
+ }
+ }
+ }
+
+ if (parent::save($data))
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Method to generate a uniqe value.
+ *
+ * @param string $field name.
+ * @param string $value data.
+ *
+ * @return string New value.
+ *
+ * @since 3.0
+ */
+ protected function generateUniqe($field,$value)
+ {
+
+ // set field value uniqe
+ $table = $this->getTable();
+
+ while ($table->load(array($field => $value)))
+ {
+ $value = JString::increment($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * Method to change the title & alias.
+ *
+ * @param string $title The title.
+ *
+ * @return array Contains the modified title and alias.
+ *
+ */
+ protected function _generateNewTitle($title)
+ {
+
+ // Alter the title
+ $table = $this->getTable();
+
+ while ($table->load(array('title' => $title)))
+ {
+ $title = JString::increment($title);
+ }
+
+ return $title;
+ }
+}
diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php
index d815ef3e4..0f70a8e71 100644
--- a/admin/models/componentbuilder.php
+++ b/admin/models/componentbuilder.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage componentbuilder.php
@@ -134,7 +134,34 @@ class ComponentbuilderModelComponentbuilder extends JModelList
'admin_fields.access' => 'admin_fields.access',
'admin_fields_conditions.create' => 'admin_fields_conditions.create',
'admins_fields_conditions.access' => 'admin_fields_conditions.access',
- 'admin_fields_conditions.access' => 'admin_fields_conditions.access');
+ 'admin_fields_conditions.access' => 'admin_fields_conditions.access',
+ 'component_admin_views.create' => 'component_admin_views.create',
+ 'components_admin_views.access' => 'component_admin_views.access',
+ 'component_admin_views.access' => 'component_admin_views.access',
+ 'component_site_views.create' => 'component_site_views.create',
+ 'components_site_views.access' => 'component_site_views.access',
+ 'component_site_views.access' => 'component_site_views.access',
+ 'component_custom_admin_views.create' => 'component_custom_admin_views.create',
+ 'components_custom_admin_views.access' => 'component_custom_admin_views.access',
+ 'component_custom_admin_views.access' => 'component_custom_admin_views.access',
+ 'component_updates.create' => 'component_updates.create',
+ 'components_updates.access' => 'component_updates.access',
+ 'component_updates.access' => 'component_updates.access',
+ 'component_mysql_tweaks.create' => 'component_mysql_tweaks.create',
+ 'components_mysql_tweaks.access' => 'component_mysql_tweaks.access',
+ 'component_mysql_tweaks.access' => 'component_mysql_tweaks.access',
+ 'component_custom_admin_menus.create' => 'component_custom_admin_menus.create',
+ 'components_custom_admin_menus.access' => 'component_custom_admin_menus.access',
+ 'component_custom_admin_menus.access' => 'component_custom_admin_menus.access',
+ 'component_config.create' => 'component_config.create',
+ 'components_config.access' => 'component_config.access',
+ 'component_config.access' => 'component_config.access',
+ 'component_dashboard.create' => 'component_dashboard.create',
+ 'components_dashboard.access' => 'component_dashboard.access',
+ 'component_dashboard.access' => 'component_dashboard.access',
+ 'component_files_folders.create' => 'component_files_folders.create',
+ 'components_files_folders.access' => 'component_files_folders.access',
+ 'component_files_folders.access' => 'component_files_folders.access');
foreach($viewGroups as $group => $views)
{
$i = 0;
diff --git a/admin/models/components_admin_views.php b/admin/models/components_admin_views.php
new file mode 100644
index 000000000..9460e82a8
--- /dev/null
+++ b/admin/models/components_admin_views.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_admin_views Model
+ */
+class ComponentbuilderModelComponents_admin_views extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_admin_views.access', 'com_componentbuilder.component_admin_views.' . (int) $item->id) && $user->authorise('component_admin_views.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_admin_views', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_admin_views'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_admin_views'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_config.php b/admin/models/components_config.php
new file mode 100644
index 000000000..7f7b2d385
--- /dev/null
+++ b/admin/models/components_config.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_config Model
+ */
+class ComponentbuilderModelComponents_config extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_config.access', 'com_componentbuilder.component_config.' . (int) $item->id) && $user->authorise('component_config.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_config', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_config'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_config'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_custom_admin_menus.php b/admin/models/components_custom_admin_menus.php
new file mode 100644
index 000000000..f7e824e47
--- /dev/null
+++ b/admin/models/components_custom_admin_menus.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_custom_admin_menus Model
+ */
+class ComponentbuilderModelComponents_custom_admin_menus extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_custom_admin_menus.access', 'com_componentbuilder.component_custom_admin_menus.' . (int) $item->id) && $user->authorise('component_custom_admin_menus.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_custom_admin_menus', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_custom_admin_menus'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_custom_admin_menus'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_custom_admin_views.php b/admin/models/components_custom_admin_views.php
new file mode 100644
index 000000000..fbd280846
--- /dev/null
+++ b/admin/models/components_custom_admin_views.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_custom_admin_views Model
+ */
+class ComponentbuilderModelComponents_custom_admin_views extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_custom_admin_views.access', 'com_componentbuilder.component_custom_admin_views.' . (int) $item->id) && $user->authorise('component_custom_admin_views.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_custom_admin_views', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_custom_admin_views'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_custom_admin_views'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_dashboard.php b/admin/models/components_dashboard.php
new file mode 100644
index 000000000..00f3a1cd5
--- /dev/null
+++ b/admin/models/components_dashboard.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_dashboard Model
+ */
+class ComponentbuilderModelComponents_dashboard extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_dashboard.access', 'com_componentbuilder.component_dashboard.' . (int) $item->id) && $user->authorise('component_dashboard.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_dashboard', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_dashboard'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_dashboard'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_files_folders.php b/admin/models/components_files_folders.php
new file mode 100644
index 000000000..abc72b717
--- /dev/null
+++ b/admin/models/components_files_folders.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_files_folders Model
+ */
+class ComponentbuilderModelComponents_files_folders extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_files_folders.access', 'com_componentbuilder.component_files_folders.' . (int) $item->id) && $user->authorise('component_files_folders.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_files_folders', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_files_folders'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_files_folders'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_mysql_tweaks.php b/admin/models/components_mysql_tweaks.php
new file mode 100644
index 000000000..79ec93014
--- /dev/null
+++ b/admin/models/components_mysql_tweaks.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_mysql_tweaks Model
+ */
+class ComponentbuilderModelComponents_mysql_tweaks extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_mysql_tweaks.access', 'com_componentbuilder.component_mysql_tweaks.' . (int) $item->id) && $user->authorise('component_mysql_tweaks.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_mysql_tweaks', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_mysql_tweaks'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_mysql_tweaks'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_site_views.php b/admin/models/components_site_views.php
new file mode 100644
index 000000000..7e9219b16
--- /dev/null
+++ b/admin/models/components_site_views.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_site_views Model
+ */
+class ComponentbuilderModelComponents_site_views extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_site_views.access', 'com_componentbuilder.component_site_views.' . (int) $item->id) && $user->authorise('component_site_views.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_site_views', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_site_views'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_site_views'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/components_updates.php b/admin/models/components_updates.php
new file mode 100644
index 000000000..f8aaf2759
--- /dev/null
+++ b/admin/models/components_updates.php
@@ -0,0 +1,256 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the Joomla modellist library
+jimport('joomla.application.component.modellist');
+
+/**
+ * Components_updates Model
+ */
+class ComponentbuilderModelComponents_updates extends JModelList
+{
+ public function __construct($config = array())
+ {
+ if (empty($config['filter_fields']))
+ {
+ $config['filter_fields'] = array(
+ 'a.id','id',
+ 'a.published','published',
+ 'a.ordering','ordering',
+ 'a.created_by','created_by',
+ 'a.modified_by','modified_by'
+ );
+ }
+
+ parent::__construct($config);
+ }
+
+ /**
+ * Method to auto-populate the model state.
+ *
+ * @return void
+ */
+ protected function populateState($ordering = null, $direction = null)
+ {
+ $app = JFactory::getApplication();
+
+ // Adjust the context to support modal layouts.
+ if ($layout = $app->input->get('layout'))
+ {
+ $this->context .= '.' . $layout;
+ }
+
+
+ $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int');
+ $this->setState('filter.sorting', $sorting);
+
+ $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
+ $this->setState('filter.access', $access);
+
+ $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
+ $this->setState('filter.search', $search);
+
+ $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
+ $this->setState('filter.published', $published);
+
+ $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', '');
+ $this->setState('filter.created_by', $created_by);
+
+ $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
+ $this->setState('filter.created', $created);
+
+ // List state information.
+ parent::populateState($ordering, $direction);
+ }
+
+ /**
+ * Method to get an array of data items.
+ *
+ * @return mixed An array of data items on success, false on failure.
+ */
+ public function getItems()
+ {
+ // check in items
+ $this->checkInNow();
+
+ // load parent items
+ $items = parent::getItems();
+
+ // set values to display correctly.
+ if (ComponentbuilderHelper::checkArray($items))
+ {
+ // get user object.
+ $user = JFactory::getUser();
+ foreach ($items as $nr => &$item)
+ {
+ $access = ($user->authorise('component_updates.access', 'com_componentbuilder.component_updates.' . (int) $item->id) && $user->authorise('component_updates.access', 'com_componentbuilder'));
+ if (!$access)
+ {
+ unset($items[$nr]);
+ continue;
+ }
+
+ }
+ }
+
+ // return items
+ return $items;
+ }
+
+ /**
+ * Method to build an SQL query to load the list data.
+ *
+ * @return string An SQL query
+ */
+ protected function getListQuery()
+ {
+ // Get the user object.
+ $user = JFactory::getUser();
+ // Create a new query object.
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+
+ // Select some fields
+ $query->select('a.*');
+
+ // From the componentbuilder_item table
+ $query->from($db->quoteName('#__componentbuilder_component_updates', 'a'));
+
+ // From the componentbuilder_joomla_component table.
+ $query->select($db->quoteName('g.system_name','joomla_component_system_name'));
+ $query->join('LEFT', $db->quoteName('#__componentbuilder_joomla_component', 'g') . ' ON (' . $db->quoteName('a.joomla_component') . ' = ' . $db->quoteName('g.id') . ')');
+
+ // Filter by published state
+ $published = $this->getState('filter.published');
+ if (is_numeric($published))
+ {
+ $query->where('a.published = ' . (int) $published);
+ }
+ elseif ($published === '')
+ {
+ $query->where('(a.published = 0 OR a.published = 1)');
+ }
+
+ // Join over the asset groups.
+ $query->select('ag.title AS access_level');
+ $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
+ // Filter by access level.
+ if ($access = $this->getState('filter.access'))
+ {
+ $query->where('a.access = ' . (int) $access);
+ }
+ // Implement View Level Access
+ if (!$user->authorise('core.options', 'com_componentbuilder'))
+ {
+ $groups = implode(',', $user->getAuthorisedViewLevels());
+ $query->where('a.access IN (' . $groups . ')');
+ }
+
+ // Add the list ordering clause.
+ $orderCol = $this->state->get('list.ordering', 'a.id');
+ $orderDirn = $this->state->get('list.direction', 'asc');
+ if ($orderCol != '')
+ {
+ $query->order($db->escape($orderCol . ' ' . $orderDirn));
+ }
+
+ return $query;
+ }
+
+ /**
+ * Method to get a store id based on model configuration state.
+ *
+ * @return string A store id.
+ *
+ */
+ protected function getStoreId($id = '')
+ {
+ // Compile the store id.
+ $id .= ':' . $this->getState('filter.id');
+ $id .= ':' . $this->getState('filter.search');
+ $id .= ':' . $this->getState('filter.published');
+ $id .= ':' . $this->getState('filter.ordering');
+ $id .= ':' . $this->getState('filter.created_by');
+ $id .= ':' . $this->getState('filter.modified_by');
+
+ return parent::getStoreId($id);
+ }
+
+ /**
+ * Build an SQL query to checkin all items left checked out longer then a set time.
+ *
+ * @return a bool
+ *
+ */
+ protected function checkInNow()
+ {
+ // Get set check in time
+ $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in');
+
+ if ($time)
+ {
+
+ // Get a db connection.
+ $db = JFactory::getDbo();
+ // reset query
+ $query = $db->getQuery(true);
+ $query->select('*');
+ $query->from($db->quoteName('#__componentbuilder_component_updates'));
+ $db->setQuery($query);
+ $db->execute();
+ if ($db->getNumRows())
+ {
+ // Get Yesterdays date
+ $date = JFactory::getDate()->modify($time)->toSql();
+ // reset query
+ $query = $db->getQuery(true);
+
+ // Fields to update.
+ $fields = array(
+ $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
+ $db->quoteName('checked_out') . '=0'
+ );
+
+ // Conditions for which records should be updated.
+ $conditions = array(
+ $db->quoteName('checked_out') . '!=0',
+ $db->quoteName('checked_out_time') . '<\''.$date.'\''
+ );
+
+ // Check table
+ $query->update($db->quoteName('#__componentbuilder_component_updates'))->set($fields)->where($conditions);
+
+ $db->setQuery($query);
+
+ $db->execute();
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php
index eac01ceb5..887ace17a 100644
--- a/admin/models/custom_admin_view.php
+++ b/admin/models/custom_admin_view.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 32 of this MVC
- @build 20th October, 2017
+ @build 25th October, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_view.php
@@ -198,7 +198,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
$item->tags->getTagIds($item->id, 'com_componentbuilder.custom_admin_view');
}
}
- $this->addcustom_admin_viewsvvwa = $item->id;
+ $this->addcustom_admin_viewsvvvw = $item->id;
return $item;
}
@@ -208,7 +208,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
- public function getVyjlinked_components()
+ public function getVyelinked_components()
{
// Get the user object.
$user = JFactory::getUser();
@@ -265,15 +265,15 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin
}
}
- // Filter by addcustom_admin_viewsvvwa in this Repetable Field
- if (ComponentbuilderHelper::checkArray($items) && isset($this->addcustom_admin_viewsvvwa))
+ // Filter by addcustom_admin_viewsvvvw in this Repetable Field
+ if (ComponentbuilderHelper::checkArray($items) && isset($this->addcustom_admin_viewsvvvw))
{
foreach ($items as $nr => &$item)
{
if (isset($item->addcustom_admin_views) && ComponentbuilderHelper::checkJson($item->addcustom_admin_views))
{
$tmpArray = json_decode($item->addcustom_admin_views,true);
- if (!isset($tmpArray['customadminview']) || !ComponentbuilderHelper::checkArray($tmpArray['customadminview']) || !in_array($this->addcustom_admin_viewsvvwa, $tmpArray['customadminview']))
+ if (!isset($tmpArray['customadminview']) || !ComponentbuilderHelper::checkArray($tmpArray['customadminview']) || !in_array($this->addcustom_admin_viewsvvvw, $tmpArray['customadminview']))
{
unset($items[$nr]);
continue;
diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php
index 0287d9644..c4bcb8cc4 100644
--- a/admin/models/custom_admin_views.php
+++ b/admin/models/custom_admin_views.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 32 of this MVC
- @build 20th October, 2017
+ @build 25th October, 2017
@created 13th August, 2015
@package Component Builder
@subpackage custom_admin_views.php
diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php
index ff8535e42..03b791b2e 100644
--- a/admin/models/custom_code.php
+++ b/admin/models/custom_code.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 84 of this MVC
- @build 13th October, 2017
+ @version @update number 86 of this MVC
+ @build 27th October, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_code.php
diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php
index 34fe22303..81b96fadd 100644
--- a/admin/models/custom_codes.php
+++ b/admin/models/custom_codes.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 84 of this MVC
- @build 13th October, 2017
+ @version @update number 86 of this MVC
+ @build 27th October, 2017
@created 11th October, 2016
@package Component Builder
@subpackage custom_codes.php
@@ -280,7 +280,7 @@ class ComponentbuilderModelCustom_codes extends JModelList
else
{
$search = $db->quote('%' . $db->escape($search) . '%');
- $query->where('(a.component LIKE '.$search.' OR g.system_name LIKE '.$search.' OR a.path LIKE '.$search.' OR a.comment_type LIKE '.$search.' OR a.function_name LIKE '.$search.' OR a.system_name LIKE '.$search.')');
+ $query->where('(a.component LIKE '.$search.' OR a.path LIKE '.$search.' OR a.comment_type LIKE '.$search.' OR a.function_name LIKE '.$search.' OR a.system_name LIKE '.$search.')');
}
}
diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php
index 0c561c3a0..ed29acd17 100644
--- a/admin/models/dynamic_get.php
+++ b/admin/models/dynamic_get.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 98 of this MVC
- @build 20th October, 2017
+ @version @update number 101 of this MVC
+ @build 26th October, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_get.php
@@ -183,6 +183,42 @@ class ComponentbuilderModelDynamic_get extends JModelAdmin
{
// base64 Decode php_calculation.
$item->php_calculation = base64_decode($item->php_calculation);
+ }
+
+ // update the fields
+ $objectUpdate = new stdClass();
+ $objectUpdate->id = (int) $item->id;
+ // repeatable values to check
+ $arrayChecker = array(
+ 'join_view_table' => 'view_table',
+ 'join_db_table' => 'db_table',
+ 'filter' => 'filter_type',
+ 'where' => 'table_key',
+ 'order' => 'table_key',
+ 'global' => 'name'
+ );
+ foreach ($arrayChecker as $_value => $checker)
+ {
+ // check what type of array we have here (should be subform... but just in case)
+ // This could happen due to huge data sets
+ if (isset($item->{$_value}) && isset($item->{$_value}[$checker]))
+ {
+ $bucket = array();
+ foreach($item->{$_value} as $option => $values)
+ {
+ foreach($values as $nr => $value)
+ {
+ $bucket[$_value.$nr][$option] = $value;
+ }
+ }
+ $item->{$_value} = $bucket;
+ $objectUpdate->{$_value} = json_encode($bucket);
+ }
+ }
+ // be sure to update the table if we found repeatable fields that are still not converted
+ if (count((array) $objectUpdate) > 1)
+ {
+ $this->_db->updateObject('#__componentbuilder_dynamic_get', $objectUpdate, 'id');
}
if (!empty($item->id))
diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php
index 5ecc96b95..3d5c45262 100644
--- a/admin/models/dynamic_gets.php
+++ b/admin/models/dynamic_gets.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 98 of this MVC
- @build 20th October, 2017
+ @version @update number 101 of this MVC
+ @build 26th October, 2017
@created 21st May, 2015
@package Component Builder
@subpackage dynamic_gets.php
diff --git a/admin/models/field.php b/admin/models/field.php
index 9a63f570c..b856f549c 100644
--- a/admin/models/field.php
+++ b/admin/models/field.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
- @build 18th October, 2017
+ @build 25th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage field.php
diff --git a/admin/models/fields.php b/admin/models/fields.php
index cc5717896..78ddc31d0 100644
--- a/admin/models/fields.php
+++ b/admin/models/fields.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 40 of this MVC
- @build 18th October, 2017
+ @build 25th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.php
@@ -312,7 +312,7 @@ class ComponentbuilderModelFields extends JModelList
else
{
$search = $db->quote('%' . $db->escape($search) . '%');
- $query->where('(a.name LIKE '.$search.' OR a.fieldtype LIKE '.$search.' OR g.name LIKE '.$search.' OR a.datatype LIKE '.$search.' OR a.indexes LIKE '.$search.' OR a.null_switch LIKE '.$search.' OR a.xml LIKE '.$search.' OR a.catid LIKE '.$search.' OR a.store LIKE '.$search.')');
+ $query->where('(a.name LIKE '.$search.' OR a.fieldtype LIKE '.$search.' OR a.datatype LIKE '.$search.' OR a.indexes LIKE '.$search.' OR a.null_switch LIKE '.$search.' OR a.xml LIKE '.$search.' OR a.catid LIKE '.$search.' OR a.store LIKE '.$search.')');
}
}
diff --git a/admin/models/fields/ftps.php b/admin/models/fields/adminsviews.php
similarity index 81%
rename from admin/models/fields/ftps.php
rename to admin/models/fields/adminsviews.php
index 045b42153..559b3d68a 100644
--- a/admin/models/fields/ftps.php
+++ b/admin/models/fields/adminsviews.php
@@ -10,11 +10,11 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
- @subpackage ftps.php
+ @subpackage adminsviews.php
@author Llewellyn van der Merwe
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@@ -31,16 +31,16 @@ jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
/**
- * Ftps Form Field class for the Componentbuilder component
+ * Adminsviews Form Field class for the Componentbuilder component
*/
-class JFormFieldFtps extends JFormFieldList
+class JFormFieldAdminsviews extends JFormFieldList
{
/**
- * The ftps field type.
+ * The adminsviews field type.
*
* @var string
*/
- public $type = 'ftps';
+ public $type = 'adminsviews';
/**
* Override to add new button
*
@@ -78,8 +78,8 @@ class JFormFieldFtps extends JFormFieldList
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
- // only add if user allowed to create ftp
- if ($user->authorise('ftp.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ // only add if user allowed to create admin_view
+ if ($user->authorise('admin_view.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build Create button
$buttonNamee = trim($buttonName);
@@ -88,11 +88,11 @@ class JFormFieldFtps extends JFormFieldList
$buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '
+ href="index.php?option=com_componentbuilder&view=admin_view&layout=edit'.$ref.'" >
';
}
- // only add if user allowed to edit ftp
- if (($buttonName === 'ftp' || $buttonName === 'ftps') && $user->authorise('ftp.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ // only add if user allowed to edit admin_view
+ if (($buttonName === 'admin_view' || $buttonName === 'admin_views') && $user->authorise('admin_view.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
{
// build edit button
$buttonNamee = trim($buttonName);
@@ -119,7 +119,7 @@ class JFormFieldFtps extends JFormFieldList
jQuery('#".$buttonName."Create').hide();
// show edit button
jQuery('#".$buttonName."Edit').show();
- var url = 'index.php?option=com_componentbuilder&view=ftps&task=ftp.edit&id='+value+'".$refJ."';
+ var url = 'index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit&id='+value+'".$refJ."';
jQuery('#".$buttonName."Edit').attr('href', url);
} else {
// show the create button
@@ -129,7 +129,7 @@ class JFormFieldFtps extends JFormFieldList
}
}";
}
- // check if button was created for ftp field.
+ // check if button was created for admin_view field.
if (is_array($button) && count($button) > 0)
{
// Load the needed script.
@@ -151,19 +151,18 @@ class JFormFieldFtps extends JFormFieldList
{
$db = JFactory::getDBO();
$query = $db->getQuery(true);
- $query->select($db->quoteName(array('a.id','a.name'),array('id','sales_server_ftp_name')));
- $query->from($db->quoteName('#__componentbuilder_ftp', 'a'));
+ $query->select($db->quoteName(array('a.id','a.system_name'),array('id','adminviews_system_name')));
+ $query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
- $query->order('a.name ASC');
+ $query->order('a.system_name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
- $options[] = JHtml::_('select.option', '', 'Select an option');
foreach($items as $item)
{
- $options[] = JHtml::_('select.option', $item->id, $item->sales_server_ftp_name);
+ $options[] = JHtml::_('select.option', $item->id, $item->adminviews_system_name);
}
}
return $options;
diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php
index 948ab3331..15866c243 100644
--- a/admin/models/fields/adminviewfolderlist.php
+++ b/admin/models/fields/adminviewfolderlist.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviewfolderlist.php
diff --git a/admin/models/fields/adminviews.php b/admin/models/fields/adminviews.php
index 720337861..fa862fcf8 100644
--- a/admin/models/fields/adminviews.php
+++ b/admin/models/fields/adminviews.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage adminviews.php
@@ -153,7 +153,7 @@ class JFormFieldAdminviews extends JFormFieldList
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.system_name'),array('id','adminview_system_name')));
$query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
- $query->where($db->quoteName('a.published') . ' = 1');
+ $query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.system_name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php
index 49c387925..68c393041 100644
--- a/admin/models/fields/articles.php
+++ b/admin/models/fields/articles.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage articles.php
diff --git a/admin/models/fields/component.php b/admin/models/fields/component.php
index 907468023..a380025e2 100644
--- a/admin/models/fields/component.php
+++ b/admin/models/fields/component.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage component.php
diff --git a/admin/models/fields/componentadminmenus.php b/admin/models/fields/componentadminmenus.php
new file mode 100644
index 000000000..a23074bf9
--- /dev/null
+++ b/admin/models/fields/componentadminmenus.php
@@ -0,0 +1,216 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the list field type
+jimport('joomla.form.helper');
+JFormHelper::loadFieldClass('list');
+
+/**
+ * Componentadminmenus Form Field class for the Componentbuilder component
+ */
+class JFormFieldComponentadminmenus extends JFormFieldList
+{
+ /**
+ * The componentadminmenus field type.
+ *
+ * @var string
+ */
+ public $type = 'componentadminmenus';
+ /**
+ * Override to add new button
+ *
+ * @return string The field input markup.
+ *
+ * @since 3.2
+ */
+ protected function getInput()
+ {
+ // see if we should add buttons
+ $setButton = $this->getAttribute('button');
+ // get html
+ $html = parent::getInput();
+ // if true set button
+ if ($setButton === 'true')
+ {
+ $button = array();
+ $script = array();
+ $buttonName = $this->getAttribute('name');
+ // get the input from url
+ $app = JFactory::getApplication();
+ $jinput = $app->input;
+ // get the view name & id
+ $values = $jinput->getArray(array(
+ 'id' => 'int',
+ 'view' => 'word'
+ ));
+ // check if new item
+ $ref = '';
+ $refJ = '';
+ if (!is_null($values['id']) && strlen($values['view']))
+ {
+ // only load referal if not new item.
+ $ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ }
+ $user = JFactory::getUser();
+ // only add if user allowed to create admin_view
+ if ($user->authorise('admin_view.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build Create button
+ $buttonNamee = trim($buttonName);
+ $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
+ $buttonNamee = ucfirst(strtolower($buttonNamee));
+ $button[] = '
+ ';
+ }
+ // only add if user allowed to edit admin_view
+ if (($buttonName === 'admin_view' || $buttonName === 'admin_views') && $user->authorise('admin_view.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build edit button
+ $buttonNamee = trim($buttonName);
+ $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
+ $buttonNamee = ucfirst(strtolower($buttonNamee));
+ $button[] = ' ';
+ // build script
+ $script[] = "
+ jQuery(document).ready(function() {
+ jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ e.preventDefault();
+ var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
+ ".$buttonName."Button(".$buttonName."Value);
+ });
+ var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
+ ".$buttonName."Button(".$buttonName."Value);
+ });
+ function ".$buttonName."Button(value) {
+ if (value > 0) {
+ // hide the create button
+ jQuery('#".$buttonName."Create').hide();
+ // show edit button
+ jQuery('#".$buttonName."Edit').show();
+ var url = 'index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit&id='+value+'".$refJ."';
+ jQuery('#".$buttonName."Edit').attr('href', url);
+ } else {
+ // show the create button
+ jQuery('#".$buttonName."Create').show();
+ // hide edit button
+ jQuery('#".$buttonName."Edit').hide();
+ }
+ }";
+ }
+ // check if button was created for admin_view field.
+ if (is_array($button) && count($button) > 0)
+ {
+ // Load the needed script.
+ $document = JFactory::getDocument();
+ $document->addScriptDeclaration(implode(' ',$script));
+ // return the button attached to input field.
+ return '' .$html . implode('',$button).'';
+ }
+ }
+ return $html;
+ }
+
+ /**
+ * Method to get a list of options for a list input.
+ *
+ * @return array An array of JHtml options.
+ */
+ public function getOptions()
+ {
+ // load the db opbject
+ $db = JFactory::getDBO();
+ // get the input from url
+ $jinput = JFactory::getApplication()->input;
+ // get the id
+ $ID = $jinput->getInt('id', 0);
+ // rest the fields ids
+ $viewids = array();
+ if (is_numeric($ID) && $ID >= 1)
+ {
+ // get the joomla component ID
+ $joomlacomponent = ComponentbuilderHelper::getVar('component_custom_admin_menus', (int) $ID, 'id', 'joomla_component');
+ }
+ else
+ {
+ // get the joomla component ID
+ $joomlacomponent = $jinput->getInt('refid', 0);
+ }
+ if (is_numeric($joomlacomponent) && $joomlacomponent >= 1)
+ {
+ // get all the admin views linked to the joomla component
+ if ($addAdminViews = ComponentbuilderHelper::getVar('component_admin_views', (int) $joomlacomponent, 'joomla_component', 'addadmin_views'))
+ {
+ if (ComponentbuilderHelper::checkJson($addAdminViews))
+ {
+ $addAdminViews = json_decode($addAdminViews, true);
+ if (ComponentbuilderHelper::checkArray($addAdminViews))
+ {
+ foreach($addAdminViews as $addAdminView)
+ {
+ if (isset($addAdminView['adminview']))
+ {
+ $viewids[] = (int) $addAdminView['adminview'];
+ }
+ }
+ }
+ }
+ }
+ }
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('a.id','a.system_name'),array('id','name')));
+ $query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
+ $query->where($db->quoteName('a.published') . ' >= 1');
+ // filter by fields linked
+ if (ComponentbuilderHelper::checkArray($viewids))
+ {
+ // only load these fields
+ $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $viewids) . ')');
+ }
+ $query->order('a.system_name ASC');
+ $db->setQuery((string)$query);
+ $items = $db->loadObjectList();
+ $options = array();
+ if ($items)
+ {
+ $options[] = JHtml::_('select.option', '', 'Select an option');
+ foreach($items as $item)
+ {
+ $options[] = JHtml::_('select.option', $item->id, $item->name);
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/admin/models/fields/componentadminviews.php b/admin/models/fields/componentadminviews.php
new file mode 100644
index 000000000..937f1d34d
--- /dev/null
+++ b/admin/models/fields/componentadminviews.php
@@ -0,0 +1,216 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the list field type
+jimport('joomla.form.helper');
+JFormHelper::loadFieldClass('list');
+
+/**
+ * Componentadminviews Form Field class for the Componentbuilder component
+ */
+class JFormFieldComponentadminviews extends JFormFieldList
+{
+ /**
+ * The componentadminviews field type.
+ *
+ * @var string
+ */
+ public $type = 'componentadminviews';
+ /**
+ * Override to add new button
+ *
+ * @return string The field input markup.
+ *
+ * @since 3.2
+ */
+ protected function getInput()
+ {
+ // see if we should add buttons
+ $setButton = $this->getAttribute('button');
+ // get html
+ $html = parent::getInput();
+ // if true set button
+ if ($setButton === 'true')
+ {
+ $button = array();
+ $script = array();
+ $buttonName = $this->getAttribute('name');
+ // get the input from url
+ $app = JFactory::getApplication();
+ $jinput = $app->input;
+ // get the view name & id
+ $values = $jinput->getArray(array(
+ 'id' => 'int',
+ 'view' => 'word'
+ ));
+ // check if new item
+ $ref = '';
+ $refJ = '';
+ if (!is_null($values['id']) && strlen($values['view']))
+ {
+ // only load referal if not new item.
+ $ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ }
+ $user = JFactory::getUser();
+ // only add if user allowed to create admin_view
+ if ($user->authorise('admin_view.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build Create button
+ $buttonNamee = trim($buttonName);
+ $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
+ $buttonNamee = ucfirst(strtolower($buttonNamee));
+ $button[] = '
+ ';
+ }
+ // only add if user allowed to edit admin_view
+ if (($buttonName === 'admin_view' || $buttonName === 'admin_views') && $user->authorise('admin_view.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build edit button
+ $buttonNamee = trim($buttonName);
+ $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
+ $buttonNamee = ucfirst(strtolower($buttonNamee));
+ $button[] = ' ';
+ // build script
+ $script[] = "
+ jQuery(document).ready(function() {
+ jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ e.preventDefault();
+ var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
+ ".$buttonName."Button(".$buttonName."Value);
+ });
+ var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
+ ".$buttonName."Button(".$buttonName."Value);
+ });
+ function ".$buttonName."Button(value) {
+ if (value > 0) {
+ // hide the create button
+ jQuery('#".$buttonName."Create').hide();
+ // show edit button
+ jQuery('#".$buttonName."Edit').show();
+ var url = 'index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit&id='+value+'".$refJ."';
+ jQuery('#".$buttonName."Edit').attr('href', url);
+ } else {
+ // show the create button
+ jQuery('#".$buttonName."Create').show();
+ // hide edit button
+ jQuery('#".$buttonName."Edit').hide();
+ }
+ }";
+ }
+ // check if button was created for admin_view field.
+ if (is_array($button) && count($button) > 0)
+ {
+ // Load the needed script.
+ $document = JFactory::getDocument();
+ $document->addScriptDeclaration(implode(' ',$script));
+ // return the button attached to input field.
+ return '' .$html . implode('',$button).'';
+ }
+ }
+ return $html;
+ }
+
+ /**
+ * Method to get a list of options for a list input.
+ *
+ * @return array An array of JHtml options.
+ */
+ public function getOptions()
+ {
+ // load the db opbject
+ $db = JFactory::getDBO();
+ // get the input from url
+ $jinput = JFactory::getApplication()->input;
+ // get the id
+ $ID = $jinput->getInt('id', 0);
+ // rest the fields ids
+ $viewids = array();
+ if (is_numeric($ID) && $ID >= 1)
+ {
+ // get the joomla component ID
+ $joomlacomponent = ComponentbuilderHelper::getVar('component_mysql_tweaks', (int) $ID, 'id', 'joomla_component');
+ }
+ else
+ {
+ // get the joomla component ID
+ $joomlacomponent = $jinput->getInt('refid', 0);
+ }
+ if (is_numeric($joomlacomponent) && $joomlacomponent >= 1)
+ {
+ // get all the admin views linked to the joomla component
+ if ($addAdminViews = ComponentbuilderHelper::getVar('component_admin_views', (int) $joomlacomponent, 'joomla_component', 'addadmin_views'))
+ {
+ if (ComponentbuilderHelper::checkJson($addAdminViews))
+ {
+ $addAdminViews = json_decode($addAdminViews, true);
+ if (ComponentbuilderHelper::checkArray($addAdminViews))
+ {
+ foreach($addAdminViews as $addAdminView)
+ {
+ if (isset($addAdminView['adminview']))
+ {
+ $viewids[] = (int) $addAdminView['adminview'];
+ }
+ }
+ }
+ }
+ }
+ }
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('a.id','a.system_name'),array('id','name')));
+ $query->from($db->quoteName('#__componentbuilder_admin_view', 'a'));
+ $query->where($db->quoteName('a.published') . ' >= 1');
+ // filter by fields linked
+ if (ComponentbuilderHelper::checkArray($viewids))
+ {
+ // only load these fields
+ $query->where($db->quoteName('a.id') . ' IN (' . implode(',', $viewids) . ')');
+ }
+ $query->order('a.system_name ASC');
+ $db->setQuery((string)$query);
+ $items = $db->loadObjectList();
+ $options = array();
+ if ($items)
+ {
+ $options[] = JHtml::_('select.option', '', 'Select an option');
+ foreach($items as $item)
+ {
+ $options[] = JHtml::_('select.option', $item->id, $item->name);
+ }
+ }
+
+ return $options;
+ }
+}
diff --git a/admin/models/fields/components.php b/admin/models/fields/components.php
index 0e8712c79..aa8491e72 100644
--- a/admin/models/fields/components.php
+++ b/admin/models/fields/components.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage components.php
diff --git a/admin/models/fields/customadminviews.php b/admin/models/fields/customadminviews.php
index ef032fc95..4364ed856 100644
--- a/admin/models/fields/customadminviews.php
+++ b/admin/models/fields/customadminviews.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customadminviews.php
@@ -153,13 +153,14 @@ class JFormFieldCustomadminviews extends JFormFieldList
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.system_name'),array('id','customadminview_system_name')));
$query->from($db->quoteName('#__componentbuilder_custom_admin_view', 'a'));
- $query->where($db->quoteName('a.published') . ' = 1');
+ $query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.system_name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
+ $options[] = JHtml::_('select.option', '', 'Select an option');
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->customadminview_system_name);
diff --git a/admin/models/fields/customfilelist.php b/admin/models/fields/customfilelist.php
index bebe5e3f3..e0f7f0900 100644
--- a/admin/models/fields/customfilelist.php
+++ b/admin/models/fields/customfilelist.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfilelist.php
diff --git a/admin/models/fields/customfolderlist.php b/admin/models/fields/customfolderlist.php
index 0e2cce6b8..81c647312 100644
--- a/admin/models/fields/customfolderlist.php
+++ b/admin/models/fields/customfolderlist.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customfolderlist.php
diff --git a/admin/models/fields/customgets.php b/admin/models/fields/customgets.php
index 452988d33..1d3db10d0 100644
--- a/admin/models/fields/customgets.php
+++ b/admin/models/fields/customgets.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage customgets.php
diff --git a/admin/models/fields/dbtables.php b/admin/models/fields/dbtables.php
index 86b027ccc..84e82dbea 100644
--- a/admin/models/fields/dbtables.php
+++ b/admin/models/fields/dbtables.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dbtables.php
diff --git a/admin/models/fields/dynamicget.php b/admin/models/fields/dynamicget.php
index 90f70d3f3..a819f8760 100644
--- a/admin/models/fields/dynamicget.php
+++ b/admin/models/fields/dynamicget.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicget.php
diff --git a/admin/models/fields/dynamicgets.php b/admin/models/fields/dynamicgets.php
index fa24590dc..6cc995e29 100644
--- a/admin/models/fields/dynamicgets.php
+++ b/admin/models/fields/dynamicgets.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage dynamicgets.php
diff --git a/admin/models/fields/fields.php b/admin/models/fields/fields.php
index f37c14ab7..b6c8a612b 100644
--- a/admin/models/fields/fields.php
+++ b/admin/models/fields/fields.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fields.php
@@ -153,7 +153,7 @@ class JFormFieldFields extends JFormFieldList
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.name'),array('id','field_name')));
$query->from($db->quoteName('#__componentbuilder_field', 'a'));
- $query->where($db->quoteName('a.published') . ' = 1');
+ $query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
diff --git a/admin/models/fields/fieldtypes.php b/admin/models/fields/fieldtypes.php
index 98c2e8746..40abc282d 100644
--- a/admin/models/fields/fieldtypes.php
+++ b/admin/models/fields/fieldtypes.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php
diff --git a/admin/models/fields/joomlacomponents.php b/admin/models/fields/joomlacomponents.php
new file mode 100644
index 000000000..47aea3109
--- /dev/null
+++ b/admin/models/fields/joomlacomponents.php
@@ -0,0 +1,171 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the list field type
+jimport('joomla.form.helper');
+JFormHelper::loadFieldClass('list');
+
+/**
+ * Joomlacomponents Form Field class for the Componentbuilder component
+ */
+class JFormFieldJoomlacomponents extends JFormFieldList
+{
+ /**
+ * The joomlacomponents field type.
+ *
+ * @var string
+ */
+ public $type = 'joomlacomponents';
+ /**
+ * Override to add new button
+ *
+ * @return string The field input markup.
+ *
+ * @since 3.2
+ */
+ protected function getInput()
+ {
+ // see if we should add buttons
+ $setButton = $this->getAttribute('button');
+ // get html
+ $html = parent::getInput();
+ // if true set button
+ if ($setButton === 'true')
+ {
+ $button = array();
+ $script = array();
+ $buttonName = $this->getAttribute('name');
+ // get the input from url
+ $app = JFactory::getApplication();
+ $jinput = $app->input;
+ // get the view name & id
+ $values = $jinput->getArray(array(
+ 'id' => 'int',
+ 'view' => 'word'
+ ));
+ // check if new item
+ $ref = '';
+ $refJ = '';
+ if (!is_null($values['id']) && strlen($values['view']))
+ {
+ // only load referal if not new item.
+ $ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ }
+ $user = JFactory::getUser();
+ // only add if user allowed to create joomla_component
+ if ($user->authorise('joomla_component.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build Create button
+ $buttonNamee = trim($buttonName);
+ $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
+ $buttonNamee = ucfirst(strtolower($buttonNamee));
+ $button[] = '
+ ';
+ }
+ // only add if user allowed to edit joomla_component
+ if (($buttonName === 'joomla_component' || $buttonName === 'joomla_components') && $user->authorise('joomla_component.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build edit button
+ $buttonNamee = trim($buttonName);
+ $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
+ $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee);
+ $buttonNamee = ucfirst(strtolower($buttonNamee));
+ $button[] = ' ';
+ // build script
+ $script[] = "
+ jQuery(document).ready(function() {
+ jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
+ e.preventDefault();
+ var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
+ ".$buttonName."Button(".$buttonName."Value);
+ });
+ var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val();
+ ".$buttonName."Button(".$buttonName."Value);
+ });
+ function ".$buttonName."Button(value) {
+ if (value > 0) {
+ // hide the create button
+ jQuery('#".$buttonName."Create').hide();
+ // show edit button
+ jQuery('#".$buttonName."Edit').show();
+ var url = 'index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit&id='+value+'".$refJ."';
+ jQuery('#".$buttonName."Edit').attr('href', url);
+ } else {
+ // show the create button
+ jQuery('#".$buttonName."Create').show();
+ // hide edit button
+ jQuery('#".$buttonName."Edit').hide();
+ }
+ }";
+ }
+ // check if button was created for joomla_component field.
+ if (is_array($button) && count($button) > 0)
+ {
+ // Load the needed script.
+ $document = JFactory::getDocument();
+ $document->addScriptDeclaration(implode(' ',$script));
+ // return the button attached to input field.
+ return '' .$html . implode('',$button).'';
+ }
+ }
+ return $html;
+ }
+
+ /**
+ * Method to get a list of options for a list input.
+ *
+ * @return array An array of JHtml options.
+ */
+ public function getOptions()
+ {
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('a.id','a.system_name'),array('id','joomla_component_system_name')));
+ $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a'));
+ $query->where($db->quoteName('a.published') . ' >= 1');
+ $query->order('a.system_name ASC');
+ $db->setQuery((string)$query);
+ $items = $db->loadObjectList();
+ $options = array();
+ if ($items)
+ {
+ $options[] = JHtml::_('select.option', '', 'Select an option');
+ foreach($items as $item)
+ {
+ $options[] = JHtml::_('select.option', $item->id, $item->joomla_component_system_name);
+ }
+ }
+ return $options;
+ }
+}
diff --git a/admin/models/fields/lang.php b/admin/models/fields/lang.php
index d025e410c..a5d99be3b 100644
--- a/admin/models/fields/lang.php
+++ b/admin/models/fields/lang.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage lang.php
diff --git a/admin/models/fields/maingets.php b/admin/models/fields/maingets.php
index a3bdccab3..cd316f5b7 100644
--- a/admin/models/fields/maingets.php
+++ b/admin/models/fields/maingets.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage maingets.php
diff --git a/admin/models/fields/matchfield.php b/admin/models/fields/matchfield.php
index 4b143d0a2..41c2eae44 100644
--- a/admin/models/fields/matchfield.php
+++ b/admin/models/fields/matchfield.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage matchfield.php
diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php
index b86f93a79..8f3c8590f 100644
--- a/admin/models/fields/siteviewfolderlist.php
+++ b/admin/models/fields/siteviewfolderlist.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviewfolderlist.php
diff --git a/admin/models/fields/siteviews.php b/admin/models/fields/siteviews.php
index 4c128b10c..999fd92b0 100644
--- a/admin/models/fields/siteviews.php
+++ b/admin/models/fields/siteviews.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage siteviews.php
@@ -153,13 +153,14 @@ class JFormFieldSiteviews extends JFormFieldList
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.id','a.system_name'),array('id','siteview_system_name')));
$query->from($db->quoteName('#__componentbuilder_site_view', 'a'));
- $query->where($db->quoteName('a.published') . ' = 1');
+ $query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.system_name ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
+ $options[] = JHtml::_('select.option', '', 'Select an option');
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->id, $item->siteview_system_name);
diff --git a/admin/models/fields/snippets.php b/admin/models/fields/snippets.php
index 9975c16af..a49420cbd 100644
--- a/admin/models/fields/snippets.php
+++ b/admin/models/fields/snippets.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage snippets.php
diff --git a/admin/models/fields/targetfields.php b/admin/models/fields/targetfields.php
index 20f358dd6..0d1c39518 100644
--- a/admin/models/fields/targetfields.php
+++ b/admin/models/fields/targetfields.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage targetfields.php
diff --git a/admin/models/fields/viewtabs.php b/admin/models/fields/viewtabs.php
index ec6b94c81..e5a3be148 100644
--- a/admin/models/fields/viewtabs.php
+++ b/admin/models/fields/viewtabs.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage viewtabs.php
@@ -177,7 +177,9 @@ class JFormFieldViewtabs extends JFormFieldList
else
{
$options[] = JHtml::_('select.option', 1, JText::_('COM_COMPONENTBUILDER_DETAILS'));
- }
+ }
+ // add the default publish tab as an option
+ $options[] = JHtml::_('select.option', 15, JText::_('COM_COMPONENTBUILDER_PUBLISHING'));
return $options;
}
}
diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php
index 83026ce2d..5442204e9 100644
--- a/admin/models/fieldtype.php
+++ b/admin/models/fieldtype.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
- @build 13th October, 2017
+ @build 26th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtype.php
@@ -129,7 +129,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$item->tags->getTagIds($item->id, 'com_componentbuilder.fieldtype');
}
}
- $this->fieldtypevvwc = $item->id;
+ $this->fieldtypevvvy = $item->id;
return $item;
}
@@ -139,7 +139,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return mixed An array of data items on success, false on failure.
*/
- public function getWabfields()
+ public function getVzwfields()
{
// Get the user object.
$user = JFactory::getUser();
@@ -159,15 +159,15 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$query->select($db->quoteName('g.name','fieldtype_name'));
$query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'g') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('g.id') . ')');
- // Filter by fieldtypevvwc global.
- $fieldtypevvwc = $this->fieldtypevvwc;
- if (is_numeric($fieldtypevvwc ))
+ // Filter by fieldtypevvvy global.
+ $fieldtypevvvy = $this->fieldtypevvvy;
+ if (is_numeric($fieldtypevvvy ))
{
- $query->where('a.fieldtype = ' . (int) $fieldtypevvwc );
+ $query->where('a.fieldtype = ' . (int) $fieldtypevvvy );
}
- elseif (is_string($fieldtypevvwc))
+ elseif (is_string($fieldtypevvvy))
{
- $query->where('a.fieldtype = ' . $db->quote($fieldtypevvwc));
+ $query->where('a.fieldtype = ' . $db->quote($fieldtypevvvy));
}
else
{
@@ -223,13 +223,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
foreach ($items as $nr => &$item)
{
// convert datatype
- $item->datatype = $this->selectionTranslationWabfields($item->datatype, 'datatype');
+ $item->datatype = $this->selectionTranslationVzwfields($item->datatype, 'datatype');
// convert indexes
- $item->indexes = $this->selectionTranslationWabfields($item->indexes, 'indexes');
+ $item->indexes = $this->selectionTranslationVzwfields($item->indexes, 'indexes');
// convert null_switch
- $item->null_switch = $this->selectionTranslationWabfields($item->null_switch, 'null_switch');
+ $item->null_switch = $this->selectionTranslationVzwfields($item->null_switch, 'null_switch');
// convert store
- $item->store = $this->selectionTranslationWabfields($item->store, 'store');
+ $item->store = $this->selectionTranslationVzwfields($item->store, 'store');
}
}
@@ -243,7 +243,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
*
* @return translatable string
*/
- public function selectionTranslationWabfields($value,$name)
+ public function selectionTranslationVzwfields($value,$name)
{
// Array of datatype language strings
if ($name === 'datatype')
diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php
index 96f3186ed..411d7f4fe 100644
--- a/admin/models/fieldtypes.php
+++ b/admin/models/fieldtypes.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
- @build 13th October, 2017
+ @build 26th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage fieldtypes.php
diff --git a/admin/models/forms/admin_fields.js b/admin/models/forms/admin_fields.js
index f132f8860..69ee26e4a 100644
--- a/admin/models/forms/admin_fields.js
+++ b/admin/models/forms/admin_fields.js
@@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 23 of this MVC
- @build 16th October, 2017
+ @version @update number 25 of this MVC
+ @build 26th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields.js
diff --git a/admin/models/forms/admin_fields.xml b/admin/models/forms/admin_fields.xml
index c161bc2d3..032492169 100644
--- a/admin/models/forms/admin_fields.xml
+++ b/admin/models/forms/admin_fields.xml
@@ -96,14 +96,14 @@
name="admin_view"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADMIN_VIEW_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_ADMIN_VIEW_DESCRIPTION"
- class="fieldMedium"
+ class="list_class"
multiple="false"
required="true"
readonly="true"
button="false"
/>
-
+
diff --git a/admin/models/forms/admin_fields_conditions.js b/admin/models/forms/admin_fields_conditions.js
index 3d87f7918..3fe30a5f5 100644
--- a/admin/models/forms/admin_fields_conditions.js
+++ b/admin/models/forms/admin_fields_conditions.js
@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 16 of this MVC
- @build 16th October, 2017
+ @build 25th October, 2017
@created 12th October, 2017
@package Component Builder
@subpackage admin_fields_conditions.js
diff --git a/admin/models/forms/admin_fields_conditions.xml b/admin/models/forms/admin_fields_conditions.xml
index be2a9ef8e..fbcb058b1 100644
--- a/admin/models/forms/admin_fields_conditions.xml
+++ b/admin/models/forms/admin_fields_conditions.xml
@@ -96,7 +96,7 @@
name="admin_view"
label="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_LABEL"
description="COM_COMPONENTBUILDER_ADMIN_FIELDS_CONDITIONS_ADMIN_VIEW_DESCRIPTION"
- class="fieldMedium"
+ class="list_class"
multiple="false"
required="true"
readonly="true"
diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js
index 581816193..faa5545ad 100644
--- a/admin/models/forms/admin_view.js
+++ b/admin/models/forms/admin_view.js
@@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 192 of this MVC
- @build 16th October, 2017
+ @version @update number 247 of this MVC
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage admin_view.js
@@ -23,332 +23,332 @@
/-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values
-jform_vvvvvwxvwr_required = false;
-jform_vvvvvwyvws_required = false;
-jform_vvvvvwzvwt_required = false;
-jform_vvvvvxavwu_required = false;
-jform_vvvvvxbvwv_required = false;
-jform_vvvvvxcvww_required = false;
-jform_vvvvvxdvwx_required = false;
-jform_vvvvvxevwy_required = false;
-jform_vvvvvxfvwz_required = false;
-jform_vvvvvxgvxa_required = false;
-jform_vvvvvxhvxb_required = false;
-jform_vvvvvxivxc_required = false;
-jform_vvvvvxjvxd_required = false;
-jform_vvvvvxkvxe_required = false;
-jform_vvvvvxlvxf_required = false;
-jform_vvvvvxmvxg_required = false;
-jform_vvvvvxnvxh_required = false;
-jform_vvvvvxovxi_required = false;
-jform_vvvvvxpvxj_required = false;
-jform_vvvvvxqvxk_required = false;
-jform_vvvvvxrvxl_required = false;
-jform_vvvvvxsvxm_required = false;
-jform_vvvvvxtvxn_required = false;
-jform_vvvvvxuvxo_required = false;
-jform_vvvvvxyvxp_required = false;
-jform_vvvvvxyvxq_required = false;
-jform_vvvvvxyvxr_required = false;
-jform_vvvvvxyvxs_required = false;
-jform_vvvvvxyvxt_required = false;
-jform_vvvvvxyvxu_required = false;
-jform_vvvvvyavxv_required = false;
-jform_vvvvvyavxw_required = false;
-jform_vvvvvyavxx_required = false;
-jform_vvvvvyavxy_required = false;
+jform_vvvvvwwvwn_required = false;
+jform_vvvvvwxvwo_required = false;
+jform_vvvvvwyvwp_required = false;
+jform_vvvvvwzvwq_required = false;
+jform_vvvvvxavwr_required = false;
+jform_vvvvvxbvws_required = false;
+jform_vvvvvxcvwt_required = false;
+jform_vvvvvxdvwu_required = false;
+jform_vvvvvxevwv_required = false;
+jform_vvvvvxfvww_required = false;
+jform_vvvvvxgvwx_required = false;
+jform_vvvvvxhvwy_required = false;
+jform_vvvvvxivwz_required = false;
+jform_vvvvvxjvxa_required = false;
+jform_vvvvvxkvxb_required = false;
+jform_vvvvvxlvxc_required = false;
+jform_vvvvvxmvxd_required = false;
+jform_vvvvvxnvxe_required = false;
+jform_vvvvvxovxf_required = false;
+jform_vvvvvxpvxg_required = false;
+jform_vvvvvxqvxh_required = false;
+jform_vvvvvxrvxi_required = false;
+jform_vvvvvxsvxj_required = false;
+jform_vvvvvxtvxk_required = false;
+jform_vvvvvxxvxl_required = false;
+jform_vvvvvxxvxm_required = false;
+jform_vvvvvxxvxn_required = false;
+jform_vvvvvxxvxo_required = false;
+jform_vvvvvxxvxp_required = false;
+jform_vvvvvxxvxq_required = false;
+jform_vvvvvxzvxr_required = false;
+jform_vvvvvxzvxs_required = false;
+jform_vvvvvxzvxt_required = false;
+jform_vvvvvxzvxu_required = false;
// Initial Script
jQuery(document).ready(function()
{
- var add_css_view_vvvvvwx = jQuery("#jform_add_css_view input[type='radio']:checked").val();
- vvvvvwx(add_css_view_vvvvvwx);
+ var add_css_view_vvvvvww = jQuery("#jform_add_css_view input[type='radio']:checked").val();
+ vvvvvww(add_css_view_vvvvvww);
- var add_css_views_vvvvvwy = jQuery("#jform_add_css_views input[type='radio']:checked").val();
- vvvvvwy(add_css_views_vvvvvwy);
+ var add_css_views_vvvvvwx = jQuery("#jform_add_css_views input[type='radio']:checked").val();
+ vvvvvwx(add_css_views_vvvvvwx);
- var add_javascript_view_file_vvvvvwz = jQuery("#jform_add_javascript_view_file input[type='radio']:checked").val();
- vvvvvwz(add_javascript_view_file_vvvvvwz);
+ var add_javascript_view_file_vvvvvwy = jQuery("#jform_add_javascript_view_file input[type='radio']:checked").val();
+ vvvvvwy(add_javascript_view_file_vvvvvwy);
- var add_javascript_views_file_vvvvvxa = jQuery("#jform_add_javascript_views_file input[type='radio']:checked").val();
- vvvvvxa(add_javascript_views_file_vvvvvxa);
+ var add_javascript_views_file_vvvvvwz = jQuery("#jform_add_javascript_views_file input[type='radio']:checked").val();
+ vvvvvwz(add_javascript_views_file_vvvvvwz);
- var add_javascript_view_footer_vvvvvxb = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
- vvvvvxb(add_javascript_view_footer_vvvvvxb);
+ var add_javascript_view_footer_vvvvvxa = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
+ vvvvvxa(add_javascript_view_footer_vvvvvxa);
- var add_javascript_views_footer_vvvvvxc = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
- vvvvvxc(add_javascript_views_footer_vvvvvxc);
+ var add_javascript_views_footer_vvvvvxb = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
+ vvvvvxb(add_javascript_views_footer_vvvvvxb);
- var add_php_ajax_vvvvvxd = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
- vvvvvxd(add_php_ajax_vvvvvxd);
+ var add_php_ajax_vvvvvxc = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
+ vvvvvxc(add_php_ajax_vvvvvxc);
- var add_php_getitem_vvvvvxe = jQuery("#jform_add_php_getitem input[type='radio']:checked").val();
- vvvvvxe(add_php_getitem_vvvvvxe);
+ var add_php_getitem_vvvvvxd = jQuery("#jform_add_php_getitem input[type='radio']:checked").val();
+ vvvvvxd(add_php_getitem_vvvvvxd);
- var add_php_getitems_vvvvvxf = jQuery("#jform_add_php_getitems input[type='radio']:checked").val();
- vvvvvxf(add_php_getitems_vvvvvxf);
+ var add_php_getitems_vvvvvxe = jQuery("#jform_add_php_getitems input[type='radio']:checked").val();
+ vvvvvxe(add_php_getitems_vvvvvxe);
- var add_php_getitems_after_all_vvvvvxg = jQuery("#jform_add_php_getitems_after_all input[type='radio']:checked").val();
- vvvvvxg(add_php_getitems_after_all_vvvvvxg);
+ var add_php_getitems_after_all_vvvvvxf = jQuery("#jform_add_php_getitems_after_all input[type='radio']:checked").val();
+ vvvvvxf(add_php_getitems_after_all_vvvvvxf);
- var add_php_getlistquery_vvvvvxh = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val();
- vvvvvxh(add_php_getlistquery_vvvvvxh);
+ var add_php_getlistquery_vvvvvxg = jQuery("#jform_add_php_getlistquery input[type='radio']:checked").val();
+ vvvvvxg(add_php_getlistquery_vvvvvxg);
- var add_php_before_save_vvvvvxi = jQuery("#jform_add_php_before_save input[type='radio']:checked").val();
- vvvvvxi(add_php_before_save_vvvvvxi);
+ var add_php_before_save_vvvvvxh = jQuery("#jform_add_php_before_save input[type='radio']:checked").val();
+ vvvvvxh(add_php_before_save_vvvvvxh);
- var add_php_save_vvvvvxj = jQuery("#jform_add_php_save input[type='radio']:checked").val();
- vvvvvxj(add_php_save_vvvvvxj);
+ var add_php_save_vvvvvxi = jQuery("#jform_add_php_save input[type='radio']:checked").val();
+ vvvvvxi(add_php_save_vvvvvxi);
- var add_php_postsavehook_vvvvvxk = jQuery("#jform_add_php_postsavehook input[type='radio']:checked").val();
- vvvvvxk(add_php_postsavehook_vvvvvxk);
+ var add_php_postsavehook_vvvvvxj = jQuery("#jform_add_php_postsavehook input[type='radio']:checked").val();
+ vvvvvxj(add_php_postsavehook_vvvvvxj);
- var add_php_allowedit_vvvvvxl = jQuery("#jform_add_php_allowedit input[type='radio']:checked").val();
- vvvvvxl(add_php_allowedit_vvvvvxl);
+ var add_php_allowedit_vvvvvxk = jQuery("#jform_add_php_allowedit input[type='radio']:checked").val();
+ vvvvvxk(add_php_allowedit_vvvvvxk);
- var add_php_batchcopy_vvvvvxm = jQuery("#jform_add_php_batchcopy input[type='radio']:checked").val();
- vvvvvxm(add_php_batchcopy_vvvvvxm);
+ var add_php_batchcopy_vvvvvxl = jQuery("#jform_add_php_batchcopy input[type='radio']:checked").val();
+ vvvvvxl(add_php_batchcopy_vvvvvxl);
- var add_php_batchmove_vvvvvxn = jQuery("#jform_add_php_batchmove input[type='radio']:checked").val();
- vvvvvxn(add_php_batchmove_vvvvvxn);
+ var add_php_batchmove_vvvvvxm = jQuery("#jform_add_php_batchmove input[type='radio']:checked").val();
+ vvvvvxm(add_php_batchmove_vvvvvxm);
- var add_php_before_publish_vvvvvxo = jQuery("#jform_add_php_before_publish input[type='radio']:checked").val();
- vvvvvxo(add_php_before_publish_vvvvvxo);
+ var add_php_before_publish_vvvvvxn = jQuery("#jform_add_php_before_publish input[type='radio']:checked").val();
+ vvvvvxn(add_php_before_publish_vvvvvxn);
- var add_php_after_publish_vvvvvxp = jQuery("#jform_add_php_after_publish input[type='radio']:checked").val();
- vvvvvxp(add_php_after_publish_vvvvvxp);
+ var add_php_after_publish_vvvvvxo = jQuery("#jform_add_php_after_publish input[type='radio']:checked").val();
+ vvvvvxo(add_php_after_publish_vvvvvxo);
- var add_php_before_delete_vvvvvxq = jQuery("#jform_add_php_before_delete input[type='radio']:checked").val();
- vvvvvxq(add_php_before_delete_vvvvvxq);
+ var add_php_before_delete_vvvvvxp = jQuery("#jform_add_php_before_delete input[type='radio']:checked").val();
+ vvvvvxp(add_php_before_delete_vvvvvxp);
- var add_php_after_delete_vvvvvxr = jQuery("#jform_add_php_after_delete input[type='radio']:checked").val();
- vvvvvxr(add_php_after_delete_vvvvvxr);
+ var add_php_after_delete_vvvvvxq = jQuery("#jform_add_php_after_delete input[type='radio']:checked").val();
+ vvvvvxq(add_php_after_delete_vvvvvxq);
- var add_php_document_vvvvvxs = jQuery("#jform_add_php_document input[type='radio']:checked").val();
- vvvvvxs(add_php_document_vvvvvxs);
+ var add_php_document_vvvvvxr = jQuery("#jform_add_php_document input[type='radio']:checked").val();
+ vvvvvxr(add_php_document_vvvvvxr);
+ var add_sql_vvvvvxs = jQuery("#jform_add_sql input[type='radio']:checked").val();
+ vvvvvxs(add_sql_vvvvvxs);
+
+ var source_vvvvvxt = jQuery("#jform_source input[type='radio']:checked").val();
var add_sql_vvvvvxt = jQuery("#jform_add_sql input[type='radio']:checked").val();
- vvvvvxt(add_sql_vvvvvxt);
+ vvvvvxt(source_vvvvvxt,add_sql_vvvvvxt);
- var source_vvvvvxu = jQuery("#jform_source input[type='radio']:checked").val();
- var add_sql_vvvvvxu = jQuery("#jform_add_sql input[type='radio']:checked").val();
- vvvvvxu(source_vvvvvxu,add_sql_vvvvvxu);
+ var source_vvvvvxv = jQuery("#jform_source input[type='radio']:checked").val();
+ var add_sql_vvvvvxv = jQuery("#jform_add_sql input[type='radio']:checked").val();
+ vvvvvxv(source_vvvvvxv,add_sql_vvvvvxv);
- var source_vvvvvxw = jQuery("#jform_source input[type='radio']:checked").val();
- var add_sql_vvvvvxw = jQuery("#jform_add_sql input[type='radio']:checked").val();
- vvvvvxw(source_vvvvvxw,add_sql_vvvvvxw);
+ var add_custom_import_vvvvvxx = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
+ vvvvvxx(add_custom_import_vvvvvxx);
var add_custom_import_vvvvvxy = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
vvvvvxy(add_custom_import_vvvvvxy);
- var add_custom_import_vvvvvxz = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
- vvvvvxz(add_custom_import_vvvvvxz);
-
- var add_custom_button_vvvvvya = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
- vvvvvya(add_custom_button_vvvvvya);
+ var add_custom_button_vvvvvxz = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
+ vvvvvxz(add_custom_button_vvvvvxz);
});
-// the vvvvvwx function
-function vvvvvwx(add_css_view_vvvvvwx)
+// the vvvvvww function
+function vvvvvww(add_css_view_vvvvvww)
{
// set the function logic
- if (add_css_view_vvvvvwx == 1)
+ if (add_css_view_vvvvvww == 1)
{
jQuery('#jform_css_view').closest('.control-group').show();
- if (jform_vvvvvwxvwr_required)
+ if (jform_vvvvvwwvwn_required)
{
updateFieldRequired('css_view',0);
jQuery('#jform_css_view').prop('required','required');
jQuery('#jform_css_view').attr('aria-required',true);
jQuery('#jform_css_view').addClass('required');
- jform_vvvvvwxvwr_required = false;
+ jform_vvvvvwwvwn_required = false;
}
}
else
{
jQuery('#jform_css_view').closest('.control-group').hide();
- if (!jform_vvvvvwxvwr_required)
+ if (!jform_vvvvvwwvwn_required)
{
updateFieldRequired('css_view',1);
jQuery('#jform_css_view').removeAttr('required');
jQuery('#jform_css_view').removeAttr('aria-required');
jQuery('#jform_css_view').removeClass('required');
- jform_vvvvvwxvwr_required = true;
+ jform_vvvvvwwvwn_required = true;
}
}
}
-// the vvvvvwy function
-function vvvvvwy(add_css_views_vvvvvwy)
+// the vvvvvwx function
+function vvvvvwx(add_css_views_vvvvvwx)
{
// set the function logic
- if (add_css_views_vvvvvwy == 1)
+ if (add_css_views_vvvvvwx == 1)
{
jQuery('#jform_css_views').closest('.control-group').show();
- if (jform_vvvvvwyvws_required)
+ if (jform_vvvvvwxvwo_required)
{
updateFieldRequired('css_views',0);
jQuery('#jform_css_views').prop('required','required');
jQuery('#jform_css_views').attr('aria-required',true);
jQuery('#jform_css_views').addClass('required');
- jform_vvvvvwyvws_required = false;
+ jform_vvvvvwxvwo_required = false;
}
}
else
{
jQuery('#jform_css_views').closest('.control-group').hide();
- if (!jform_vvvvvwyvws_required)
+ if (!jform_vvvvvwxvwo_required)
{
updateFieldRequired('css_views',1);
jQuery('#jform_css_views').removeAttr('required');
jQuery('#jform_css_views').removeAttr('aria-required');
jQuery('#jform_css_views').removeClass('required');
- jform_vvvvvwyvws_required = true;
+ jform_vvvvvwxvwo_required = true;
}
}
}
-// the vvvvvwz function
-function vvvvvwz(add_javascript_view_file_vvvvvwz)
+// the vvvvvwy function
+function vvvvvwy(add_javascript_view_file_vvvvvwy)
{
// set the function logic
- if (add_javascript_view_file_vvvvvwz == 1)
+ if (add_javascript_view_file_vvvvvwy == 1)
{
jQuery('#jform_javascript_view_file').closest('.control-group').show();
- if (jform_vvvvvwzvwt_required)
+ if (jform_vvvvvwyvwp_required)
{
updateFieldRequired('javascript_view_file',0);
jQuery('#jform_javascript_view_file').prop('required','required');
jQuery('#jform_javascript_view_file').attr('aria-required',true);
jQuery('#jform_javascript_view_file').addClass('required');
- jform_vvvvvwzvwt_required = false;
+ jform_vvvvvwyvwp_required = false;
}
}
else
{
jQuery('#jform_javascript_view_file').closest('.control-group').hide();
- if (!jform_vvvvvwzvwt_required)
+ if (!jform_vvvvvwyvwp_required)
{
updateFieldRequired('javascript_view_file',1);
jQuery('#jform_javascript_view_file').removeAttr('required');
jQuery('#jform_javascript_view_file').removeAttr('aria-required');
jQuery('#jform_javascript_view_file').removeClass('required');
- jform_vvvvvwzvwt_required = true;
+ jform_vvvvvwyvwp_required = true;
}
}
}
-// the vvvvvxa function
-function vvvvvxa(add_javascript_views_file_vvvvvxa)
+// the vvvvvwz function
+function vvvvvwz(add_javascript_views_file_vvvvvwz)
{
// set the function logic
- if (add_javascript_views_file_vvvvvxa == 1)
+ if (add_javascript_views_file_vvvvvwz == 1)
{
jQuery('#jform_javascript_views_file').closest('.control-group').show();
- if (jform_vvvvvxavwu_required)
+ if (jform_vvvvvwzvwq_required)
{
updateFieldRequired('javascript_views_file',0);
jQuery('#jform_javascript_views_file').prop('required','required');
jQuery('#jform_javascript_views_file').attr('aria-required',true);
jQuery('#jform_javascript_views_file').addClass('required');
- jform_vvvvvxavwu_required = false;
+ jform_vvvvvwzvwq_required = false;
}
}
else
{
jQuery('#jform_javascript_views_file').closest('.control-group').hide();
- if (!jform_vvvvvxavwu_required)
+ if (!jform_vvvvvwzvwq_required)
{
updateFieldRequired('javascript_views_file',1);
jQuery('#jform_javascript_views_file').removeAttr('required');
jQuery('#jform_javascript_views_file').removeAttr('aria-required');
jQuery('#jform_javascript_views_file').removeClass('required');
- jform_vvvvvxavwu_required = true;
+ jform_vvvvvwzvwq_required = true;
}
}
}
-// the vvvvvxb function
-function vvvvvxb(add_javascript_view_footer_vvvvvxb)
+// the vvvvvxa function
+function vvvvvxa(add_javascript_view_footer_vvvvvxa)
{
// set the function logic
- if (add_javascript_view_footer_vvvvvxb == 1)
+ if (add_javascript_view_footer_vvvvvxa == 1)
{
jQuery('#jform_javascript_view_footer').closest('.control-group').show();
- if (jform_vvvvvxbvwv_required)
+ if (jform_vvvvvxavwr_required)
{
updateFieldRequired('javascript_view_footer',0);
jQuery('#jform_javascript_view_footer').prop('required','required');
jQuery('#jform_javascript_view_footer').attr('aria-required',true);
jQuery('#jform_javascript_view_footer').addClass('required');
- jform_vvvvvxbvwv_required = false;
+ jform_vvvvvxavwr_required = false;
}
}
else
{
jQuery('#jform_javascript_view_footer').closest('.control-group').hide();
- if (!jform_vvvvvxbvwv_required)
+ if (!jform_vvvvvxavwr_required)
{
updateFieldRequired('javascript_view_footer',1);
jQuery('#jform_javascript_view_footer').removeAttr('required');
jQuery('#jform_javascript_view_footer').removeAttr('aria-required');
jQuery('#jform_javascript_view_footer').removeClass('required');
- jform_vvvvvxbvwv_required = true;
+ jform_vvvvvxavwr_required = true;
}
}
}
-// the vvvvvxc function
-function vvvvvxc(add_javascript_views_footer_vvvvvxc)
+// the vvvvvxb function
+function vvvvvxb(add_javascript_views_footer_vvvvvxb)
{
// set the function logic
- if (add_javascript_views_footer_vvvvvxc == 1)
+ if (add_javascript_views_footer_vvvvvxb == 1)
{
jQuery('#jform_javascript_views_footer').closest('.control-group').show();
- if (jform_vvvvvxcvww_required)
+ if (jform_vvvvvxbvws_required)
{
updateFieldRequired('javascript_views_footer',0);
jQuery('#jform_javascript_views_footer').prop('required','required');
jQuery('#jform_javascript_views_footer').attr('aria-required',true);
jQuery('#jform_javascript_views_footer').addClass('required');
- jform_vvvvvxcvww_required = false;
+ jform_vvvvvxbvws_required = false;
}
}
else
{
jQuery('#jform_javascript_views_footer').closest('.control-group').hide();
- if (!jform_vvvvvxcvww_required)
+ if (!jform_vvvvvxbvws_required)
{
updateFieldRequired('javascript_views_footer',1);
jQuery('#jform_javascript_views_footer').removeAttr('required');
jQuery('#jform_javascript_views_footer').removeAttr('aria-required');
jQuery('#jform_javascript_views_footer').removeClass('required');
- jform_vvvvvxcvww_required = true;
+ jform_vvvvvxbvws_required = true;
}
}
}
-// the vvvvvxd function
-function vvvvvxd(add_php_ajax_vvvvvxd)
+// the vvvvvxc function
+function vvvvvxc(add_php_ajax_vvvvvxc)
{
// set the function logic
- if (add_php_ajax_vvvvvxd == 1)
+ if (add_php_ajax_vvvvvxc == 1)
{
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
jQuery('#jform_php_ajaxmethod').closest('.control-group').show();
- if (jform_vvvvvxdvwx_required)
+ if (jform_vvvvvxcvwt_required)
{
updateFieldRequired('php_ajaxmethod',0);
jQuery('#jform_php_ajaxmethod').prop('required','required');
jQuery('#jform_php_ajaxmethod').attr('aria-required',true);
jQuery('#jform_php_ajaxmethod').addClass('required');
- jform_vvvvvxdvwx_required = false;
+ jform_vvvvvxcvwt_required = false;
}
}
@@ -356,549 +356,549 @@ function vvvvvxd(add_php_ajax_vvvvvxd)
{
jQuery('#jform_ajax_input-lbl').closest('.control-group').hide();
jQuery('#jform_php_ajaxmethod').closest('.control-group').hide();
- if (!jform_vvvvvxdvwx_required)
+ if (!jform_vvvvvxcvwt_required)
{
updateFieldRequired('php_ajaxmethod',1);
jQuery('#jform_php_ajaxmethod').removeAttr('required');
jQuery('#jform_php_ajaxmethod').removeAttr('aria-required');
jQuery('#jform_php_ajaxmethod').removeClass('required');
- jform_vvvvvxdvwx_required = true;
+ jform_vvvvvxcvwt_required = true;
}
}
}
-// the vvvvvxe function
-function vvvvvxe(add_php_getitem_vvvvvxe)
+// the vvvvvxd function
+function vvvvvxd(add_php_getitem_vvvvvxd)
{
// set the function logic
- if (add_php_getitem_vvvvvxe == 1)
+ if (add_php_getitem_vvvvvxd == 1)
{
jQuery('#jform_php_getitem').closest('.control-group').show();
- if (jform_vvvvvxevwy_required)
+ if (jform_vvvvvxdvwu_required)
{
updateFieldRequired('php_getitem',0);
jQuery('#jform_php_getitem').prop('required','required');
jQuery('#jform_php_getitem').attr('aria-required',true);
jQuery('#jform_php_getitem').addClass('required');
- jform_vvvvvxevwy_required = false;
+ jform_vvvvvxdvwu_required = false;
}
}
else
{
jQuery('#jform_php_getitem').closest('.control-group').hide();
- if (!jform_vvvvvxevwy_required)
+ if (!jform_vvvvvxdvwu_required)
{
updateFieldRequired('php_getitem',1);
jQuery('#jform_php_getitem').removeAttr('required');
jQuery('#jform_php_getitem').removeAttr('aria-required');
jQuery('#jform_php_getitem').removeClass('required');
- jform_vvvvvxevwy_required = true;
+ jform_vvvvvxdvwu_required = true;
}
}
}
-// the vvvvvxf function
-function vvvvvxf(add_php_getitems_vvvvvxf)
+// the vvvvvxe function
+function vvvvvxe(add_php_getitems_vvvvvxe)
{
// set the function logic
- if (add_php_getitems_vvvvvxf == 1)
+ if (add_php_getitems_vvvvvxe == 1)
{
jQuery('#jform_php_getitems').closest('.control-group').show();
- if (jform_vvvvvxfvwz_required)
+ if (jform_vvvvvxevwv_required)
{
updateFieldRequired('php_getitems',0);
jQuery('#jform_php_getitems').prop('required','required');
jQuery('#jform_php_getitems').attr('aria-required',true);
jQuery('#jform_php_getitems').addClass('required');
- jform_vvvvvxfvwz_required = false;
+ jform_vvvvvxevwv_required = false;
}
}
else
{
jQuery('#jform_php_getitems').closest('.control-group').hide();
- if (!jform_vvvvvxfvwz_required)
+ if (!jform_vvvvvxevwv_required)
{
updateFieldRequired('php_getitems',1);
jQuery('#jform_php_getitems').removeAttr('required');
jQuery('#jform_php_getitems').removeAttr('aria-required');
jQuery('#jform_php_getitems').removeClass('required');
- jform_vvvvvxfvwz_required = true;
+ jform_vvvvvxevwv_required = true;
}
}
}
-// the vvvvvxg function
-function vvvvvxg(add_php_getitems_after_all_vvvvvxg)
+// the vvvvvxf function
+function vvvvvxf(add_php_getitems_after_all_vvvvvxf)
{
// set the function logic
- if (add_php_getitems_after_all_vvvvvxg == 1)
+ if (add_php_getitems_after_all_vvvvvxf == 1)
{
jQuery('#jform_php_getitems_after_all').closest('.control-group').show();
- if (jform_vvvvvxgvxa_required)
+ if (jform_vvvvvxfvww_required)
{
updateFieldRequired('php_getitems_after_all',0);
jQuery('#jform_php_getitems_after_all').prop('required','required');
jQuery('#jform_php_getitems_after_all').attr('aria-required',true);
jQuery('#jform_php_getitems_after_all').addClass('required');
- jform_vvvvvxgvxa_required = false;
+ jform_vvvvvxfvww_required = false;
}
}
else
{
jQuery('#jform_php_getitems_after_all').closest('.control-group').hide();
- if (!jform_vvvvvxgvxa_required)
+ if (!jform_vvvvvxfvww_required)
{
updateFieldRequired('php_getitems_after_all',1);
jQuery('#jform_php_getitems_after_all').removeAttr('required');
jQuery('#jform_php_getitems_after_all').removeAttr('aria-required');
jQuery('#jform_php_getitems_after_all').removeClass('required');
- jform_vvvvvxgvxa_required = true;
+ jform_vvvvvxfvww_required = true;
}
}
}
-// the vvvvvxh function
-function vvvvvxh(add_php_getlistquery_vvvvvxh)
+// the vvvvvxg function
+function vvvvvxg(add_php_getlistquery_vvvvvxg)
{
// set the function logic
- if (add_php_getlistquery_vvvvvxh == 1)
+ if (add_php_getlistquery_vvvvvxg == 1)
{
jQuery('#jform_php_getlistquery').closest('.control-group').show();
- if (jform_vvvvvxhvxb_required)
+ if (jform_vvvvvxgvwx_required)
{
updateFieldRequired('php_getlistquery',0);
jQuery('#jform_php_getlistquery').prop('required','required');
jQuery('#jform_php_getlistquery').attr('aria-required',true);
jQuery('#jform_php_getlistquery').addClass('required');
- jform_vvvvvxhvxb_required = false;
+ jform_vvvvvxgvwx_required = false;
}
}
else
{
jQuery('#jform_php_getlistquery').closest('.control-group').hide();
- if (!jform_vvvvvxhvxb_required)
+ if (!jform_vvvvvxgvwx_required)
{
updateFieldRequired('php_getlistquery',1);
jQuery('#jform_php_getlistquery').removeAttr('required');
jQuery('#jform_php_getlistquery').removeAttr('aria-required');
jQuery('#jform_php_getlistquery').removeClass('required');
- jform_vvvvvxhvxb_required = true;
+ jform_vvvvvxgvwx_required = true;
}
}
}
-// the vvvvvxi function
-function vvvvvxi(add_php_before_save_vvvvvxi)
+// the vvvvvxh function
+function vvvvvxh(add_php_before_save_vvvvvxh)
{
// set the function logic
- if (add_php_before_save_vvvvvxi == 1)
+ if (add_php_before_save_vvvvvxh == 1)
{
jQuery('#jform_php_before_save').closest('.control-group').show();
- if (jform_vvvvvxivxc_required)
+ if (jform_vvvvvxhvwy_required)
{
updateFieldRequired('php_before_save',0);
jQuery('#jform_php_before_save').prop('required','required');
jQuery('#jform_php_before_save').attr('aria-required',true);
jQuery('#jform_php_before_save').addClass('required');
- jform_vvvvvxivxc_required = false;
+ jform_vvvvvxhvwy_required = false;
}
}
else
{
jQuery('#jform_php_before_save').closest('.control-group').hide();
- if (!jform_vvvvvxivxc_required)
+ if (!jform_vvvvvxhvwy_required)
{
updateFieldRequired('php_before_save',1);
jQuery('#jform_php_before_save').removeAttr('required');
jQuery('#jform_php_before_save').removeAttr('aria-required');
jQuery('#jform_php_before_save').removeClass('required');
- jform_vvvvvxivxc_required = true;
+ jform_vvvvvxhvwy_required = true;
}
}
}
-// the vvvvvxj function
-function vvvvvxj(add_php_save_vvvvvxj)
+// the vvvvvxi function
+function vvvvvxi(add_php_save_vvvvvxi)
{
// set the function logic
- if (add_php_save_vvvvvxj == 1)
+ if (add_php_save_vvvvvxi == 1)
{
jQuery('#jform_php_save').closest('.control-group').show();
- if (jform_vvvvvxjvxd_required)
+ if (jform_vvvvvxivwz_required)
{
updateFieldRequired('php_save',0);
jQuery('#jform_php_save').prop('required','required');
jQuery('#jform_php_save').attr('aria-required',true);
jQuery('#jform_php_save').addClass('required');
- jform_vvvvvxjvxd_required = false;
+ jform_vvvvvxivwz_required = false;
}
}
else
{
jQuery('#jform_php_save').closest('.control-group').hide();
- if (!jform_vvvvvxjvxd_required)
+ if (!jform_vvvvvxivwz_required)
{
updateFieldRequired('php_save',1);
jQuery('#jform_php_save').removeAttr('required');
jQuery('#jform_php_save').removeAttr('aria-required');
jQuery('#jform_php_save').removeClass('required');
- jform_vvvvvxjvxd_required = true;
+ jform_vvvvvxivwz_required = true;
}
}
}
-// the vvvvvxk function
-function vvvvvxk(add_php_postsavehook_vvvvvxk)
+// the vvvvvxj function
+function vvvvvxj(add_php_postsavehook_vvvvvxj)
{
// set the function logic
- if (add_php_postsavehook_vvvvvxk == 1)
+ if (add_php_postsavehook_vvvvvxj == 1)
{
jQuery('#jform_php_postsavehook').closest('.control-group').show();
- if (jform_vvvvvxkvxe_required)
+ if (jform_vvvvvxjvxa_required)
{
updateFieldRequired('php_postsavehook',0);
jQuery('#jform_php_postsavehook').prop('required','required');
jQuery('#jform_php_postsavehook').attr('aria-required',true);
jQuery('#jform_php_postsavehook').addClass('required');
- jform_vvvvvxkvxe_required = false;
+ jform_vvvvvxjvxa_required = false;
}
}
else
{
jQuery('#jform_php_postsavehook').closest('.control-group').hide();
- if (!jform_vvvvvxkvxe_required)
+ if (!jform_vvvvvxjvxa_required)
{
updateFieldRequired('php_postsavehook',1);
jQuery('#jform_php_postsavehook').removeAttr('required');
jQuery('#jform_php_postsavehook').removeAttr('aria-required');
jQuery('#jform_php_postsavehook').removeClass('required');
- jform_vvvvvxkvxe_required = true;
+ jform_vvvvvxjvxa_required = true;
}
}
}
-// the vvvvvxl function
-function vvvvvxl(add_php_allowedit_vvvvvxl)
+// the vvvvvxk function
+function vvvvvxk(add_php_allowedit_vvvvvxk)
{
// set the function logic
- if (add_php_allowedit_vvvvvxl == 1)
+ if (add_php_allowedit_vvvvvxk == 1)
{
jQuery('#jform_php_allowedit').closest('.control-group').show();
- if (jform_vvvvvxlvxf_required)
+ if (jform_vvvvvxkvxb_required)
{
updateFieldRequired('php_allowedit',0);
jQuery('#jform_php_allowedit').prop('required','required');
jQuery('#jform_php_allowedit').attr('aria-required',true);
jQuery('#jform_php_allowedit').addClass('required');
- jform_vvvvvxlvxf_required = false;
+ jform_vvvvvxkvxb_required = false;
}
}
else
{
jQuery('#jform_php_allowedit').closest('.control-group').hide();
- if (!jform_vvvvvxlvxf_required)
+ if (!jform_vvvvvxkvxb_required)
{
updateFieldRequired('php_allowedit',1);
jQuery('#jform_php_allowedit').removeAttr('required');
jQuery('#jform_php_allowedit').removeAttr('aria-required');
jQuery('#jform_php_allowedit').removeClass('required');
- jform_vvvvvxlvxf_required = true;
+ jform_vvvvvxkvxb_required = true;
}
}
}
-// the vvvvvxm function
-function vvvvvxm(add_php_batchcopy_vvvvvxm)
+// the vvvvvxl function
+function vvvvvxl(add_php_batchcopy_vvvvvxl)
{
// set the function logic
- if (add_php_batchcopy_vvvvvxm == 1)
+ if (add_php_batchcopy_vvvvvxl == 1)
{
jQuery('#jform_php_batchcopy').closest('.control-group').show();
- if (jform_vvvvvxmvxg_required)
+ if (jform_vvvvvxlvxc_required)
{
updateFieldRequired('php_batchcopy',0);
jQuery('#jform_php_batchcopy').prop('required','required');
jQuery('#jform_php_batchcopy').attr('aria-required',true);
jQuery('#jform_php_batchcopy').addClass('required');
- jform_vvvvvxmvxg_required = false;
+ jform_vvvvvxlvxc_required = false;
}
}
else
{
jQuery('#jform_php_batchcopy').closest('.control-group').hide();
- if (!jform_vvvvvxmvxg_required)
+ if (!jform_vvvvvxlvxc_required)
{
updateFieldRequired('php_batchcopy',1);
jQuery('#jform_php_batchcopy').removeAttr('required');
jQuery('#jform_php_batchcopy').removeAttr('aria-required');
jQuery('#jform_php_batchcopy').removeClass('required');
- jform_vvvvvxmvxg_required = true;
+ jform_vvvvvxlvxc_required = true;
}
}
}
-// the vvvvvxn function
-function vvvvvxn(add_php_batchmove_vvvvvxn)
+// the vvvvvxm function
+function vvvvvxm(add_php_batchmove_vvvvvxm)
{
// set the function logic
- if (add_php_batchmove_vvvvvxn == 1)
+ if (add_php_batchmove_vvvvvxm == 1)
{
jQuery('#jform_php_batchmove').closest('.control-group').show();
- if (jform_vvvvvxnvxh_required)
+ if (jform_vvvvvxmvxd_required)
{
updateFieldRequired('php_batchmove',0);
jQuery('#jform_php_batchmove').prop('required','required');
jQuery('#jform_php_batchmove').attr('aria-required',true);
jQuery('#jform_php_batchmove').addClass('required');
- jform_vvvvvxnvxh_required = false;
+ jform_vvvvvxmvxd_required = false;
}
}
else
{
jQuery('#jform_php_batchmove').closest('.control-group').hide();
- if (!jform_vvvvvxnvxh_required)
+ if (!jform_vvvvvxmvxd_required)
{
updateFieldRequired('php_batchmove',1);
jQuery('#jform_php_batchmove').removeAttr('required');
jQuery('#jform_php_batchmove').removeAttr('aria-required');
jQuery('#jform_php_batchmove').removeClass('required');
- jform_vvvvvxnvxh_required = true;
+ jform_vvvvvxmvxd_required = true;
}
}
}
-// the vvvvvxo function
-function vvvvvxo(add_php_before_publish_vvvvvxo)
+// the vvvvvxn function
+function vvvvvxn(add_php_before_publish_vvvvvxn)
{
// set the function logic
- if (add_php_before_publish_vvvvvxo == 1)
+ if (add_php_before_publish_vvvvvxn == 1)
{
jQuery('#jform_php_before_publish').closest('.control-group').show();
- if (jform_vvvvvxovxi_required)
+ if (jform_vvvvvxnvxe_required)
{
updateFieldRequired('php_before_publish',0);
jQuery('#jform_php_before_publish').prop('required','required');
jQuery('#jform_php_before_publish').attr('aria-required',true);
jQuery('#jform_php_before_publish').addClass('required');
- jform_vvvvvxovxi_required = false;
+ jform_vvvvvxnvxe_required = false;
}
}
else
{
jQuery('#jform_php_before_publish').closest('.control-group').hide();
- if (!jform_vvvvvxovxi_required)
+ if (!jform_vvvvvxnvxe_required)
{
updateFieldRequired('php_before_publish',1);
jQuery('#jform_php_before_publish').removeAttr('required');
jQuery('#jform_php_before_publish').removeAttr('aria-required');
jQuery('#jform_php_before_publish').removeClass('required');
- jform_vvvvvxovxi_required = true;
+ jform_vvvvvxnvxe_required = true;
}
}
}
-// the vvvvvxp function
-function vvvvvxp(add_php_after_publish_vvvvvxp)
+// the vvvvvxo function
+function vvvvvxo(add_php_after_publish_vvvvvxo)
{
// set the function logic
- if (add_php_after_publish_vvvvvxp == 1)
+ if (add_php_after_publish_vvvvvxo == 1)
{
jQuery('#jform_php_after_publish').closest('.control-group').show();
- if (jform_vvvvvxpvxj_required)
+ if (jform_vvvvvxovxf_required)
{
updateFieldRequired('php_after_publish',0);
jQuery('#jform_php_after_publish').prop('required','required');
jQuery('#jform_php_after_publish').attr('aria-required',true);
jQuery('#jform_php_after_publish').addClass('required');
- jform_vvvvvxpvxj_required = false;
+ jform_vvvvvxovxf_required = false;
}
}
else
{
jQuery('#jform_php_after_publish').closest('.control-group').hide();
- if (!jform_vvvvvxpvxj_required)
+ if (!jform_vvvvvxovxf_required)
{
updateFieldRequired('php_after_publish',1);
jQuery('#jform_php_after_publish').removeAttr('required');
jQuery('#jform_php_after_publish').removeAttr('aria-required');
jQuery('#jform_php_after_publish').removeClass('required');
- jform_vvvvvxpvxj_required = true;
+ jform_vvvvvxovxf_required = true;
}
}
}
-// the vvvvvxq function
-function vvvvvxq(add_php_before_delete_vvvvvxq)
+// the vvvvvxp function
+function vvvvvxp(add_php_before_delete_vvvvvxp)
{
// set the function logic
- if (add_php_before_delete_vvvvvxq == 1)
+ if (add_php_before_delete_vvvvvxp == 1)
{
jQuery('#jform_php_before_delete').closest('.control-group').show();
- if (jform_vvvvvxqvxk_required)
+ if (jform_vvvvvxpvxg_required)
{
updateFieldRequired('php_before_delete',0);
jQuery('#jform_php_before_delete').prop('required','required');
jQuery('#jform_php_before_delete').attr('aria-required',true);
jQuery('#jform_php_before_delete').addClass('required');
- jform_vvvvvxqvxk_required = false;
+ jform_vvvvvxpvxg_required = false;
}
}
else
{
jQuery('#jform_php_before_delete').closest('.control-group').hide();
- if (!jform_vvvvvxqvxk_required)
+ if (!jform_vvvvvxpvxg_required)
{
updateFieldRequired('php_before_delete',1);
jQuery('#jform_php_before_delete').removeAttr('required');
jQuery('#jform_php_before_delete').removeAttr('aria-required');
jQuery('#jform_php_before_delete').removeClass('required');
- jform_vvvvvxqvxk_required = true;
+ jform_vvvvvxpvxg_required = true;
}
}
}
-// the vvvvvxr function
-function vvvvvxr(add_php_after_delete_vvvvvxr)
+// the vvvvvxq function
+function vvvvvxq(add_php_after_delete_vvvvvxq)
{
// set the function logic
- if (add_php_after_delete_vvvvvxr == 1)
+ if (add_php_after_delete_vvvvvxq == 1)
{
jQuery('#jform_php_after_delete').closest('.control-group').show();
- if (jform_vvvvvxrvxl_required)
+ if (jform_vvvvvxqvxh_required)
{
updateFieldRequired('php_after_delete',0);
jQuery('#jform_php_after_delete').prop('required','required');
jQuery('#jform_php_after_delete').attr('aria-required',true);
jQuery('#jform_php_after_delete').addClass('required');
- jform_vvvvvxrvxl_required = false;
+ jform_vvvvvxqvxh_required = false;
}
}
else
{
jQuery('#jform_php_after_delete').closest('.control-group').hide();
- if (!jform_vvvvvxrvxl_required)
+ if (!jform_vvvvvxqvxh_required)
{
updateFieldRequired('php_after_delete',1);
jQuery('#jform_php_after_delete').removeAttr('required');
jQuery('#jform_php_after_delete').removeAttr('aria-required');
jQuery('#jform_php_after_delete').removeClass('required');
- jform_vvvvvxrvxl_required = true;
+ jform_vvvvvxqvxh_required = true;
}
}
}
-// the vvvvvxs function
-function vvvvvxs(add_php_document_vvvvvxs)
+// the vvvvvxr function
+function vvvvvxr(add_php_document_vvvvvxr)
{
// set the function logic
- if (add_php_document_vvvvvxs == 1)
+ if (add_php_document_vvvvvxr == 1)
{
jQuery('#jform_php_document').closest('.control-group').show();
- if (jform_vvvvvxsvxm_required)
+ if (jform_vvvvvxrvxi_required)
{
updateFieldRequired('php_document',0);
jQuery('#jform_php_document').prop('required','required');
jQuery('#jform_php_document').attr('aria-required',true);
jQuery('#jform_php_document').addClass('required');
- jform_vvvvvxsvxm_required = false;
+ jform_vvvvvxrvxi_required = false;
}
}
else
{
jQuery('#jform_php_document').closest('.control-group').hide();
- if (!jform_vvvvvxsvxm_required)
+ if (!jform_vvvvvxrvxi_required)
{
updateFieldRequired('php_document',1);
jQuery('#jform_php_document').removeAttr('required');
jQuery('#jform_php_document').removeAttr('aria-required');
jQuery('#jform_php_document').removeClass('required');
- jform_vvvvvxsvxm_required = true;
+ jform_vvvvvxrvxi_required = true;
}
}
}
-// the vvvvvxt function
-function vvvvvxt(add_sql_vvvvvxt)
+// the vvvvvxs function
+function vvvvvxs(add_sql_vvvvvxs)
{
// set the function logic
- if (add_sql_vvvvvxt == 1)
+ if (add_sql_vvvvvxs == 1)
{
jQuery('#jform_source').closest('.control-group').show();
- if (jform_vvvvvxtvxn_required)
+ if (jform_vvvvvxsvxj_required)
{
updateFieldRequired('source',0);
jQuery('#jform_source').prop('required','required');
jQuery('#jform_source').attr('aria-required',true);
jQuery('#jform_source').addClass('required');
- jform_vvvvvxtvxn_required = false;
+ jform_vvvvvxsvxj_required = false;
}
}
else
{
jQuery('#jform_source').closest('.control-group').hide();
- if (!jform_vvvvvxtvxn_required)
+ if (!jform_vvvvvxsvxj_required)
{
updateFieldRequired('source',1);
jQuery('#jform_source').removeAttr('required');
jQuery('#jform_source').removeAttr('aria-required');
jQuery('#jform_source').removeClass('required');
- jform_vvvvvxtvxn_required = true;
+ jform_vvvvvxsvxj_required = true;
}
}
}
-// the vvvvvxu function
-function vvvvvxu(source_vvvvvxu,add_sql_vvvvvxu)
+// the vvvvvxt function
+function vvvvvxt(source_vvvvvxt,add_sql_vvvvvxt)
{
// set the function logic
- if (source_vvvvvxu == 2 && add_sql_vvvvvxu == 1)
+ if (source_vvvvvxt == 2 && add_sql_vvvvvxt == 1)
{
jQuery('#jform_sql').closest('.control-group').show();
- if (jform_vvvvvxuvxo_required)
+ if (jform_vvvvvxtvxk_required)
{
updateFieldRequired('sql',0);
jQuery('#jform_sql').prop('required','required');
jQuery('#jform_sql').attr('aria-required',true);
jQuery('#jform_sql').addClass('required');
- jform_vvvvvxuvxo_required = false;
+ jform_vvvvvxtvxk_required = false;
}
}
else
{
jQuery('#jform_sql').closest('.control-group').hide();
- if (!jform_vvvvvxuvxo_required)
+ if (!jform_vvvvvxtvxk_required)
{
updateFieldRequired('sql',1);
jQuery('#jform_sql').removeAttr('required');
jQuery('#jform_sql').removeAttr('aria-required');
jQuery('#jform_sql').removeClass('required');
- jform_vvvvvxuvxo_required = true;
+ jform_vvvvvxtvxk_required = true;
}
}
}
-// the vvvvvxw function
-function vvvvvxw(source_vvvvvxw,add_sql_vvvvvxw)
+// the vvvvvxv function
+function vvvvvxv(source_vvvvvxv,add_sql_vvvvvxv)
{
// set the function logic
- if (source_vvvvvxw == 1 && add_sql_vvvvvxw == 1)
+ if (source_vvvvvxv == 1 && add_sql_vvvvvxv == 1)
{
jQuery('#jform_addtables-lbl').closest('.control-group').show();
}
@@ -908,139 +908,139 @@ function vvvvvxw(source_vvvvvxw,add_sql_vvvvvxw)
}
}
-// the vvvvvxy function
-function vvvvvxy(add_custom_import_vvvvvxy)
+// the vvvvvxx function
+function vvvvvxx(add_custom_import_vvvvvxx)
{
// set the function logic
- if (add_custom_import_vvvvvxy == 1)
+ if (add_custom_import_vvvvvxx == 1)
{
jQuery('#jform_html_import_view').closest('.control-group').show();
- if (jform_vvvvvxyvxp_required)
+ if (jform_vvvvvxxvxl_required)
{
updateFieldRequired('html_import_view',0);
jQuery('#jform_html_import_view').prop('required','required');
jQuery('#jform_html_import_view').attr('aria-required',true);
jQuery('#jform_html_import_view').addClass('required');
- jform_vvvvvxyvxp_required = false;
+ jform_vvvvvxxvxl_required = false;
}
jQuery('.note_advanced_import').closest('.control-group').show();
jQuery('#jform_php_import_display').closest('.control-group').show();
- if (jform_vvvvvxyvxq_required)
+ if (jform_vvvvvxxvxm_required)
{
updateFieldRequired('php_import_display',0);
jQuery('#jform_php_import_display').prop('required','required');
jQuery('#jform_php_import_display').attr('aria-required',true);
jQuery('#jform_php_import_display').addClass('required');
- jform_vvvvvxyvxq_required = false;
+ jform_vvvvvxxvxm_required = false;
}
jQuery('#jform_php_import_ext').closest('.control-group').show();
- if (jform_vvvvvxyvxr_required)
+ if (jform_vvvvvxxvxn_required)
{
updateFieldRequired('php_import_ext',0);
jQuery('#jform_php_import_ext').prop('required','required');
jQuery('#jform_php_import_ext').attr('aria-required',true);
jQuery('#jform_php_import_ext').addClass('required');
- jform_vvvvvxyvxr_required = false;
+ jform_vvvvvxxvxn_required = false;
}
jQuery('#jform_php_import').closest('.control-group').show();
- if (jform_vvvvvxyvxs_required)
+ if (jform_vvvvvxxvxo_required)
{
updateFieldRequired('php_import',0);
jQuery('#jform_php_import').prop('required','required');
jQuery('#jform_php_import').attr('aria-required',true);
jQuery('#jform_php_import').addClass('required');
- jform_vvvvvxyvxs_required = false;
+ jform_vvvvvxxvxo_required = false;
}
jQuery('#jform_php_import_save').closest('.control-group').show();
- if (jform_vvvvvxyvxt_required)
+ if (jform_vvvvvxxvxp_required)
{
updateFieldRequired('php_import_save',0);
jQuery('#jform_php_import_save').prop('required','required');
jQuery('#jform_php_import_save').attr('aria-required',true);
jQuery('#jform_php_import_save').addClass('required');
- jform_vvvvvxyvxt_required = false;
+ jform_vvvvvxxvxp_required = false;
}
jQuery('#jform_php_import_setdata').closest('.control-group').show();
- if (jform_vvvvvxyvxu_required)
+ if (jform_vvvvvxxvxq_required)
{
updateFieldRequired('php_import_setdata',0);
jQuery('#jform_php_import_setdata').prop('required','required');
jQuery('#jform_php_import_setdata').attr('aria-required',true);
jQuery('#jform_php_import_setdata').addClass('required');
- jform_vvvvvxyvxu_required = false;
+ jform_vvvvvxxvxq_required = false;
}
}
else
{
jQuery('#jform_html_import_view').closest('.control-group').hide();
- if (!jform_vvvvvxyvxp_required)
+ if (!jform_vvvvvxxvxl_required)
{
updateFieldRequired('html_import_view',1);
jQuery('#jform_html_import_view').removeAttr('required');
jQuery('#jform_html_import_view').removeAttr('aria-required');
jQuery('#jform_html_import_view').removeClass('required');
- jform_vvvvvxyvxp_required = true;
+ jform_vvvvvxxvxl_required = true;
}
jQuery('.note_advanced_import').closest('.control-group').hide();
jQuery('#jform_php_import_display').closest('.control-group').hide();
- if (!jform_vvvvvxyvxq_required)
+ if (!jform_vvvvvxxvxm_required)
{
updateFieldRequired('php_import_display',1);
jQuery('#jform_php_import_display').removeAttr('required');
jQuery('#jform_php_import_display').removeAttr('aria-required');
jQuery('#jform_php_import_display').removeClass('required');
- jform_vvvvvxyvxq_required = true;
+ jform_vvvvvxxvxm_required = true;
}
jQuery('#jform_php_import_ext').closest('.control-group').hide();
- if (!jform_vvvvvxyvxr_required)
+ if (!jform_vvvvvxxvxn_required)
{
updateFieldRequired('php_import_ext',1);
jQuery('#jform_php_import_ext').removeAttr('required');
jQuery('#jform_php_import_ext').removeAttr('aria-required');
jQuery('#jform_php_import_ext').removeClass('required');
- jform_vvvvvxyvxr_required = true;
+ jform_vvvvvxxvxn_required = true;
}
jQuery('#jform_php_import').closest('.control-group').hide();
- if (!jform_vvvvvxyvxs_required)
+ if (!jform_vvvvvxxvxo_required)
{
updateFieldRequired('php_import',1);
jQuery('#jform_php_import').removeAttr('required');
jQuery('#jform_php_import').removeAttr('aria-required');
jQuery('#jform_php_import').removeClass('required');
- jform_vvvvvxyvxs_required = true;
+ jform_vvvvvxxvxo_required = true;
}
jQuery('#jform_php_import_save').closest('.control-group').hide();
- if (!jform_vvvvvxyvxt_required)
+ if (!jform_vvvvvxxvxp_required)
{
updateFieldRequired('php_import_save',1);
jQuery('#jform_php_import_save').removeAttr('required');
jQuery('#jform_php_import_save').removeAttr('aria-required');
jQuery('#jform_php_import_save').removeClass('required');
- jform_vvvvvxyvxt_required = true;
+ jform_vvvvvxxvxp_required = true;
}
jQuery('#jform_php_import_setdata').closest('.control-group').hide();
- if (!jform_vvvvvxyvxu_required)
+ if (!jform_vvvvvxxvxq_required)
{
updateFieldRequired('php_import_setdata',1);
jQuery('#jform_php_import_setdata').removeAttr('required');
jQuery('#jform_php_import_setdata').removeAttr('aria-required');
jQuery('#jform_php_import_setdata').removeClass('required');
- jform_vvvvvxyvxu_required = true;
+ jform_vvvvvxxvxq_required = true;
}
}
}
-// the vvvvvxz function
-function vvvvvxz(add_custom_import_vvvvvxz)
+// the vvvvvxy function
+function vvvvvxy(add_custom_import_vvvvvxy)
{
// set the function logic
- if (add_custom_import_vvvvvxz == 0)
+ if (add_custom_import_vvvvvxy == 0)
{
jQuery('.note_beginner_import').closest('.control-group').show();
}
@@ -1050,51 +1050,51 @@ function vvvvvxz(add_custom_import_vvvvvxz)
}
}
-// the vvvvvya function
-function vvvvvya(add_custom_button_vvvvvya)
+// the vvvvvxz function
+function vvvvvxz(add_custom_button_vvvvvxz)
{
// set the function logic
- if (add_custom_button_vvvvvya == 1)
+ if (add_custom_button_vvvvvxz == 1)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
jQuery('#jform_php_controller').closest('.control-group').show();
- if (jform_vvvvvyavxv_required)
+ if (jform_vvvvvxzvxr_required)
{
updateFieldRequired('php_controller',0);
jQuery('#jform_php_controller').prop('required','required');
jQuery('#jform_php_controller').attr('aria-required',true);
jQuery('#jform_php_controller').addClass('required');
- jform_vvvvvyavxv_required = false;
+ jform_vvvvvxzvxr_required = false;
}
jQuery('#jform_php_controller_list').closest('.control-group').show();
- if (jform_vvvvvyavxw_required)
+ if (jform_vvvvvxzvxs_required)
{
updateFieldRequired('php_controller_list',0);
jQuery('#jform_php_controller_list').prop('required','required');
jQuery('#jform_php_controller_list').attr('aria-required',true);
jQuery('#jform_php_controller_list').addClass('required');
- jform_vvvvvyavxw_required = false;
+ jform_vvvvvxzvxs_required = false;
}
jQuery('#jform_php_model').closest('.control-group').show();
- if (jform_vvvvvyavxx_required)
+ if (jform_vvvvvxzvxt_required)
{
updateFieldRequired('php_model',0);
jQuery('#jform_php_model').prop('required','required');
jQuery('#jform_php_model').attr('aria-required',true);
jQuery('#jform_php_model').addClass('required');
- jform_vvvvvyavxx_required = false;
+ jform_vvvvvxzvxt_required = false;
}
jQuery('#jform_php_model_list').closest('.control-group').show();
- if (jform_vvvvvyavxy_required)
+ if (jform_vvvvvxzvxu_required)
{
updateFieldRequired('php_model_list',0);
jQuery('#jform_php_model_list').prop('required','required');
jQuery('#jform_php_model_list').attr('aria-required',true);
jQuery('#jform_php_model_list').addClass('required');
- jform_vvvvvyavxy_required = false;
+ jform_vvvvvxzvxu_required = false;
}
}
@@ -1102,40 +1102,40 @@ function vvvvvya(add_custom_button_vvvvvya)
{
jQuery('#jform_custom_button-lbl').closest('.control-group').hide();
jQuery('#jform_php_controller').closest('.control-group').hide();
- if (!jform_vvvvvyavxv_required)
+ if (!jform_vvvvvxzvxr_required)
{
updateFieldRequired('php_controller',1);
jQuery('#jform_php_controller').removeAttr('required');
jQuery('#jform_php_controller').removeAttr('aria-required');
jQuery('#jform_php_controller').removeClass('required');
- jform_vvvvvyavxv_required = true;
+ jform_vvvvvxzvxr_required = true;
}
jQuery('#jform_php_controller_list').closest('.control-group').hide();
- if (!jform_vvvvvyavxw_required)
+ if (!jform_vvvvvxzvxs_required)
{
updateFieldRequired('php_controller_list',1);
jQuery('#jform_php_controller_list').removeAttr('required');
jQuery('#jform_php_controller_list').removeAttr('aria-required');
jQuery('#jform_php_controller_list').removeClass('required');
- jform_vvvvvyavxw_required = true;
+ jform_vvvvvxzvxs_required = true;
}
jQuery('#jform_php_model').closest('.control-group').hide();
- if (!jform_vvvvvyavxx_required)
+ if (!jform_vvvvvxzvxt_required)
{
updateFieldRequired('php_model',1);
jQuery('#jform_php_model').removeAttr('required');
jQuery('#jform_php_model').removeAttr('aria-required');
jQuery('#jform_php_model').removeClass('required');
- jform_vvvvvyavxx_required = true;
+ jform_vvvvvxzvxt_required = true;
}
jQuery('#jform_php_model_list').closest('.control-group').hide();
- if (!jform_vvvvvyavxy_required)
+ if (!jform_vvvvvxzvxu_required)
{
updateFieldRequired('php_model_list',1);
jQuery('#jform_php_model_list').removeAttr('required');
jQuery('#jform_php_model_list').removeAttr('aria-required');
jQuery('#jform_php_model_list').removeClass('required');
- jform_vvvvvyavxy_required = true;
+ jform_vvvvvxzvxu_required = true;
}
}
}
@@ -1183,16 +1183,16 @@ jQuery(document).ready(function()
var valueSwitch = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
getImportScripts(valueSwitch);
// now load the fields
- getFieldsDisplay('admin_fields');
- getFieldsDisplay('admin_fields_conditions');
+ getAjaxDisplay('admin_fields');
+ getAjaxDisplay('admin_fields_conditions');
// set button
addButtonID('admin_fields_conditions','create_edit_buttons', 1); // <-- second
- // set button to add more languages
+ // set button to create more fields
addButton('field','create_edit_buttons'); // <-- third
});
-function getFieldsDisplay(type){
- getFieldsDisplay_server(type).done(function(result) {
+function getAjaxDisplay(type){
+ getAjaxDisplay_server(type).done(function(result) {
if(result){
jQuery('#display_'+type).html(result);
}
@@ -1201,8 +1201,8 @@ function getFieldsDisplay(type){
});
}
-function getFieldsDisplay_server(type){
- var getUrl = "index.php?option=com_componentbuilder&task=ajax.getFieldsDisplay&format=json&vdm="+vastDevMod;
+function getAjaxDisplay_server(type){
+ var getUrl = "index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&vdm="+vastDevMod;
if(token.length > 0 && type.length > 0){
var request = 'token='+token+'&type=' + type;
}
@@ -1216,7 +1216,7 @@ function getFieldsDisplay_server(type){
}
function addData(result,where){
- jQuery(where).closest('.control-group').parent().append(result);
+ jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
}
function addButtonID_server(type, size){
@@ -1235,10 +1235,10 @@ function addButtonID_server(type, size){
function addButtonID(type, where, size){
addButtonID_server(type, size).done(function(result) {
if(result){
- if (1 == size) {
- addData(result, '#jform_'+where);
- } else if (2 == size) {
+ if (2 == size) {
jQuery('#'+where).html(result);
+ } else {
+ addData(result, '#jform_'+where);
}
}
});
diff --git a/admin/models/forms/admin_view.xml b/admin/models/forms/admin_view.xml
index 833893642..4fc0fa872 100644
--- a/admin/models/forms/admin_view.xml
+++ b/admin/models/forms/admin_view.xml
@@ -149,31 +149,34 @@
message="Error! Please add some short description here."
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_SHORT_DESCRIPTION_HINT"
/>
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
COM_COMPONENTBUILDER_ADMIN_VIEW_READONLY
-
+
+
+
@@ -293,19 +252,19 @@
filter="HTML"
hint="COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION_HINT"
/>
-
+
-
-
-
-
+ type="textarea"
+ name="php_allowedit"
+ label="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_LABEL"
+ rows="30"
+ cols="15"
+ description="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_DESCRIPTION"
+ class="text_area span12"
+ filter="raw"
+ hint="COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_ALLOWEDIT_HINT"
+ required="true"
+ />
COM_COMPONENTBUILDER_ADMIN_VIEW_REMOVE
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
+ maximum="14">
+
+
+
diff --git a/admin/views/component_admin_views/tmpl/index.html b/admin/views/component_admin_views/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_admin_views/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_admin_views/view.html.php b/admin/views/component_admin_views/view.html.php
new file mode 100644
index 000000000..35b3ed4ec
--- /dev/null
+++ b/admin/views/component_admin_views/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_admin_views View class
+ */
+class ComponentbuilderViewComponent_admin_views extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_admin_views',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_admin_views.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_admin_views.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_admin_views.create'))
+ {
+ JToolBarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_admin_views.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_admin_views.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_admin_views.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_admin_views.create'))
+ {
+ JToolBarHelper::custom('component_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_admin_views.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_admin_views.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_admin_views', $this->item->id);
+ }
+ if ($this->canDo->get('component_admin_views.create'))
+ {
+ JToolBarHelper::custom('component_admin_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_admin_views');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_ADMIN_VIEWS_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_admin_views.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_admin_views/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_config/submitbutton.js b/admin/views/component_config/submitbutton.js
new file mode 100644
index 000000000..faaeb3263
--- /dev/null
+++ b/admin/views/component_config/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 5 of this MVC
+ @build 29th October, 2017
+ @created 23rd October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+Joomla.submitbutton = function(task)
+{
+ if (task == ''){
+ return false;
+ } else {
+ var isValid=true;
+ var action = task.split('.');
+ if (action[1] != 'cancel' && action[1] != 'close'){
+ var forms = $$('form.form-validate');
+ for (var i=0;i
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.formvalidation');
+JHtml::_('formbehavior.chosen', 'select');
+JHtml::_('behavior.keepalive');
+$componentParams = JComponentHelper::getParams('com_componentbuilder');
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default_batch_body.php b/admin/views/components_admin_views/tmpl/default_batch_body.php
new file mode 100644
index 000000000..66a3e1dce
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default_batch_footer.php b/admin/views/components_admin_views/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..1d83be2a6
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default_body.php b/admin/views/components_admin_views/tmpl/default_body.php
new file mode 100644
index 000000000..bd5dc415c
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_admin_views&task=component_admin_views.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_admin_views',$item,'components_admin_views');
+ ?>
+
+
+ get('component_admin_views.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_admin_views.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_admin_views.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_admin_views.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_admin_views.', true, 'cb'); ?>
+
+ published, $i, 'components_admin_views.', false, 'cb'); ?>
+
+
+ published, $i, 'components_admin_views.', true, 'cb'); ?>
+
+
+ published, $i, 'components_admin_views.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default_foot.php b/admin/views/components_admin_views/tmpl/default_foot.php
new file mode 100644
index 000000000..7a0471733
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default_head.php b/admin/views/components_admin_views/tmpl/default_head.php
new file mode 100644
index 000000000..a2c845854
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default_toolbar.php b/admin/views/components_admin_views/tmpl/default_toolbar.php
new file mode 100644
index 000000000..313292d44
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/index.html b/admin/views/components_admin_views/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/view.html.php b/admin/views/components_admin_views/view.html.php
new file mode 100644
index 000000000..739a3b39c
--- /dev/null
+++ b/admin/views/components_admin_views/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_admin_views
+ */
+class ComponentbuilderViewComponents_admin_views extends JViewLegacy
+{
+ /**
+ * Components_admin_views view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_admin_views');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_admin_views');
+ $this->canEdit = $this->canDo->get('component_admin_views.edit');
+ $this->canState = $this->canDo->get('component_admin_views.edit.state');
+ $this->canCreate = $this->canDo->get('component_admin_views.create');
+ $this->canDelete = $this->canDo->get('component_admin_views.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_admin_views');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_admin_views.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_admin_views.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_admin_views.publish');
+ JToolBarHelper::unpublishList('components_admin_views.unpublish');
+ JToolBarHelper::archiveList('components_admin_views.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_admin_views.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_admin_views.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_admin_views');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_admin_views.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_config/index.html b/admin/views/components_config/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_config/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default.php b/admin/views/components_config/tmpl/default.php
new file mode 100644
index 000000000..46c44e834
--- /dev/null
+++ b/admin/views/components_config/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_config.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_configList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_CONFIG_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default_batch_body.php b/admin/views/components_config/tmpl/default_batch_body.php
new file mode 100644
index 000000000..30033337a
--- /dev/null
+++ b/admin/views/components_config/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default_batch_footer.php b/admin/views/components_config/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..3092aa6b2
--- /dev/null
+++ b/admin/views/components_config/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default_body.php b/admin/views/components_config/tmpl/default_body.php
new file mode 100644
index 000000000..9597628e5
--- /dev/null
+++ b/admin/views/components_config/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_config&task=component_config.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_config',$item,'components_config');
+ ?>
+
+
+ get('component_config.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_config.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_config.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_config.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_config.', true, 'cb'); ?>
+
+ published, $i, 'components_config.', false, 'cb'); ?>
+
+
+ published, $i, 'components_config.', true, 'cb'); ?>
+
+
+ published, $i, 'components_config.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default_foot.php b/admin/views/components_config/tmpl/default_foot.php
new file mode 100644
index 000000000..5753bbe9a
--- /dev/null
+++ b/admin/views/components_config/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default_head.php b/admin/views/components_config/tmpl/default_head.php
new file mode 100644
index 000000000..14a052a89
--- /dev/null
+++ b/admin/views/components_config/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/default_toolbar.php b/admin/views/components_config/tmpl/default_toolbar.php
new file mode 100644
index 000000000..9b42fa887
--- /dev/null
+++ b/admin/views/components_config/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_config/tmpl/index.html b/admin/views/components_config/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_config/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_config/view.html.php b/admin/views/components_config/view.html.php
new file mode 100644
index 000000000..e62d38897
--- /dev/null
+++ b/admin/views/components_config/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_config
+ */
+class ComponentbuilderViewComponents_config extends JViewLegacy
+{
+ /**
+ * Components_config view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_config');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_config');
+ $this->canEdit = $this->canDo->get('component_config.edit');
+ $this->canState = $this->canDo->get('component_config.edit.state');
+ $this->canCreate = $this->canDo->get('component_config.create');
+ $this->canDelete = $this->canDo->get('component_config.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CONFIG'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_config');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_config.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_config.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_config.publish');
+ JToolBarHelper::unpublishList('components_config.unpublish');
+ JToolBarHelper::archiveList('components_config.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_config.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_config.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_config.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_config');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CONFIG'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_config.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_custom_admin_menus/index.html b/admin/views/components_custom_admin_menus/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default.php b/admin/views/components_custom_admin_menus/tmpl/default.php
new file mode 100644
index 000000000..470dc0484
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_custom_admin_menus.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_custom_admin_menusList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default_batch_body.php b/admin/views/components_custom_admin_menus/tmpl/default_batch_body.php
new file mode 100644
index 000000000..3a13bc31a
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default_batch_footer.php b/admin/views/components_custom_admin_menus/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..94306074e
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default_body.php b/admin/views/components_custom_admin_menus/tmpl/default_body.php
new file mode 100644
index 000000000..3be6db8d0
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_custom_admin_menus&task=component_custom_admin_menus.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus',$item,'components_custom_admin_menus');
+ ?>
+
+
+ get('component_custom_admin_menus.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_custom_admin_menus.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_custom_admin_menus.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_custom_admin_menus.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_custom_admin_menus.', true, 'cb'); ?>
+
+ published, $i, 'components_custom_admin_menus.', false, 'cb'); ?>
+
+
+ published, $i, 'components_custom_admin_menus.', true, 'cb'); ?>
+
+
+ published, $i, 'components_custom_admin_menus.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default_foot.php b/admin/views/components_custom_admin_menus/tmpl/default_foot.php
new file mode 100644
index 000000000..5753bbe9a
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default_head.php b/admin/views/components_custom_admin_menus/tmpl/default_head.php
new file mode 100644
index 000000000..1072f571a
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/default_toolbar.php b/admin/views/components_custom_admin_menus/tmpl/default_toolbar.php
new file mode 100644
index 000000000..ebe4a119e
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/tmpl/index.html b/admin/views/components_custom_admin_menus/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_menus/view.html.php b/admin/views/components_custom_admin_menus/view.html.php
new file mode 100644
index 000000000..c3e41bb09
--- /dev/null
+++ b/admin/views/components_custom_admin_menus/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_custom_admin_menus
+ */
+class ComponentbuilderViewComponents_custom_admin_menus extends JViewLegacy
+{
+ /**
+ * Components_custom_admin_menus view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_custom_admin_menus');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus');
+ $this->canEdit = $this->canDo->get('component_custom_admin_menus.edit');
+ $this->canState = $this->canDo->get('component_custom_admin_menus.edit.state');
+ $this->canCreate = $this->canDo->get('component_custom_admin_menus.create');
+ $this->canDelete = $this->canDo->get('component_custom_admin_menus.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_custom_admin_menus');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_custom_admin_menus.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_custom_admin_menus.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_custom_admin_menus.publish');
+ JToolBarHelper::unpublishList('components_custom_admin_menus.unpublish');
+ JToolBarHelper::archiveList('components_custom_admin_menus.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_custom_admin_menus.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_custom_admin_menus.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_custom_admin_menus.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_menus');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_MENUS'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_custom_admin_menus.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_custom_admin_views/index.html b/admin/views/components_custom_admin_views/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_custom_admin_views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default.php b/admin/views/components_custom_admin_views/tmpl/default.php
new file mode 100644
index 000000000..2facc1e6e
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_custom_admin_views.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_custom_admin_viewsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default_batch_body.php b/admin/views/components_custom_admin_views/tmpl/default_batch_body.php
new file mode 100644
index 000000000..420ec4735
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default_batch_footer.php b/admin/views/components_custom_admin_views/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..4e80e522d
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default_body.php b/admin/views/components_custom_admin_views/tmpl/default_body.php
new file mode 100644
index 000000000..7f40ccd76
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_custom_admin_views&task=component_custom_admin_views.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_custom_admin_views',$item,'components_custom_admin_views');
+ ?>
+
+
+ get('component_custom_admin_views.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_custom_admin_views.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_custom_admin_views.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_custom_admin_views.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_custom_admin_views.', true, 'cb'); ?>
+
+ published, $i, 'components_custom_admin_views.', false, 'cb'); ?>
+
+
+ published, $i, 'components_custom_admin_views.', true, 'cb'); ?>
+
+
+ published, $i, 'components_custom_admin_views.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default_foot.php b/admin/views/components_custom_admin_views/tmpl/default_foot.php
new file mode 100644
index 000000000..0388ee72b
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default_head.php b/admin/views/components_custom_admin_views/tmpl/default_head.php
new file mode 100644
index 000000000..fdfa74f65
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/default_toolbar.php b/admin/views/components_custom_admin_views/tmpl/default_toolbar.php
new file mode 100644
index 000000000..11bb15b8a
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/tmpl/index.html b/admin/views/components_custom_admin_views/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_custom_admin_views/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_custom_admin_views/view.html.php b/admin/views/components_custom_admin_views/view.html.php
new file mode 100644
index 000000000..162c74a7a
--- /dev/null
+++ b/admin/views/components_custom_admin_views/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_custom_admin_views
+ */
+class ComponentbuilderViewComponents_custom_admin_views extends JViewLegacy
+{
+ /**
+ * Components_custom_admin_views view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_custom_admin_views');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views');
+ $this->canEdit = $this->canDo->get('component_custom_admin_views.edit');
+ $this->canState = $this->canDo->get('component_custom_admin_views.edit.state');
+ $this->canCreate = $this->canDo->get('component_custom_admin_views.create');
+ $this->canDelete = $this->canDo->get('component_custom_admin_views.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_custom_admin_views');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_custom_admin_views.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_custom_admin_views.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_custom_admin_views.publish');
+ JToolBarHelper::unpublishList('components_custom_admin_views.unpublish');
+ JToolBarHelper::archiveList('components_custom_admin_views.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_custom_admin_views.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_custom_admin_views.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_custom_admin_views.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_custom_admin_views');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_CUSTOM_ADMIN_VIEWS'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_custom_admin_views.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_dashboard/index.html b/admin/views/components_dashboard/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_dashboard/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default.php b/admin/views/components_dashboard/tmpl/default.php
new file mode 100644
index 000000000..4c0504031
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_dashboard.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_dashboardList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default_batch_body.php b/admin/views/components_dashboard/tmpl/default_batch_body.php
new file mode 100644
index 000000000..6642995b6
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default_batch_footer.php b/admin/views/components_dashboard/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..c8789201d
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default_body.php b/admin/views/components_dashboard/tmpl/default_body.php
new file mode 100644
index 000000000..984eda721
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_dashboard&task=component_dashboard.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_dashboard',$item,'components_dashboard');
+ ?>
+
+
+ get('component_dashboard.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_dashboard.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_dashboard.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_dashboard.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_dashboard.', true, 'cb'); ?>
+
+ published, $i, 'components_dashboard.', false, 'cb'); ?>
+
+
+ published, $i, 'components_dashboard.', true, 'cb'); ?>
+
+
+ published, $i, 'components_dashboard.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default_foot.php b/admin/views/components_dashboard/tmpl/default_foot.php
new file mode 100644
index 000000000..374fa0ae5
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default_head.php b/admin/views/components_dashboard/tmpl/default_head.php
new file mode 100644
index 000000000..96c3015ec
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/default_toolbar.php b/admin/views/components_dashboard/tmpl/default_toolbar.php
new file mode 100644
index 000000000..8745a8e6d
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/tmpl/index.html b/admin/views/components_dashboard/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_dashboard/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_dashboard/view.html.php b/admin/views/components_dashboard/view.html.php
new file mode 100644
index 000000000..ab19e20ce
--- /dev/null
+++ b/admin/views/components_dashboard/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_dashboard
+ */
+class ComponentbuilderViewComponents_dashboard extends JViewLegacy
+{
+ /**
+ * Components_dashboard view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_dashboard');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_dashboard');
+ $this->canEdit = $this->canDo->get('component_dashboard.edit');
+ $this->canState = $this->canDo->get('component_dashboard.edit.state');
+ $this->canCreate = $this->canDo->get('component_dashboard.create');
+ $this->canDelete = $this->canDo->get('component_dashboard.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_dashboard');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_dashboard.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_dashboard.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_dashboard.publish');
+ JToolBarHelper::unpublishList('components_dashboard.unpublish');
+ JToolBarHelper::archiveList('components_dashboard.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_dashboard.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_dashboard.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_dashboard.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_dashboard');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_DASHBOARD'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_dashboard.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_files_folders/index.html b/admin/views/components_files_folders/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_files_folders/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default.php b/admin/views/components_files_folders/tmpl/default.php
new file mode 100644
index 000000000..396a80bfe
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_files_folders.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_files_foldersList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default_batch_body.php b/admin/views/components_files_folders/tmpl/default_batch_body.php
new file mode 100644
index 000000000..251e7b33e
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default_batch_footer.php b/admin/views/components_files_folders/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..f80d5c49f
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default_body.php b/admin/views/components_files_folders/tmpl/default_body.php
new file mode 100644
index 000000000..d237aea9d
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_files_folders&task=component_files_folders.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_files_folders',$item,'components_files_folders');
+ ?>
+
+
+ get('component_files_folders.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_files_folders.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_files_folders.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_files_folders.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_files_folders.', true, 'cb'); ?>
+
+ published, $i, 'components_files_folders.', false, 'cb'); ?>
+
+
+ published, $i, 'components_files_folders.', true, 'cb'); ?>
+
+
+ published, $i, 'components_files_folders.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default_foot.php b/admin/views/components_files_folders/tmpl/default_foot.php
new file mode 100644
index 000000000..11a51abec
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default_head.php b/admin/views/components_files_folders/tmpl/default_head.php
new file mode 100644
index 000000000..68ab1e1bd
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/default_toolbar.php b/admin/views/components_files_folders/tmpl/default_toolbar.php
new file mode 100644
index 000000000..ac951edfa
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/tmpl/index.html b/admin/views/components_files_folders/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_files_folders/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_files_folders/view.html.php b/admin/views/components_files_folders/view.html.php
new file mode 100644
index 000000000..5e7837608
--- /dev/null
+++ b/admin/views/components_files_folders/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_files_folders
+ */
+class ComponentbuilderViewComponents_files_folders extends JViewLegacy
+{
+ /**
+ * Components_files_folders view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_files_folders');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_files_folders');
+ $this->canEdit = $this->canDo->get('component_files_folders.edit');
+ $this->canState = $this->canDo->get('component_files_folders.edit.state');
+ $this->canCreate = $this->canDo->get('component_files_folders.create');
+ $this->canDelete = $this->canDo->get('component_files_folders.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_files_folders');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_files_folders.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_files_folders.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_files_folders.publish');
+ JToolBarHelper::unpublishList('components_files_folders.unpublish');
+ JToolBarHelper::archiveList('components_files_folders.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_files_folders.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_files_folders.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_files_folders.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_files_folders');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_FILES_FOLDERS'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_files_folders.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_mysql_tweaks/index.html b/admin/views/components_mysql_tweaks/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default.php b/admin/views/components_mysql_tweaks/tmpl/default.php
new file mode 100644
index 000000000..45e3b9093
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_mysql_tweaks.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_mysql_tweaksList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default_batch_body.php b/admin/views/components_mysql_tweaks/tmpl/default_batch_body.php
new file mode 100644
index 000000000..3487b4c05
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default_batch_footer.php b/admin/views/components_mysql_tweaks/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..ea27a4642
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default_body.php b/admin/views/components_mysql_tweaks/tmpl/default_body.php
new file mode 100644
index 000000000..e85d52590
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_mysql_tweaks&task=component_mysql_tweaks.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks',$item,'components_mysql_tweaks');
+ ?>
+
+
+ get('component_mysql_tweaks.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_mysql_tweaks.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_mysql_tweaks.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_mysql_tweaks.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_mysql_tweaks.', true, 'cb'); ?>
+
+ published, $i, 'components_mysql_tweaks.', false, 'cb'); ?>
+
+
+ published, $i, 'components_mysql_tweaks.', true, 'cb'); ?>
+
+
+ published, $i, 'components_mysql_tweaks.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default_foot.php b/admin/views/components_mysql_tweaks/tmpl/default_foot.php
new file mode 100644
index 000000000..7a0471733
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default_head.php b/admin/views/components_mysql_tweaks/tmpl/default_head.php
new file mode 100644
index 000000000..4ed6b9116
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/default_toolbar.php b/admin/views/components_mysql_tweaks/tmpl/default_toolbar.php
new file mode 100644
index 000000000..970534526
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/tmpl/index.html b/admin/views/components_mysql_tweaks/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_mysql_tweaks/view.html.php b/admin/views/components_mysql_tweaks/view.html.php
new file mode 100644
index 000000000..42cbe6b90
--- /dev/null
+++ b/admin/views/components_mysql_tweaks/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_mysql_tweaks
+ */
+class ComponentbuilderViewComponents_mysql_tweaks extends JViewLegacy
+{
+ /**
+ * Components_mysql_tweaks view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_mysql_tweaks');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks');
+ $this->canEdit = $this->canDo->get('component_mysql_tweaks.edit');
+ $this->canState = $this->canDo->get('component_mysql_tweaks.edit.state');
+ $this->canCreate = $this->canDo->get('component_mysql_tweaks.create');
+ $this->canDelete = $this->canDo->get('component_mysql_tweaks.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_mysql_tweaks');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_mysql_tweaks.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_mysql_tweaks.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_mysql_tweaks.publish');
+ JToolBarHelper::unpublishList('components_mysql_tweaks.unpublish');
+ JToolBarHelper::archiveList('components_mysql_tweaks.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_mysql_tweaks.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_mysql_tweaks.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_mysql_tweaks.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_mysql_tweaks');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_MYSQL_TWEAKS'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_mysql_tweaks.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_site_views/index.html b/admin/views/components_site_views/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_site_views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default.php b/admin/views/components_site_views/tmpl/default.php
new file mode 100644
index 000000000..74fb7d8e9
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_site_views.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_site_viewsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default_batch_body.php b/admin/views/components_site_views/tmpl/default_batch_body.php
new file mode 100644
index 000000000..ae9717cdd
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default_batch_footer.php b/admin/views/components_site_views/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..6c90d58b3
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default_body.php b/admin/views/components_site_views/tmpl/default_body.php
new file mode 100644
index 000000000..1e0738b9d
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_site_views&task=component_site_views.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_site_views',$item,'components_site_views');
+ ?>
+
+
+ get('component_site_views.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_site_views.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_site_views.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_site_views.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_site_views.', true, 'cb'); ?>
+
+ published, $i, 'components_site_views.', false, 'cb'); ?>
+
+
+ published, $i, 'components_site_views.', true, 'cb'); ?>
+
+
+ published, $i, 'components_site_views.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default_foot.php b/admin/views/components_site_views/tmpl/default_foot.php
new file mode 100644
index 000000000..3566334a9
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default_head.php b/admin/views/components_site_views/tmpl/default_head.php
new file mode 100644
index 000000000..8119fca20
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/default_toolbar.php b/admin/views/components_site_views/tmpl/default_toolbar.php
new file mode 100644
index 000000000..ab0892231
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/tmpl/index.html b/admin/views/components_site_views/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_site_views/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_site_views/view.html.php b/admin/views/components_site_views/view.html.php
new file mode 100644
index 000000000..93d3f82eb
--- /dev/null
+++ b/admin/views/components_site_views/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_site_views
+ */
+class ComponentbuilderViewComponents_site_views extends JViewLegacy
+{
+ /**
+ * Components_site_views view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_site_views');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_site_views');
+ $this->canEdit = $this->canDo->get('component_site_views.edit');
+ $this->canState = $this->canDo->get('component_site_views.edit.state');
+ $this->canCreate = $this->canDo->get('component_site_views.create');
+ $this->canDelete = $this->canDo->get('component_site_views.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_site_views');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_site_views.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_site_views.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_site_views.publish');
+ JToolBarHelper::unpublishList('components_site_views.unpublish');
+ JToolBarHelper::archiveList('components_site_views.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_site_views.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_site_views.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_site_views.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_site_views');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_SITE_VIEWS'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_site_views.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/components_updates/index.html b/admin/views/components_updates/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_updates/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default.php b/admin/views/components_updates/tmpl/default.php
new file mode 100644
index 000000000..657b87d28
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_updates.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_updatesList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+sidebar)): ?>
+
+
+
+
+items)): ?>
+ loadTemplate('toolbar');?>
+
+
+
+
+ loadTemplate('toolbar');?>
+
+ loadTemplate('head');?>
+ loadTemplate('foot');?>
+ loadTemplate('body');?>
+
+
+ canCreate && $this->canEdit) : ?>
+ JText::_('COM_COMPONENTBUILDER_COMPONENTS_UPDATES_BATCH_OPTIONS'),
+ 'footer' => $this->loadTemplate('batch_footer')
+ ),
+ $this->loadTemplate('batch_body')
+ ); ?>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default_batch_body.php b/admin/views/components_updates/tmpl/default_batch_body.php
new file mode 100644
index 000000000..91a3acdbe
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default_batch_body.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+batchDisplay; ?>
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default_batch_footer.php b/admin/views/components_updates/tmpl/default_batch_footer.php
new file mode 100644
index 000000000..29029222b
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default_batch_footer.php
@@ -0,0 +1,37 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default_body.php b/admin/views/components_updates/tmpl/default_body.php
new file mode 100644
index 000000000..acf6c9230
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default_body.php
@@ -0,0 +1,108 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+$edit = "index.php?option=com_componentbuilder&view=components_updates&task=component_updates.edit";
+
+?>
+items as $i => $item): ?>
+ user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0;
+ $userChkOut = JFactory::getUser($item->checked_out);
+ $canDo = ComponentbuilderHelper::getActions('component_updates',$item,'components_updates');
+ ?>
+
+
+ get('component_updates.edit')): ?>
+ checked_out) : ?>
+
+ id); ?>
+
+ □
+
+
+ id); ?>
+
+
+ □
+
+
+
+ get('component_updates.edit')): ?>
+
+ escape($item->joomla_component_system_name); ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'components_updates.', $canCheckin); ?>
+
+
+
+ escape($item->joomla_component_system_name); ?>
+
+
+
+ get('component_updates.edit.state')) : ?>
+ checked_out) : ?>
+
+ published, $i, 'components_updates.', true, 'cb'); ?>
+
+ published, $i, 'components_updates.', false, 'cb'); ?>
+
+
+ published, $i, 'components_updates.', true, 'cb'); ?>
+
+
+ published, $i, 'components_updates.', false, 'cb'); ?>
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default_foot.php b/admin/views/components_updates/tmpl/default_foot.php
new file mode 100644
index 000000000..57a6b2ddd
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default_foot.php
@@ -0,0 +1,32 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+ pagination->getListFooter(); ?>
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default_head.php b/admin/views/components_updates/tmpl/default_head.php
new file mode 100644
index 000000000..7b6ef1c62
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default_head.php
@@ -0,0 +1,61 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+ canEdit&& $this->canState): ?>
+
+
+
+
+
+
+ ■
+
+
+
+
+
+ canState): ?>
+
+ listDirn, $this->listOrder); ?>
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/default_toolbar.php b/admin/views/components_updates/tmpl/default_toolbar.php
new file mode 100644
index 000000000..034558c7c
--- /dev/null
+++ b/admin/views/components_updates/tmpl/default_toolbar.php
@@ -0,0 +1,59 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+?>
+
+
+
\ No newline at end of file
diff --git a/admin/views/components_updates/tmpl/index.html b/admin/views/components_updates/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_updates/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_updates/view.html.php b/admin/views/components_updates/view.html.php
new file mode 100644
index 000000000..ba0b58328
--- /dev/null
+++ b/admin/views/components_updates/view.html.php
@@ -0,0 +1,238 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Componentbuilder View class for the Components_updates
+ */
+class ComponentbuilderViewComponents_updates extends JViewLegacy
+{
+ /**
+ * Components_updates view display method
+ * @return void
+ */
+ function display($tpl = null)
+ {
+ if ($this->getLayout() !== 'modal')
+ {
+ // Include helper submenu
+ ComponentbuilderHelper::addSubmenu('components_updates');
+ }
+
+ // Assign data to the view
+ $this->items = $this->get('Items');
+ $this->pagination = $this->get('Pagination');
+ $this->state = $this->get('State');
+ $this->user = JFactory::getUser();
+ $this->listOrder = $this->escape($this->state->get('list.ordering'));
+ $this->listDirn = $this->escape($this->state->get('list.direction'));
+ $this->saveOrder = $this->listOrder == 'ordering';
+ // get global action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_updates');
+ $this->canEdit = $this->canDo->get('component_updates.edit');
+ $this->canState = $this->canDo->get('component_updates.edit.state');
+ $this->canCreate = $this->canDo->get('component_updates.create');
+ $this->canDelete = $this->canDo->get('component_updates.delete');
+ $this->canBatch = $this->canDo->get('core.batch');
+
+ // We don't need toolbar in the modal window.
+ if ($this->getLayout() !== 'modal')
+ {
+ $this->addToolbar();
+ $this->sidebar = JHtmlSidebar::render();
+ // load the batch html
+ if ($this->canCreate && $this->canEdit && $this->canState)
+ {
+ $this->batchDisplay = JHtmlBatch_::render();
+ }
+ }
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_COMPONENTS_UPDATES'), 'joomla');
+ JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=components_updates');
+ JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+
+ if ($this->canCreate)
+ {
+ JToolBarHelper::addNew('component_updates.add');
+ }
+
+ // Only load if there are items
+ if (ComponentbuilderHelper::checkArray($this->items))
+ {
+ if ($this->canEdit)
+ {
+ JToolBarHelper::editList('component_updates.edit');
+ }
+
+ if ($this->canState)
+ {
+ JToolBarHelper::publishList('components_updates.publish');
+ JToolBarHelper::unpublishList('components_updates.unpublish');
+ JToolBarHelper::archiveList('components_updates.archive');
+
+ if ($this->canDo->get('core.admin'))
+ {
+ JToolBarHelper::checkin('components_updates.checkin');
+ }
+ }
+
+ // Add a batch button
+ if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
+ {
+ // Get the toolbar object instance
+ $bar = JToolBar::getInstance('toolbar');
+ // set the batch button name
+ $title = JText::_('JTOOLBAR_BATCH');
+ // Instantiate a new JLayoutFile instance and render the batch button
+ $layout = new JLayoutFile('joomla.toolbar.batch');
+ // add the button to the page
+ $dhtml = $layout->render(array('title' => $title));
+ $bar->appendButton('Custom', $dhtml, 'batch');
+ }
+
+ if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
+ {
+ JToolbarHelper::deleteList('', 'components_updates.delete', 'JTOOLBAR_EMPTY_TRASH');
+ }
+ elseif ($this->canState && $this->canDelete)
+ {
+ JToolbarHelper::trash('components_updates.trash');
+ }
+ }
+
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('components_updates');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+
+ // add the options comp button
+ if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
+ {
+ JToolBarHelper::preferences('com_componentbuilder');
+ }
+
+ if ($this->canState)
+ {
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_PUBLISHED'),
+ 'filter_published',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
+ );
+ // only load if batch allowed
+ if ($this->canBatch)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'),
+ 'batch[published]',
+ JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
+ );
+ }
+ }
+
+ JHtmlSidebar::addFilter(
+ JText::_('JOPTION_SELECT_ACCESS'),
+ 'filter_access',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
+ );
+
+ if ($this->canBatch && $this->canCreate && $this->canEdit)
+ {
+ JHtmlBatch_::addListSelection(
+ JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'),
+ 'batch[access]',
+ JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
+ );
+ }
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_('COM_COMPONENTBUILDER_COMPONENTS_UPDATES'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/components_updates.css");
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 50)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Returns an array of fields the table can be sorted by
+ *
+ * @return array Array containing the field name to sort by as the key and display text as value
+ */
+ protected function getSortFields()
+ {
+ return array(
+ 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'),
+ 'a.published' => JText::_('JSTATUS'),
+ 'a.id' => JText::_('JGRID_HEADING_ID')
+ );
+ }
+}
diff --git a/admin/views/custom_admin_view/submitbutton.js b/admin/views/custom_admin_view/submitbutton.js
index 999c0d15c..90600acaa 100644
--- a/admin/views/custom_admin_view/submitbutton.js
+++ b/admin/views/custom_admin_view/submitbutton.js
@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 32 of this MVC
- @build 20th October, 2017
+ @build 25th October, 2017
@created 13th August, 2015
@package Component Builder
@subpackage submitbutton.js
diff --git a/admin/views/custom_admin_view/tmpl/edit.php b/admin/views/custom_admin_view/tmpl/edit.php
index 487d58c35..4ccd91e49 100644
--- a/admin/views/custom_admin_view/tmpl/edit.php
+++ b/admin/views/custom_admin_view/tmpl/edit.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 32 of this MVC
- @build 20th October, 2017
+ @build 25th October, 2017
@created 13th August, 2015
@package Component Builder
@subpackage edit.php
@@ -165,123 +165,123 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
diff --git a/admin/views/joomla_component/view.html.php b/admin/views/joomla_component/view.html.php
index 23fec6c0e..3ef581991 100644
--- a/admin/views/joomla_component/view.html.php
+++ b/admin/views/joomla_component/view.html.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage view.html.php
@@ -64,16 +64,7 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy
}
// Get Linked view data
- $this->vwnadmin_views = $this->get('Vwnadmin_views');
-
- // Get Linked view data
- $this->vwocustom_admin_views = $this->get('Vwocustom_admin_views');
-
- // Get Linked view data
- $this->vwpsite_views = $this->get('Vwpsite_views');
-
- // Get Linked view data
- $this->vwqtranslation = $this->get('Vwqtranslation');
+ $this->vwmtranslation = $this->get('Vwmtranslation');
// Set the toolbar
$this->addToolBar();
@@ -217,7 +208,16 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy
$document->addScriptDeclaration($footable);
$document->addScript(JURI::root() . $this->script);
- $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js");
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/joomla_component/submitbutton.js");
+ // add JavaScripts
+ $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/uikit.min.js' );
+ $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/components/lightbox.min.js', 'text/javascript', true);
+ $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/components/notify.min.js', 'text/javascript', true);
+ // add the style sheets
+ $document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit/css/uikit.gradient.min.css' );
+ $document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit/css/components/notify.gradient.min.css' );
+ // add var key
+ $document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';");
JText::script('view not acceptable. Error');
}
}
diff --git a/admin/views/joomla_components/tmpl/default.php b/admin/views/joomla_components/tmpl/default.php
index 060cd0bac..c16c7e183 100644
--- a/admin/views/joomla_components/tmpl/default.php
+++ b/admin/views/joomla_components/tmpl/default.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default.php
diff --git a/admin/views/joomla_components/tmpl/default_batch_body.php b/admin/views/joomla_components/tmpl/default_batch_body.php
index e216ec82c..2efb95a35 100644
--- a/admin/views/joomla_components/tmpl/default_batch_body.php
+++ b/admin/views/joomla_components/tmpl/default_batch_body.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default_batch_body.php
diff --git a/admin/views/joomla_components/tmpl/default_batch_footer.php b/admin/views/joomla_components/tmpl/default_batch_footer.php
index 6c3189335..046d9a2f1 100644
--- a/admin/views/joomla_components/tmpl/default_batch_footer.php
+++ b/admin/views/joomla_components/tmpl/default_batch_footer.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default_batch_footer.php
diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php
index d7bcd56a0..b8eba31d6 100644
--- a/admin/views/joomla_components/tmpl/default_body.php
+++ b/admin/views/joomla_components/tmpl/default_body.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default_body.php
@@ -85,16 +85,51 @@ $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=jooml
escape($item->system_name); ?>
+
+
+ get('component_admin_views.edit') && $component_admin_views_id = ComponentbuilderHelper::getVar('component_admin_views', $item->id, 'joomla_component', 'id')): ?>
+
+
+ get('component_custom_admin_views.edit') && $component_custom_admin_views_id = ComponentbuilderHelper::getVar('component_custom_admin_views', $item->id, 'joomla_component', 'id')): ?>
+
+
+ get('component_site_views.edit') && $component_site_views_id = ComponentbuilderHelper::getVar('component_site_views', $item->id, 'joomla_component', 'id')): ?>
+
+
+ get('component_config.edit') && $component_config_id = ComponentbuilderHelper::getVar('component_config', $item->id, 'joomla_component', 'id')): ?>
+
+
+
- escape($item->name_code); ?>
+ escape($item->name_code); ?>
+
+ get('component_updates.edit') && $component_updates_id = ComponentbuilderHelper::getVar('component_updates', $item->id, 'joomla_component', 'id')): ?>
+
+
+ get('component_mysql_tweaks.edit') && $component_mysql_tweaks_id = ComponentbuilderHelper::getVar('component_mysql_tweaks', $item->id, 'joomla_component', 'id')): ?>
+
+
+ get('component_files_folders.edit') && $component_files_folders_id = ComponentbuilderHelper::getVar('component_files_folders', $item->id, 'joomla_component', 'id')): ?>
+
+
+
escape($item->component_version); ?>
- escape($item->short_description); ?>
+ escape($item->short_description); ?>
+
+ get('component_custom_admin_menus.edit') && $component_custom_admin_menus_id = ComponentbuilderHelper::getVar('component_custom_admin_menus', $item->id, 'joomla_component', 'id')): ?>
+
+
+ get('component_dashboard.edit') && $component_dashboard_id = ComponentbuilderHelper::getVar('component_dashboard', $item->id, 'joomla_component', 'id')): ?>
+
+
+
+
escape($item->companyname); ?>
diff --git a/admin/views/joomla_components/tmpl/default_foot.php b/admin/views/joomla_components/tmpl/default_foot.php
index 42c5cac83..4d13012e1 100644
--- a/admin/views/joomla_components/tmpl/default_foot.php
+++ b/admin/views/joomla_components/tmpl/default_foot.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default_foot.php
diff --git a/admin/views/joomla_components/tmpl/default_head.php b/admin/views/joomla_components/tmpl/default_head.php
index cdde05eba..1babdf006 100644
--- a/admin/views/joomla_components/tmpl/default_head.php
+++ b/admin/views/joomla_components/tmpl/default_head.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default_head.php
diff --git a/admin/views/joomla_components/tmpl/default_toolbar.php b/admin/views/joomla_components/tmpl/default_toolbar.php
index 68c44225e..73f715e39 100644
--- a/admin/views/joomla_components/tmpl/default_toolbar.php
+++ b/admin/views/joomla_components/tmpl/default_toolbar.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage default_toolbar.php
diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php
index a81803343..9387fa3fc 100644
--- a/admin/views/joomla_components/view.html.php
+++ b/admin/views/joomla_components/view.html.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 473 of this MVC
- @build 20th October, 2017
+ @version @update number 517 of this MVC
+ @build 30th October, 2017
@created 6th May, 2015
@package Component Builder
@subpackage view.html.php
diff --git a/admin/views/language/submitbutton.js b/admin/views/language/submitbutton.js
index 55d835eb0..e6ee30d31 100644
--- a/admin/views/language/submitbutton.js
+++ b/admin/views/language/submitbutton.js
@@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
- @build 3rd April, 2017
+ @build 25th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage submitbutton.js
diff --git a/admin/views/language/tmpl/edit.php b/admin/views/language/tmpl/edit.php
index 2ec129591..daa445733 100644
--- a/admin/views/language/tmpl/edit.php
+++ b/admin/views/language/tmpl/edit.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
- @build 3rd April, 2017
+ @build 25th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage edit.php
diff --git a/admin/views/language/view.html.php b/admin/views/language/view.html.php
index 0729bd219..4f4c5803c 100644
--- a/admin/views/language/view.html.php
+++ b/admin/views/language/view.html.php
@@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 3 of this MVC
- @build 3rd April, 2017
+ @build 25th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage view.html.php
diff --git a/admin/views/language_translation/submitbutton.js b/admin/views/language_translation/submitbutton.js
index bada3b3a4..4ebfd88be 100644
--- a/admin/views/language_translation/submitbutton.js
+++ b/admin/views/language_translation/submitbutton.js
@@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 45 of this MVC
- @build 14th October, 2017
+ @version @update number 46 of this MVC
+ @build 26th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage submitbutton.js
diff --git a/admin/views/language_translation/tmpl/edit.php b/admin/views/language_translation/tmpl/edit.php
index 78bb256b5..d51b06262 100644
--- a/admin/views/language_translation/tmpl/edit.php
+++ b/admin/views/language_translation/tmpl/edit.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version @update number 45 of this MVC
- @build 14th October, 2017
+ @version @update number 46 of this MVC
+ @build 26th October, 2017
@created 3rd April, 2017
@package Component Builder
@subpackage edit.php
@@ -58,7 +58,6 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder');
+
+
+
+
+
+
+
+
+
+
+
diff --git a/admin/views/component_updates/tmpl/index.html b/admin/views/component_updates/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_updates/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_updates/view.html.php b/admin/views/component_updates/view.html.php
new file mode 100644
index 000000000..346135db3
--- /dev/null
+++ b/admin/views/component_updates/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_updates View class
+ */
+class ComponentbuilderViewComponent_updates extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_updates',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_updates.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_updates.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_updates.create'))
+ {
+ JToolBarHelper::apply('component_updates.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_updates.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_updates.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_updates.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_updates.create'))
+ {
+ JToolBarHelper::custom('component_updates.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_updates.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_updates.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_updates', $this->item->id);
+ }
+ if ($this->canDo->get('component_updates.create'))
+ {
+ JToolBarHelper::custom('component_updates.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_updates.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_updates');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_UPDATES_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_updates.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_updates/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/componentbuilder/tmpl/default.php b/admin/views/componentbuilder/tmpl/default.php
index d070d81d3..c72e6a2e6 100644
--- a/admin/views/componentbuilder/tmpl/default.php
+++ b/admin/views/componentbuilder/tmpl/default.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default.php
diff --git a/admin/views/componentbuilder/tmpl/default_issues_the_closed_issues_on_github.php b/admin/views/componentbuilder/tmpl/default_issues_the_closed_issues_on_github.php
index d4c143a11..19de6c744 100644
--- a/admin/views/componentbuilder/tmpl/default_issues_the_closed_issues_on_github.php
+++ b/admin/views/componentbuilder/tmpl/default_issues_the_closed_issues_on_github.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_issues_the_closed_issues_on_github.php
diff --git a/admin/views/componentbuilder/tmpl/default_issues_the_open_issues_on_github.php b/admin/views/componentbuilder/tmpl/default_issues_the_open_issues_on_github.php
index 09fd300f2..179e7f4d9 100644
--- a/admin/views/componentbuilder/tmpl/default_issues_the_open_issues_on_github.php
+++ b/admin/views/componentbuilder/tmpl/default_issues_the_open_issues_on_github.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_issues_the_open_issues_on_github.php
diff --git a/admin/views/componentbuilder/tmpl/default_main.php b/admin/views/componentbuilder/tmpl/default_main.php
index 188a3c016..5f81223eb 100644
--- a/admin/views/componentbuilder/tmpl/default_main.php
+++ b/admin/views/componentbuilder/tmpl/default_main.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_main.php
diff --git a/admin/views/componentbuilder/tmpl/default_readme_information.php b/admin/views/componentbuilder/tmpl/default_readme_information.php
index 97984f9c7..c74236797 100644
--- a/admin/views/componentbuilder/tmpl/default_readme_information.php
+++ b/admin/views/componentbuilder/tmpl/default_readme_information.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_readme_information.php
diff --git a/admin/views/componentbuilder/tmpl/default_releases_information.php b/admin/views/componentbuilder/tmpl/default_releases_information.php
index 00dcad660..e5d448dc3 100644
--- a/admin/views/componentbuilder/tmpl/default_releases_information.php
+++ b/admin/views/componentbuilder/tmpl/default_releases_information.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_releases_information.php
diff --git a/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php b/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php
index 09ec04782..bea8083d8 100644
--- a/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php
+++ b/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_vast_development_method_notice_board.php
diff --git a/admin/views/componentbuilder/tmpl/default_vdm.php b/admin/views/componentbuilder/tmpl/default_vdm.php
index 0e3ccfe49..fd547e642 100644
--- a/admin/views/componentbuilder/tmpl/default_vdm.php
+++ b/admin/views/componentbuilder/tmpl/default_vdm.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_vdm.php
diff --git a/admin/views/componentbuilder/tmpl/default_wiki_tutorials.php b/admin/views/componentbuilder/tmpl/default_wiki_tutorials.php
index ade771655..8846e8a7a 100644
--- a/admin/views/componentbuilder/tmpl/default_wiki_tutorials.php
+++ b/admin/views/componentbuilder/tmpl/default_wiki_tutorials.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage default_wiki_tutorials.php
diff --git a/admin/views/componentbuilder/view.html.php b/admin/views/componentbuilder/view.html.php
index 6d3128558..9f3834367 100644
--- a/admin/views/componentbuilder/view.html.php
+++ b/admin/views/componentbuilder/view.html.php
@@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
- @version 2.5.8
- @build 20th October, 2017
+ @version 2.6.0
+ @build 30th October, 2017
@created 30th April, 2015
@package Component Builder
@subpackage view.html.php
diff --git a/admin/views/components_admin_views/index.html b/admin/views/components_admin_views/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/components_admin_views/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/components_admin_views/tmpl/default.php b/admin/views/components_admin_views/tmpl/default.php
new file mode 100644
index 000000000..0400688d3
--- /dev/null
+++ b/admin/views/components_admin_views/tmpl/default.php
@@ -0,0 +1,99 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// load tooltip behavior
+JHtml::_('behavior.tooltip');
+JHtml::_('behavior.multiselect');
+JHtml::_('dropdown.init');
+JHtml::_('formbehavior.chosen', 'select');
+
+if ($this->saveOrder)
+{
+ $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=components_admin_views.saveOrderAjax&tmpl=component';
+ JHtml::_('sortablelist.sortable', 'component_admin_viewsList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
+}
+
+?>
+
+
+
+
diff --git a/admin/views/component_site_views/tmpl/index.html b/admin/views/component_site_views/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_site_views/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_site_views/view.html.php b/admin/views/component_site_views/view.html.php
new file mode 100644
index 000000000..efeb13604
--- /dev/null
+++ b/admin/views/component_site_views/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_site_views View class
+ */
+class ComponentbuilderViewComponent_site_views extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_site_views',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_site_views.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_site_views.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_site_views.create'))
+ {
+ JToolBarHelper::apply('component_site_views.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_site_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_site_views.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_site_views.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_site_views.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_site_views.create'))
+ {
+ JToolBarHelper::custom('component_site_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_site_views.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_site_views.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_site_views', $this->item->id);
+ }
+ if ($this->canDo->get('component_site_views.create'))
+ {
+ JToolBarHelper::custom('component_site_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_site_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_site_views');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_SITE_VIEWS_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_site_views.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_site_views/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_updates/submitbutton.js b/admin/views/component_updates/submitbutton.js
new file mode 100644
index 000000000..3b413257e
--- /dev/null
+++ b/admin/views/component_updates/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 8 of this MVC
+ @build 29th October, 2017
+ @created 22nd October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+
+
diff --git a/admin/views/component_mysql_tweaks/tmpl/index.html b/admin/views/component_mysql_tweaks/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_mysql_tweaks/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_mysql_tweaks/view.html.php b/admin/views/component_mysql_tweaks/view.html.php
new file mode 100644
index 000000000..a773e3a29
--- /dev/null
+++ b/admin/views/component_mysql_tweaks/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_mysql_tweaks View class
+ */
+class ComponentbuilderViewComponent_mysql_tweaks extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_mysql_tweaks',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_mysql_tweaks.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_mysql_tweaks.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_mysql_tweaks.create'))
+ {
+ JToolBarHelper::apply('component_mysql_tweaks.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_mysql_tweaks.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_mysql_tweaks.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_mysql_tweaks.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_mysql_tweaks.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_mysql_tweaks.create'))
+ {
+ JToolBarHelper::custom('component_mysql_tweaks.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_mysql_tweaks.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_mysql_tweaks.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_mysql_tweaks', $this->item->id);
+ }
+ if ($this->canDo->get('component_mysql_tweaks.create'))
+ {
+ JToolBarHelper::custom('component_mysql_tweaks.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_mysql_tweaks.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_mysql_tweaks');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_MYSQL_TWEAKS_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_mysql_tweaks.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_mysql_tweaks/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_site_views/submitbutton.js b/admin/views/component_site_views/submitbutton.js
new file mode 100644
index 000000000..7b61a9f96
--- /dev/null
+++ b/admin/views/component_site_views/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 4 of this MVC
+ @build 29th October, 2017
+ @created 22nd October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+
+
diff --git a/admin/views/component_files_folders/tmpl/index.html b/admin/views/component_files_folders/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_files_folders/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_files_folders/view.html.php b/admin/views/component_files_folders/view.html.php
new file mode 100644
index 000000000..bea8de576
--- /dev/null
+++ b/admin/views/component_files_folders/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_files_folders View class
+ */
+class ComponentbuilderViewComponent_files_folders extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_files_folders',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_files_folders.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_files_folders.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_files_folders.create'))
+ {
+ JToolBarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_files_folders.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_files_folders.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_files_folders.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_files_folders.create'))
+ {
+ JToolBarHelper::custom('component_files_folders.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_files_folders.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_files_folders.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_files_folders', $this->item->id);
+ }
+ if ($this->canDo->get('component_files_folders.create'))
+ {
+ JToolBarHelper::custom('component_files_folders.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_files_folders.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_files_folders');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_FILES_FOLDERS_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_files_folders.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_files_folders/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_mysql_tweaks/submitbutton.js b/admin/views/component_mysql_tweaks/submitbutton.js
new file mode 100644
index 000000000..339c72f87
--- /dev/null
+++ b/admin/views/component_mysql_tweaks/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 6 of this MVC
+ @build 29th October, 2017
+ @created 22nd October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+
+
diff --git a/admin/views/component_dashboard/tmpl/index.html b/admin/views/component_dashboard/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_dashboard/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_dashboard/view.html.php b/admin/views/component_dashboard/view.html.php
new file mode 100644
index 000000000..942ade3be
--- /dev/null
+++ b/admin/views/component_dashboard/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_dashboard View class
+ */
+class ComponentbuilderViewComponent_dashboard extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_dashboard',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_dashboard.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_dashboard.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_dashboard.create'))
+ {
+ JToolBarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_dashboard.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_dashboard.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_dashboard.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_dashboard.create'))
+ {
+ JToolBarHelper::custom('component_dashboard.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_dashboard.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_dashboard.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_dashboard', $this->item->id);
+ }
+ if ($this->canDo->get('component_dashboard.create'))
+ {
+ JToolBarHelper::custom('component_dashboard.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_dashboard.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_dashboard');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_DASHBOARD_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_dashboard.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_dashboard/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_files_folders/submitbutton.js b/admin/views/component_files_folders/submitbutton.js
new file mode 100644
index 000000000..d8f50f641
--- /dev/null
+++ b/admin/views/component_files_folders/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 6 of this MVC
+ @build 29th October, 2017
+ @created 26th October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+
+
+
+
diff --git a/admin/views/component_custom_admin_views/tmpl/index.html b/admin/views/component_custom_admin_views/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_custom_admin_views/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_custom_admin_views/view.html.php b/admin/views/component_custom_admin_views/view.html.php
new file mode 100644
index 000000000..f56d35722
--- /dev/null
+++ b/admin/views/component_custom_admin_views/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_custom_admin_views View class
+ */
+class ComponentbuilderViewComponent_custom_admin_views extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_views',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_custom_admin_views.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_custom_admin_views.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_custom_admin_views.create'))
+ {
+ JToolBarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_custom_admin_views.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_custom_admin_views.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_custom_admin_views.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_custom_admin_views.create'))
+ {
+ JToolBarHelper::custom('component_custom_admin_views.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_custom_admin_views.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_custom_admin_views.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_custom_admin_views', $this->item->id);
+ }
+ if ($this->canDo->get('component_custom_admin_views.create'))
+ {
+ JToolBarHelper::custom('component_custom_admin_views.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_custom_admin_views.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_views');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_VIEWS_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_custom_admin_views.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_custom_admin_views/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_dashboard/submitbutton.js b/admin/views/component_dashboard/submitbutton.js
new file mode 100644
index 000000000..66b9adbfe
--- /dev/null
+++ b/admin/views/component_dashboard/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 5 of this MVC
+ @build 29th October, 2017
+ @created 26th October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+
+
diff --git a/admin/views/component_custom_admin_menus/tmpl/index.html b/admin/views/component_custom_admin_menus/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_custom_admin_menus/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_custom_admin_menus/view.html.php b/admin/views/component_custom_admin_menus/view.html.php
new file mode 100644
index 000000000..654a6ce1d
--- /dev/null
+++ b/admin/views/component_custom_admin_menus/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_custom_admin_menus View class
+ */
+class ComponentbuilderViewComponent_custom_admin_menus extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_custom_admin_menus',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_custom_admin_menus.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_custom_admin_menus.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_custom_admin_menus.create'))
+ {
+ JToolBarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_custom_admin_menus.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_custom_admin_menus.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_custom_admin_menus.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_custom_admin_menus.create'))
+ {
+ JToolBarHelper::custom('component_custom_admin_menus.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_custom_admin_menus.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_custom_admin_menus.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_custom_admin_menus', $this->item->id);
+ }
+ if ($this->canDo->get('component_custom_admin_menus.create'))
+ {
+ JToolBarHelper::custom('component_custom_admin_menus.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_custom_admin_menus.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_custom_admin_menus');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CUSTOM_ADMIN_MENUS_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_custom_admin_menus.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_custom_admin_menus/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_custom_admin_views/submitbutton.js b/admin/views/component_custom_admin_views/submitbutton.js
new file mode 100644
index 000000000..45e841447
--- /dev/null
+++ b/admin/views/component_custom_admin_views/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 5 of this MVC
+ @build 29th October, 2017
+ @created 22nd October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe
+
+
diff --git a/admin/views/component_config/tmpl/index.html b/admin/views/component_config/tmpl/index.html
new file mode 100644
index 000000000..fa6d84e80
--- /dev/null
+++ b/admin/views/component_config/tmpl/index.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/admin/views/component_config/view.html.php b/admin/views/component_config/view.html.php
new file mode 100644
index 000000000..1c7fa75de
--- /dev/null
+++ b/admin/views/component_config/view.html.php
@@ -0,0 +1,199 @@
+
+ @copyright Copyright (C) 2015. All Rights Reserved
+ @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
+
+ Builds Complex Joomla Components
+
+/-----------------------------------------------------------------------------------------------------------------------------*/
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import Joomla view library
+jimport('joomla.application.component.view');
+
+/**
+ * Component_config View class
+ */
+class ComponentbuilderViewComponent_config extends JViewLegacy
+{
+ /**
+ * display method of View
+ * @return void
+ */
+ public function display($tpl = null)
+ {
+ // Assign the variables
+ $this->form = $this->get('Form');
+ $this->item = $this->get('Item');
+ $this->script = $this->get('Script');
+ $this->state = $this->get('State');
+ // get action permissions
+ $this->canDo = ComponentbuilderHelper::getActions('component_config',$this->item);
+ // get input
+ $jinput = JFactory::getApplication()->input;
+ $this->ref = $jinput->get('ref', 0, 'word');
+ $this->refid = $jinput->get('refid', 0, 'int');
+ $this->referral = '';
+ if ($this->refid)
+ {
+ // return to the item that refered to this item
+ $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid;
+ }
+ elseif($this->ref)
+ {
+ // return to the list view that refered to this item
+ $this->referral = '&ref='.(string)$this->ref;
+ }
+
+ // Set the toolbar
+ $this->addToolBar();
+
+ // Check for errors.
+ if (count($errors = $this->get('Errors')))
+ {
+ throw new Exception(implode("\n", $errors), 500);
+ }
+
+ // Display the template
+ parent::display($tpl);
+
+ // Set the document
+ $this->setDocument();
+ }
+
+
+ /**
+ * Setting the toolbar
+ */
+ protected function addToolBar()
+ {
+ JFactory::getApplication()->input->set('hidemainmenu', true);
+ $user = JFactory::getUser();
+ $userId = $user->id;
+ $isNew = $this->item->id == 0;
+
+ JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'), 'pencil-2 article-add');
+ // Built the actions for new and existing records.
+ if ($this->refid || $this->ref)
+ {
+ if ($this->canDo->get('component_config.create') && $isNew)
+ {
+ // We can create the record.
+ JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ }
+ elseif ($this->canDo->get('component_config.edit'))
+ {
+ // We can save the record.
+ JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ }
+ if ($isNew)
+ {
+ // Do not creat but cancel.
+ JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ // We can close it.
+ JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ else
+ {
+ if ($isNew)
+ {
+ // For new records, check the create permission.
+ if ($this->canDo->get('component_config.create'))
+ {
+ JToolBarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ JToolBarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ };
+ JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CANCEL');
+ }
+ else
+ {
+ if ($this->canDo->get('component_config.edit'))
+ {
+ // We can save the new record
+ JToolBarHelper::apply('component_config.apply', 'JTOOLBAR_APPLY');
+ JToolBarHelper::save('component_config.save', 'JTOOLBAR_SAVE');
+ // We can save this record, but check the create permission to see
+ // if we can return to make a new one.
+ if ($this->canDo->get('component_config.create'))
+ {
+ JToolBarHelper::custom('component_config.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
+ }
+ }
+ $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('component_config.version'));
+ if ($this->state->params->get('save_history', 1) && $this->canDo->get('component_config.edit') && $canVersion)
+ {
+ JToolbarHelper::versions('com_componentbuilder.component_config', $this->item->id);
+ }
+ if ($this->canDo->get('component_config.create'))
+ {
+ JToolBarHelper::custom('component_config.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
+ }
+ JToolBarHelper::cancel('component_config.cancel', 'JTOOLBAR_CLOSE');
+ }
+ }
+ JToolbarHelper::divider();
+ // set help url for this view if found
+ $help_url = ComponentbuilderHelper::getHelpUrl('component_config');
+ if (ComponentbuilderHelper::checkString($help_url))
+ {
+ JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url);
+ }
+ }
+
+ /**
+ * Escapes a value for output in a view script.
+ *
+ * @param mixed $var The output to escape.
+ *
+ * @return mixed The escaped value.
+ */
+ public function escape($var)
+ {
+ if(strlen($var) > 30)
+ {
+ // use the helper htmlEscape method instead and shorten the string
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30);
+ }
+ // use the helper htmlEscape method instead.
+ return ComponentbuilderHelper::htmlEscape($var, $this->_charset);
+ }
+
+ /**
+ * Method to set up the document properties
+ *
+ * @return void
+ */
+ protected function setDocument()
+ {
+ $isNew = ($this->item->id < 1);
+ $document = JFactory::getDocument();
+ $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_NEW' : 'COM_COMPONENTBUILDER_COMPONENT_CONFIG_EDIT'));
+ $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/component_config.css");
+ $document->addScript(JURI::root() . $this->script);
+ $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/component_config/submitbutton.js");
+ JText::script('view not acceptable. Error');
+ }
+}
diff --git a/admin/views/component_custom_admin_menus/submitbutton.js b/admin/views/component_custom_admin_menus/submitbutton.js
new file mode 100644
index 000000000..250d1d54e
--- /dev/null
+++ b/admin/views/component_custom_admin_menus/submitbutton.js
@@ -0,0 +1,49 @@
+/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
+ __ __ _ _____ _ _ __ __ _ _ _
+ \ \ / / | | | __ \ | | | | | \/ | | | | | | |
+ \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
+ \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
+ \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
+ \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
+ | |
+ |_|
+/-------------------------------------------------------------------------------------------------------------------------------/
+
+ @version @update number 5 of this MVC
+ @build 29th October, 2017
+ @created 23rd October, 2017
+ @package Component Builder
+ @subpackage submitbutton.js
+ @author Llewellyn van der Merwe