Skip to content

Instantly share code, notes, and snippets.

@pmfx
Forked from Dmi3yy/modx.evo.1.2.md
Last active December 1, 2016 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmfx/2202f6c8daf19a37502e6c4326759844 to your computer and use it in GitHub Desktop.
Save pmfx/2202f6c8daf19a37502e6c4326759844 to your computer and use it in GitHub Desktop.

#Release 1.2 from 01.12.2016.

This release includes many changes and improvements that would make simpler of creating sites on MODX EVO.

More then 1200 commits

##On MODX Evolution 1.2 worked:

https://github.com/modxcms/evolution/graphs/contributors?from=2016-02-29&to=2016-12-01&type=c

----need rewrite----

##Main things I would like draw attention to:

  • KCFinder - change uploaded image/file names with TransAlias
  • ManagerManager updated up to 0.6.1
  • Updated API functions: clearCache, now you can call it with parameter full ($modx->clearCache('full');)
  • Updated API functions: getDocuments, getTemplateVars, getTemplateVarOutput, getDocumentChildren, getDocumentChildrenTVarOutput, you can call getDocumentChildren with parameter all for view all documents (not only published or unpublished, and the same with deleted)
  • Updated Wayfinder to 2.0.2 (available document specific placeholders [+pagetitle+], [+longtitle+] etc.; fixed work of @INHERIT for custom TVs)
  • Managers with role = 1 can see all documents in manager panel and in frontend (in earlier versions documents with restrinctions to special groups could not be seen by those manager users)
  • Added API function: $modx->parseText()
  • Added document ID to title during editing document, also added to QM+
  • Breadcrumbs 1.0.4 (you can exclude documents with the specified templates)
  • phpthumb 1.2 (if images on page processed already, phpthumb class will not included)
  • eForm 1.4.8 (added parameters: &attachmentFields/&attachmentPath)
  • FirstChildRedirect 2.0 (added parameters: &default, &sortBy, &sortDir, &responseCode)
  • New default theme MODxRE2
  • ElementsInTree plugin to manage elements with ease inside sidebar

All changes always available in file assets/docs/changelog.txt

Details about some changes

also I'll talk about some things, that was in 1.0.12, but was not well explained

API Changes

$modx->getDocument,

$modx->getDocuments,

$modx->getDocumentChildren,

$modx->getDocumentChildrenTVarOutput,

$modx->getTemplateVarOutput,

$modx->getTemplateVars

Added ability not consider parameters published and deleted during getting document

 @param $published {0; 1; 'all'} - Document publication status. Once the parameter equals 'all', the result will be returned regardless of whether the ducuments are published or they are not. Default: all.
 
 @param $deleted {0; 1; 'all'} - Document removal status. Once the parameter equals 'all', the result will be returned regardless of whether the ducuments are deleted or they are not. Default: 0.

$modx->getIdFromAlias()

Method allows get document ID by its alias (used in search in manager panel), available since 1.0.12

$docid = $modx->getIdFromAlias('blog.html');
$docid = $modx->getIdFromAlias('catalog/tovar.html');

####$modx->sendmail() Method used for send mails by API (available since 1.0.12). Works with settings, sending emails using mail() or SMTP according to the specified settings in the manager panel. Usage:

#simple variant
	$param = array();
	$param['from']    = "{$site_name}<{$emailsender}>";
	$param['subject'] = $emailsubject;
	$param['body']    = $message;
	$param['to']      = $email;
	$rs = $modx->sendmail($param);

#variant with additional settings 
	$modx->loadExtension('MODxMailer');
	$modx->mail->IsHTML($isHtml);
	$modx->mail->From		= $from;
	$modx->mail->FromName	= $fromname;
	$modx->mail->Subject	= $subject;
	$modx->mail->Body		= $report;
	AddAddressToMailer($modx->mail,"replyto",$replyto);
	AddAddressToMailer($modx->mail,"to",$to);
	AddAddressToMailer($modx->mail,"cc",$cc);
	AddAddressToMailer($modx->mail,"bcc",$bcc);
	AttachFilesToMailer($modx->mail,$attachments);
	if(!$modx->mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $modx->mail->ErrorInfo;

###Ditto Available in version 1.0.12
New parameters:

$outerTpl  - works as Wayfinder, if documents not found then will show string that specified in parameter `noResults`. In parameter you should use placeholder [+wrapper+].

$max_paginate, $max_previous - 2 parameters which affect the pagination, default (50 and 25 resp.). Using as replacement of snippet **splitPaginate**. If count of page very big, show only part of pages. 

New placeholders:

[+ditto_class+] - can be: odd, even, first, last, current
[+ditto_index+] - same as [+ditto_iteration+], but starting with 1. 

###FirstChildRedirect New parameters:

&default - if document haven't children, redirect to specified ID, default site_start

sortings methods for getting the first documents
&sortBy - default menuindex
&sortDir - default ASC
&responseCode - HTTP code of redirect 301/302, default 301

###ManagerManager A lot of changes, details here: http://code.divandesign.ru/modx/managermanager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment