- +
\ddTools::deleteDocuments: The new public static method. Deletes document(s) with all their children (recursively). Cache of the deleted docs and their parents will be cleared.
- *
\DDTools\Storage\DB\Storage::items_update: Fixed UPDATE query execution bug in some MariaDB versions.
- +
\DDTools\Tools\Objects::convertType→ Parameters →$params->object→ Valid values →object: Custom class instances are now also supported.
- +
\DDTools\Base\Base::getClassName()→ Result →$result->namespacePrefixRoot: The new result property contains the root namespace prefix (e. g.'\\ddSendFeedback'of'\\ddSendFeedback\\Sender\\Email\\Sender').
- *
\DDTools\Storage\DB\Storage: Works fine even ifidcolumn is not present in the table.
- *
\DDTools\Storage\DB\Storage::items_add:$params->items[$itemIndex]->idis used if it is passed and validated via$this->items_validateData.
- *
\DDTools\Base\AncestorTrait::getChildClassName: The public static method is no longer final. Now child classes can override this method.
- +
\DDTools\Base\Base::getClassName→ Parameters →$classNameFull: The new optional parameter. Allows to specify custom class name, not current called only. - +
\DDTools\Snippet::$paramsTypes[$paramName]→ Valid values →'float': The new supported value. - * PHP >= 7.4 is required.
- *
\DDTools\Storage\DB\Storage: Column names are quoted in all queries to avoid of errors when their names are equal to some reserved keywords, e. g.repeat.
- +
\DDTools\Tools\Objects::extend→ Parameters →$params->extendableProperties: The new optional parameter. Allows to use for extending not all properties from additional objects or arrays (see README → Examples). - +
\DDTools\Storage\Storage→items_update,items_updateOne,items_delete,items_deleteOne,items_get,items_getOne→ Parameters:- +
$params->where→ Valid values →null: The new supported value. It is equal to ''. - +
$params->where->{$propName}:- + You can also specify multiple value variants through an array.
- + You don't have to worry about passing empty arrays, they will just be ignored.
- +
- +
\DDTools\Tools\Cache:- + There are now 2 levels of caching: stable (file-based) and quick (
$_SESSION-based). All methods now utilize both levels automatically. - +
getSeveral: The new public static method. Retrieves data of several items from cache storage (see README). - +
saveSeveral: The new public static method. Saves data of several items to cache storage (see README). - +
save,saveSeveral,get,getSeveral,delete→ Parameters →$params->resourceId→ Valid values →string: The new supported value. You can use a custom string as the resource ID, not only an integer ID. - +
getSeveral,delete→ Parameters →$params->resourceId→ Valid values →array: The new supported value. You can specify multiple IDs. - +
delete→ Parameters →$params->resourceId→ Valid values →'*': The new supported value. - +
save→ Parameters →$params->isExtendEnabled: The new optional parameter. Allows to extend existing data (see README).
- + There are now 2 levels of caching: stable (file-based) and quick (
- +
\DDTools\Tools\Cache: The new class. Allows you to cache some data (e. g. a snippet result) to a file in theassets/cache/ddCachefolder (see README). - *
\DDTools\Tools\Objects: The class has been renamed from\DDTools\ObjectTools(with backward compatibility). - *
\DDTools\Tools\Files: The class has been renamed from\DDTools\FilesTools(with backward compatibility).
- *
\ddTools::parseText→ Parameters →$params->isCompletelyParsingEnabled: Broken support for deprecated name$params->mergeAllhas been fixed.
- +
\ddTools::isEmpty: The new public static method. Determines whether a variable is empty. - *
\ddTools::parseText→ Parameters:- +
$params->data: Both objects and arrays are supported regardless of nesting level. - +
$params->data->{$key}→ Valid values →boolean: The new supported value. It will be converted to'1'or'0'respectively. - *
$params->isCompletelyParsingEnabled:- * Has been renamed from
$params->mergeAll(with backward compatibility). - + If enabled, the method will parse everything, including document fields, settings, chunks, snippets and URLs.
- * Has been renamed from
- +
- *
\DDTools\ObjectTools::- +
getPropValue→ Parameters →$params->notFoundResult: The new optional parameter. Allows to define what will be returned if required property will not found (see README → Examples). - +
unfold→ Parameters →$params->isCrossTypeEnabled: The new optional parameter. This parameter determines whether the method should process elements across different data types, such as arrays and objects, at all levels. When set totrue, the method will recursively unfold elements of both array and object types, regardless of the type of the root parent (see README → Examples). - *
isPropExists→ Parameters →$params->object: The method will returnfalseeven if the parameter is not an object or array.
- +
- *
\DDTools\ObjectCollection::setOneItemData→ Parameters: The following have been renamed (old names are still supported but deprecated):- *
itemIndex→index. - *
itemData→data.
- *
- +
\DDTools\Base\Base::getClassName: The new public static method. Gets data about a class name (see README). - +
\DDTools\Base\AncestorTrait::getChildClassName: The new public static method (see README). - +
\DDTools\Storage\: The new classes. This is beta functionality, use it at your own risk.
- +
\DDTools\ObjectTools::convertType→ Parameters →$params->type→ Valid values →'stringHtmlAttrs': The new available value. Allows conversion to an HTML attributes string (see README → Examples).
- +
\ddTools::getTpl: The new public method (see README).
- +
\ddTools::parseText: In addition to accessing nested properties via placeholders like'[+prop.subProp+]', you can get whole object as JSON via placeholders like'[+prop+]'(see README → Examples).
- *
\DDTools\ObjectTools::convertType→ Parameters →$params->type→ Valid values →'stringQueryFormatted': A mistake has been fixed. The incorrect value'stringQueryFormated'is also supported for backward compatibility.
- +
\DDTools\Base\AncestorTrait::createChildInstance→ Parameters →$params->parentDir: Is no longer required and by default is equal to dirname of a class that uses this trait.
- +
\DDTools\ObjectTools::getPropValue→ Parameters →$params->propName: The method can now get the value of an object property or an array element in any nesting level. Just use'.'to get nested properties.
Several examples (see full examples in README):- *
somePlainProp— get first-level property. - *
someObjectProp.secondLevelProp— get property of thesomeObjectPropobject|array. - *
someArrayProp.0.thirdLevelProp— get property of the zero element of thesomeArrayProparray.
- *
- +
\ddTools::sort2dArray→ Parameters →$array[$i]: Can also be set as object. - *
\DDTools\Base\Base:- * The class has been renamed from
\DDTools\BaseClass. Backward compatibility is maintained (you can still use\DDTools\BaseClass, but it is not recommended). - * The class has become abstract.
- -
createChildInstance: The method has been removed, use\DDTools\Base\AncestorTrait::createChildInstanceinstead. Backward compatibility is maintained (you can still use\DDTools\BaseClass::createChildInstance, but it is not recommended). - +
toJSON: Returns JSON-array if$this->toArrayreturns indexed array.
- * The class has been renamed from
- +
\DDTools\Base\AncestorTrait: The new trait. - +
\DDTools\ObjectCollection:- +
toJSON,__toString: The new public methods. Get an JSON-array of all collection items. - +
\DDTools\ObjectCollection::setOneItemData,getOneItemData: The new protected methods.
- +
- *
\DDTools\FilesTools::modifyImage: Included PHP.libraries.phpThumb has been updated from 1.7.15-202004301145 to 1.7.19-202210110924 (now supports WebP, PHP8, etc).
- +
\ddTools::convertUrlToAbsolute: The new public method. Converts relative URLs to absolute. See more info and examples in README.md. - * README: Various improvements.
- +
\DDTools\BaseClass::setExistingProps→ Parameters →$props: Can also be set as a JSON, HJSON or Query formatted string. - * Included PHP.libraries.HJSON has been updated from 2.1 to 2.2.
- + README → Installation → Update using (MODX)EvolutionCMS.libraries.ddInstaller.
- +
\DDTools\ObjectCollection: The new class representing a collection of some objects or arrays. See more info and examples in README. - *
\ddTools::parseText→ Parameters →$params->data: A bug with multidimensional objects has been fixed. - * README:
- - Documentation: Useless header level has been removed.
- * Examples: Several missed characters have been added.
- *
\ddTools::parseText: Fixed working when$params->datais a multidimensional object.
- +
\DDTools\ObjectTools::unfold: The new method.
Converts a multidimensional array/object into an one-dimensional one joining the keys with$params->keySeparator.
For example, it can be helpful while using placeholders like[+size.width+].
See more info and examples in README.md.
- +
\DDTools\ObjectTools::convertType: Added the ability to returnstringQueryFormatted.
- +
\DDTools\Response:- +
setMetaData: The new public method. Setter for$this->metaand$this->data. - +
setMeta→ Parameters:- +
$meta['success']: Is not required anymore and by default will be equal totrue. - +
$meta['code']: Is not required anymore and by default will be equal to200or400depending on$meta['success']. - +
$meta:- + Can also be set as stdClass, stringJsonObject, stringHjsonObject, stringQueryFormatted.
- + Is not required anymore and by default will be equal to
['success' => true, 'code' => 200].
- +
- +
setMetaMessage: If$this->metais not set, it will be set with default values ofsuccessandcode.
- +
- *
\DDTools\ObjectTools::extend: Improved deep cloning objects to arrays.
- *
\ddTools::parseText:- + Parameters →
$params->data: Can also be set as JSON, HJSON or Query string. - *
\DDTools\ObjectTools::extendis used instead ofarray_merge.
- + Parameters →
- + README → Documentation → Parameters description →
\ddTools::parseText($params).
- *
\DDTools\ObjectTools::extend: Added deep object cloning to prevent references.
- *
\DDTools\Snippet::prepareParams: Type of only existing params will be converted.
- +
\DDTools\Snippet:- +
$paramsTypes: The new property. Overwrite in child classes if you want to convert some parameters types. - +
prepareParams: The parameter types will be converted respectively with$this->paramsTypes.
- +
- +
\DDTools\ObjectTools::convertType:- + Added HJSON support (closes #7).
- + Improved detection of failed
json_decodeattempt.
- +
\ddTools::updateDocument: Added default values for the following parameters:- +
$docData->editedon: If it isn't set, it will be equal to current date-time (time()). - +
$docData->editedby: If it isn't set, it will be equal to1.
- +
- *
\DDTools\ObjectTools::extend:- * Recursion is called only if source value is an object or array.
- * Optimization.
- +
\DDTools\Response::isSuccess: The new public method.
- +
\DDTools\Snippet::prepareParams: The new method.
- * Attention! PHP >= 5.6 is required.
- *
\DDTools\Response:- - Child version classes are not used anymore.
- +
$requiredMetaKeys: The new field. - +
$requiredMetaMessageKeys: The new field. - +
validateMetaMessage: The new method. - +
setMetaMessage: The new method. - +
validateMeta: Can take any type of parameter and just returnsfalseif it is not an array. - *
toJSON: Refactoring,\DDTools\ObjectTools::convertTypeis used instead ofjson_encode.
- *
\DDTools\BaseClass::toJSON: Refactoring,\DDTools\ObjectTools::convertTypeis used instead ofjson_encode. - + Composer.json →
authors: Added missing authors.
- *
\ddTools::verifyRenamedParams:- + If
$params->paramsset as an object, the method will return an instance of stdClass. - *
\DDTools\ObjectTools::extendis used instead ofarray_merge.
- + If
- +
\DDTools\Snippet: The new abstract class for snippets. - *
\ddTools::getTemplateVars,\ddTools::getTemplateVarOutput→ Parameters →$idnames: Less fragile working when the parameter is a string. - + README → Links → Packagist.
- +
\ddTools::getDocumentIdByUrl: Supports domains in IDNA ASCII-compatible format.
- *
\ddTools::createDocument,\ddTools::updateDocument: Document field values will be prepared by$modx->db->escape(). - +
\ddTools::createDocument→ Parameters →$docData->pagetitle: Can't be equal to'', so will be equal to'New resource'in this case.
- *
\DDTools\FilesTools::modifyImage:- + Supports
.icoand.bmp. - +
$params->watermarkImageFullPathName: The new parameter. You can overlay your image with needed watermark image. - +
$params->sourceFullPathName,$params->outputFullPathName: Can be equal to relative paths too, the method will automatically addbase_pathif needed. - +
$params->outputFullPathName: Is not required anymore and by default is be equal to$params->sourceFullPathName. - +
$params->allowEnlargement: Is not required anymore and by default is equal to0. - +
$params->backgroundColor: Is not required anymore and by default is equal toFFFFFF. - +
$params->quality: Is not required anymore and by default is equal to100. - *
$params->allowEnlargement: Type changed to boolean (with backward compatibility). - * PHP.libraries.phpThumb: Updated from 1.7.13-201406261000 to 1.7.15-202004301145.
- * Refactoring.
- + Supports
- + README → Documentation → Parameters description →
\DDTools\FilesTools→\DDTools\FilesTools::modifyImage($params).
- +
\ddTools::createDocument→ Parameters →$docData->alias: Will be transliterated from$docData->pagetitleif empty or not set. - * README → Documentation → Installation → Using Composer: Fixed the library name.
- *
\DDTools\ObjectTools::convertType: Fixed type of deep objects when$params->type=='objectarray'. - * README:
- - Home page.
- + Links.
- +
\DDTools\ObjectTools::convertType: The new method. Converts an object type. Arrays, JSON and Query string objects are also supported. - *
\ddTools::encodedStringToArray:- * Now uses
\DDTools\ObjectTools::convertType. - * Style of CMS log message was improved.
- * Now uses
- *
ddTools::createDocument:- * Parameters →
$docData->pagetitle: Is not required anymore and by default will be equal to'New resource'. - * Small refactoring.
- * Parameters →
- *
\ddTools::sort2dArray:- + Associative arrays are also supported.
- * Small refactoring.
- +
\ddTools::prepareDocData,\ddTools::createDocument,\ddTools::updateDocument: Also can take document fields as stdClass, not only as an associative array.
- * Composer.json:
- +
authors. - *
name: Changed fromdd/modxevo-library-ddtoolstodd/evolutioncms-libraries-ddtools. - *
homepage: Link changed to HTTPS.
- +
- +
\DDTools\BaseClass::toArray. Returns all properties of this object as an associative array independent of their visibility. - +
\DDTools\BaseClass::toJSON. Returns all properties of this object as an JSON string independent of their visibility. - +
\DDTools\BaseClass::__toString(). The same as\DDTools\BaseClass::toJSON(). - + README → Parameters description:
- +
\DDTools\BaseClass. - + Small improvements.
- +
- +
\DDTools\ObjectTools::extend:- + Added the ability to prevent fields overwriting with empty values (
$params->overwriteWithEmpty). - + Objects can extend arrays and vice versa.
- + Types of nested objects are independent on types of their parents.
- + Added the ability to prevent fields overwriting with empty values (
- +
\DDTools\ObjectTools::isPropExists. Checks if the object, class or array has a property / element (see README). - +
\DDTools\ObjectTools::getPropValue. Get the value of an object property or an array element (see README). - +
\DDTools\ObjectTools::isObjectOrArray. Finds whether a variable is an array or an object. The method is private for now, because we will need to think more about the parameters.
- *
\DDTools\ObjectTools::extend: Fixed array deep extending error if an original array item is not exist.
- +
\DDTools\ObjectTools::extend: Arrays can also be extended. - * CHANGELOG: Fixed misprints.
- *
\ddTools::verifyRenamedParams:- * Pass-by-name style is used (with backward compatibility).
- + Added an ability to prevent writing to the CMS event log (see
$params->writeToLog). - + Added an ability to return all parameters, not only corrected (see
$params->returnCorrectedOnly). - +
$params->paramscan be set asstdClasstoo. - + Improved message style in the CMS log event.
- * Small refactoring.
- + README → Documentation:
- + Parameters description →
\ddTools::verifyRenamedParams($params). - + Examples → Verify renamed snippet params (
\ddTools::verifyRenamedParams($params)).
- + Parameters description →
- +
\DDTools\ObjectTools::extend. Merge the contents of two or more objects together into the first object (see README.md). - * README: Style improvements.
- * Attention! (MODX)EvolutionCMS >= 1.1 is required.
- +
\ddTools::getDocumentParentIds. Gets the parent ID(s) of the required level. - +
\ddTools::clearCache. Clears cache of required document(s) and their parents. - +
\ddTools::updateDocument: Cache of the updated docs and their parents will be cleared.
- *
\DDTools\BaseClass::setProp: Do nothing if property is not exist.
- +
\DDTools\BaseClass::setExistingProps: Can set properties of all parent and child classes.
- +
\DDTools\FilesTools::createDir(and\ddTools::createDiras alias): Makes directory using$modx->config['new_folder_permissions']. Nested directories will be created too. Doesn't throw an exception if the folder already exists.
- +
\ddTools::encodedStringToArray: Can take an array too (sometimes it's convenient to not think about it).
- * Attention! Backward compatibility with 0.25 is broken.
- -
\DDTools\ObjectTools. - +
\DDTools\BaseClass. - +
\DDTools\BaseClass::setExistingProps: Can set private properties too. - *
\DDTools\BaseClass::createChildInstance: Fixed some bugs.
- +
\DDTools\ObjectTools::setExistingProps: The new method. Sets existing object properties. - +
\DDTools\ObjectTools::createChildInstance: The new method. Creates an instance of the needed child class (e. g.\ddSendFeedback\Sender\Telegram\Sender).
- +
\ddTools::parseSource: Uncashed snippets will be evaled too. - * Some refactoring and alpha functional.
- +
\ddTools::parseText:$params->datacan be set now asstdClass. - *
\ddTools::encodedStringToArray: Fixed event logging if$inputStringis empty.
- +
\ddTools::sendMail: SMTP support added. Many thanks to @Aharito. - +
\ddTools::createDocument,\ddTools::updateDocument: TV-dates wich set as unix time will be converted to correct system date format. - +
\ddTools::prepareDocData: The new method. Prepare document data from single array of fields and TVs: separate them and get TVs additional data if needed. - *
\ddTools::explodeFieldsArris deprecated, use\ddTools::prepareDocDatainstead (with backward compatibility).
- +
\ddTools::$tables: Added all MODX tables except deprecatedkeyword_xref,site_content_metatags,site_keywordsandsite_metatags.
- +
\ddTools::getPlaceholdersFromText: The new method. Finds all placeholders' names and returns them as an array. - *
\ddTools::escapeForJS: Fixed excessive backslach escaping.
- *
\ddTools::sendMail: Fixed displaying of the file in the mail agent. - *
\ddTools::escapeForJS: Added backslach escaping. Many thanks to @Aharito. - * The library now works correctly without Composer.
- +
\ddTools::logEvent: The new method. Adds an alert message to the MODX event log with additional debug info (backtrace, snippet name, document id, etc). - +
\ddTools::encodedStringToArray: The new method. Converts encoded strings to arrays. Supported formats: JSON and Query string.
- +
\ddTools::parseText: Added support of nested arrays in$params->data.
- *
\ddTools::generateRandomString: The$charsparameter setting was fixed.
- *
\ddTools::screening: Was renamed as\ddTools::escapeForJS(with backward compatibility). - *
\ddTools::orderedParamsToNamed: Now is public. But be advised that this is beta-version!
- * Attention! PHP >= 5.4 is required.
- *
\ddTools::parseText: Updated to 1.3.1:- * Refactoring, the method now using named parameters (with backward compatibility).
- + Added an ability to remove empty placeholders (see
$params['removeEmptyPlaceholders']). - * The
$params['data']parameter is no longer required.
- *
\ddTools::sendMail: Updated to 2.1:- * Refactoring, the method now using named parameters (with backward compatibility).
- * Default value of the
$params['from']parameter is getting now from$modx->getConfig ('emailsender'). Thank you, MrSwed!.
- +
\ddTools::regEmptyClientScript: Updated to 1.1:- + Parameters can be passed as stdClass object.
- * Refactoring: Short array syntax is used because it’s more convenient.
- *
\ddTools::verifyRenamedParams: Updated to 1.1.1:- + An ability to use multiple old names was added (see the
$complianceparameter). - * Minor refactoring, code style and description changes.
- + An ability to use multiple old names was added (see the
- *
\ddTools::sendMail: The content and headers of an email are now passed to themailfunction separately. This fixes empty email contents in some email clients.
- *
\ddTools::updateDocument: The method now usesmysqli_infoif$modx->db->connis an instance of themysqliclass ormysql_infootherwise.
- * The
$modx->getVersionDatamethod existence check was moved under the isset $modx condition. - *
\ddTools::getTemplateVarOutput: The check for existence of$row['id']was changed to an isset check.
- +
\ddTools::copyDir: The new method. It allows copying a folder with all its contents recursively. - *
\ddTools::updateDocument: The method now usesmysqli_infoinstead ofmysql_info. - *
\ddTools::getDocuments: user access options are now completely ignored while retrieving. It’s done because the method is supposed to be a low level implementation, so it’s implied that a structure of a higher level will be dealing with user access. - * The library now depends on
dd/composer-plugin-modxevo-library-ddtools-installerv1.0.5 - + A new helper class called
\ddTools\Responsewas added. It’s recommended to be used as a skeleton for the response to a client request or as the result of a snippet supporting AJAX output.
- + An
issetcheck for the global$modxvariable has been added to prevent an error when calling the$modx->getFullTableNamemethod.
- + Added a global statement at the beginning to make sure that
$modxis available. Without the statement an error occurs while autoloading via Composer.
- * The following methods need their
$publicationand$deletedparameters to be set as'all'to return the required documents regardless of their publication and / or removal status(es). The previous value (false) is still supported but causes a warning in the log and will be dropped sometime:- *
\ddTools::getDocuments. - *
\ddTools::getDocument. - *
\ddTools::getTemplateVars. - *
\ddTools::getTemplateVarOutput. - *
\ddTools::getDocumentChildren. - *
\ddTools::getDocumentChildrenTVarOutput.
- *
- *
\ddTools::getTemplateVars: Updated to 1.3. The method now returns the template variables of a document whether the document is deleted or not.
- * The structure of the repository has been completely changed to meet the Composer requirements.
- *
\ddTools::createDocument: Thepathof a new document now properly depends on thealias/idof its parent.
- *
\ddTools::createDocument: The method has been slightly changed. The MODXdocumentMapandaliasListingconfig arrays are now being modified properly while the method is called.
- *
\ddTools::sendMail: The method was slightly changed to eliminate errors in PHP 5.4−5.6 during headers validation:- * All double
\r\nand singe\r\nwere replaced with singlePHP_EOL. - * Leading or trailing
PHP_EOL's are now trimmed in email content.
- * All double
- +
\ddTools::sendMail: The new method. It sends emails.
- +
\ddTools::verifyRenamedParams: The new method. It checks an array for deprecated parameters and writes warning messages into the MODX event log. It returns an associative array, in which the correct parameter names are the keys and the parameter values are the values. You can use theexctractfunction to turn the array into variables of the current symbol table.
- * The following methods have been slightly updated in accordance with MODX 1.0.13:
- *
\ddTools::getDocuments. - *
\ddTools::getTemplateVars. - *
\ddTools::getTemplateVarOutput. - *
\ddTools::getDocumentChildren. - *
\ddTools::getDocumentChildrenTVarOutput.
- *
- +
\ddTools::ddTools::sort2dArray: The new method. It sorts 2-dimensional array by multiple columns (like in SQL) using Hoare’s method, also referred to as quicksort. The sorting is stable. - * Small changes for compatibility with old MODX versions.
- * Bugfix: The method
\ddTools::unfoldArraydidn’t used to be static.
- +
\ddTools::unfoldArray: The new method. Converts a multidimensional array into an one-dimensional one joining the keys with'.'(see the description & examples). - *
\ddTools::$documentFields: The fieldalias_visiblewill be added to the array only if the version of MODX is later than 1.0.11 for backward compatibility. - * The array
\ddTools::$tableswith its elements is declared directly in the class to make it clear.
- * Attention! MODX >= 1.0.12 is required.
- *
\ddTools::$documentFields: The fieldalias_visiblehas been added to the array (MODX 1.0.12).
- *
\ddTools::parseFileNameVersion: Updated to 1.1:- * File extension is currently returned along with file name & version.
- +
\ddTools::getDocumentIdByUrl: The new method. It gets ID of a document by its URL.
- *
\ddTools::explodeAssoc: Updated to 1.1.1:- * The processing of an empty string as input argument has been added (the method returns an empty array in such cases).
- +
\ddTools::parseFileNameVersion: The new method. It parses a file path and gets its name & version. - *
\ddTools::regEmptyClientScript: Updated to 1.0.1:- * Bugfix: A current version use is checked when an empty value assigns to
$modx->sjscriptsor$modx->jscripts.
- * Bugfix: A current version use is checked when an empty value assigns to
- +
\ddTools::getDocumentChildren: The new method (which is analog of the native one). The method gets fields values of child documents. The values can be got regardless of their documents publication status, that is unavailable in the native method. - *
\ddTools::getDocumentChildrenTVarOutput: Updated to 1.1:- *
publishedparameter can be ===false, then documents publication status does not matter.
- *
- * Minor code refactoring.
- * Bugfix: The following methods were not static:
- *
\ddTools::getDocuments. - *
\ddTools::getDocument. - *
\ddTools::getTemplateVars. - *
\ddTools::getTemplateVarOutput.
- *
- + A few standard methods to work with documents were added. The methods return results regardless of documents published status:
- +
\ddTools::getDocuments. It gets required documents (documents fields). - +
\ddTools::getDocument. It gets required documents (document field). - +
\ddTools::getTemplateVars. It gets the array of template variables and fields of a document. - +
\ddTools::getTemplateVarOutput. It gets the associative array of template variables values and fields values of a document.
- +
- +
\ddTools::$tables:'site_tmplvar_templates'table was added.
- +
\ddTools::removeDir: The new method. It removes a required folder with all contents recursively. - +
\ddTools::regEmptyClientScript: The new method. It adds a required JS-file into a required MODX inner list according to its version and name and is used to register the scripts, that had already been connected manually.
- *
\ddTools::explodeAssoc: Updated to 1.1:- * The empty value check while key→value splitting has been added (if value is empty then empty string inserts).
- *
\ddTools::updateDocument: Updated to 1.2:- * The updateDocument name error has been corrected.
- * Id parameter takes the value of a positive integer or an array.
- * The error that occured when document fields update were not required has been eliminated.
- * The simultaneous TV update of a few documents error has been eliminated.
- * The method update documents that satisfy
idcriterion and criterions defined inwhereparameter together.
- +
\ddTools::getDocumentChildrenTVarOutput: The new method. It gets necessary children of document.
- * Attention! Backward compatibility is broken.
- +
\ddTools::$documentFields: The new field. It contains array of document fields names. - +
\ddTools::$tables: The new field. It contains full names of some db tables. - +
\ddTools::screening: The new method. It screening chars into the string. - +
\ddTools::explodeAssoc: The new method. It splits string into two separators in the associative array. - +
\ddTools::explodeFieldsArr: The new method. It explodes associative array of fields and TVs into two individual arrays. - +
\ddTools::parseText: Updated to 1.1:- + Added possibility to switch off additional parsing of the document fields, settings, chunks (method
mergeAll).
- + Added possibility to switch off additional parsing of the document fields, settings, chunks (method
- +
\ddTools::createDocument: Updated to 1.1:- + Added possibility to transfer TVs (not only document fields) into the
$fieldsparam.
- + Added possibility to transfer TVs (not only document fields) into the
- +
\ddTools::udateDocument: Updated to 1.1:- + Added possibility to transfer TVs (not only document fields) into the
$updateparam. - + Added true verification of changing data. Now method guaranteed returns
trueorfalse.
- + Added possibility to transfer TVs (not only document fields) into the
- *
\ddTools::parseSourse: Renamed into\ddTools::parseSource. - *
\ddTools::generateString: Renamed into\ddTools::generateRandomString.
- + The first release.