Example #1
0
 /**
  * Will add a string to the <title></title> array, that will be represented by the getPageTitle method. If you need to have
  * control over the <title></title> tags of the generated DOM, than you can use this method by passing a string that will get
  * appended to the title string. You can see {@link TPL::switchtTL ()} on how to reverse the title string;
  *
  * @param S $webPageStringTitle The string to be added to the title;
  * @return M Either the current object instance, or boolean false, depends;
  * @author Catalin Z. Alexandru <*****@*****.**>
  * @copyright Under the terms of the GNU General Public License v3
  * @see TPL::switchTTL()
  * @version $Id: 10_TPL.php 315 2009-10-11 07:11:31Z catalin.zamfir $
  * @since Version 1.0
  * @access public
  * @static
  * @final
  */
 public static final function manageTTL(S $webPageStringTitle)
 {
     if (self::$objPageTitle[self::$objPageTitle->doCount()->toInt()] = $webPageStringTitle->entityDecode(ENT_QUOTES)->stripTags()->entityEncode(ENT_QUOTES)) {
         return TheFactoryMethodOfSingleton::getInstance(__CLASS__);
     } else {
         // Do return ...
         return new B(FALSE);
     }
 }
Example #2
0
 /**
  * Will send the email, at the specified address, using the specified subject and content;
  *
  * This method will send out the given email and subject, to the given address, while decoding the content from entities; You,
  * as the user, SHOULD ALWAYS remember, that the content gets decoded in this method, thus allowing you to work with your
  * content where you've called it, without modifying it;
  *
  * @param S $objMAILTo The email to send it to;
  * @param S $objMAILSubject The subject to set;
  * @param S $objMAILContent And the content;
  * @todo CLEAN THIS URGENTLY! ...
  */
 public function doMAIL(S $objMAILTo, S $objMAILSubject, S $objMAILContent)
 {
     // First of ALL, get a CLONE ...
     $objMAILClone = clone $objMAILContent;
     $objMAILClone = $objMAILClone->entityDecode(ENT_QUOTES)->stripTags();
     // #0: proper MULTIPART;
     $objMAILContent->prependString(new S(_N_))->prependString(_S(self::MAIL_HEADER_CONTENT_ENCODING_SEVENBIT . _N_))->prependString(_S(self::MAIL_HEADER_CONTENT_TYPE_HTML . _N_))->prependString(_S(self::MAIL_HEADER_PHP_ALTERNATIVE . _N_)->doToken('%s', self::$objHASHId))->prependString(_S(_N_))->prependString(_S($objMAILClone . _N_))->prependString(_S(_N_))->prependString(_S(self::MAIL_HEADER_CONTENT_ENCODING_SEVENBIT . _N_))->prependString(_S(self::MAIL_HEADER_CONTENT_TYPE_PLAIN . _N_))->prependString(_S(self::MAIL_HEADER_PHP_ALTERNATIVE . _N_)->doToken('%s', self::$objHASHId))->prependString(_S(_N_))->prependString(_S(self::MAIL_HEADER_MULTIPART_ALTERNATIVE . _N_)->doToken('%s', self::$objHASHId))->prependString(_S(self::MAIL_HEADER_PHP_MIXED . _N_)->doToken('%s', self::$objHASHId));
     // #4: ... end PLAIN and HTML ...
     $objMAILContent->appendString(_S(_N_))->appendString(_S(self::MAIL_HEADER_PHP_ALTERNATIVE_END . _N_)->doToken('%s', self::$objHASHId));
     // #5: ... attachments;
     foreach (self::$objEMLAttachment as $k => $v) {
         // #5.1
         $objMAILContent->appendString(_S(self::MAIL_HEADER_PHP_MIXED . _N_)->doToken('%s', self::$objHASHId))->appendString(_S(self::MAIL_HEADER_ATTACHMENT_TYPE_NAME . _N_)->doToken('%t', $v['attachment_type'])->doToken('%n', $v['attachment_name']))->appendString(_S(self::MAIL_HEADER_ENCODING_BASE64 . _N_))->appendString(_S(self::MAIL_HEADER_DISPOSITION_ATTACHMENT . _N_))->appendString(_S(_N_))->appendString($v['attachment_base64'])->appendString(_S(self::MAIL_HEADER_PHP_MIXED . _N_)->doToken('%s', self::$objHASHId));
     }
     // Finish ...
     $objMAILContent->appendString(_S(_N_))->appendString(_S(self::MAIL_HEADER_PHP_MIXED_END)->doToken('%s', self::$objHASHId));
     // Go ... everyhing IS ok and life's grand ...
     MAIL($objMAILTo, $objMAILSubject, $objMAILContent->entityDecode(ENT_QUOTES), self::$objFromHeader . self::$objReceiptTo . self::$objReplyTo . self::$objMIMEHeader . self::$objTypeHTML);
 }