function __construct($plugin = '', $action = '') { //create object from cls_plugin $this->obj_plugin = new cls_plugin(); //set last page that user see $this->set_last_page(); //get localize $obj_localize = new cls_localize(); $this->localize = $obj_localize->get_localize(); //------------------------- $this->obj_io = new cls_io(); if ($plugin == '' || $action == '') { if (isset($_REQUEST['plugin'])) { $this->plugin = $_REQUEST['plugin']; //now we check action if (isset($_REQUEST['action'])) { //action set by user $this->action = $_REQUEST['action']; } else { //action not set. //now we jump to default action $this->action = 'default'; } } else { // plugin not set // now jump to Home page $obj_localize = new cls_localize(); $localize = $obj_localize->get_localize(); $this->jump_page($localize['home'], true); } } else { $this->plugin = $plugin; $this->action = $action; } }
public function simple_send($to_name, $to_email, $subject, $body) { //get site email and main site name $localize = new cls_localize(); $localize_data = $localize->get_localize(); //Create a new PHPMailer instance $mail = new cls_mail(); // Set PHPMailer to use the sendmail transport $mail->isSendmail(); //Set who the message is to be sent from $mail->setFrom($localize_data['email'], $localize_data['name']); //Set an alternative reply-to address $mail->addReplyTo($localize_data['email'], $localize_data['name']); //Set who the message is to be sent to $mail->addAddress($to_email, $to_name); //Set the subject line $mail->Subject = $subject; //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $mail->msgHTML($body); //Replace the plain text body with one created manually //$mail->AltBody = 'This is a plain-text message body'; //Attach an image file //$mail->addAttachment('images/phpmailer_mini.gif'); //send the message, check for errors if (!$mail->send()) { return false; } else { return true; } }
<?php //This file get system language and translate all _() function with po and mo difined files //for add tranlations create your language folder in languages like fa_IR //step 2 create LC_MESSAGES folder on it and put your mo and po files inside it $obj_localize = new cls_localize(); $sys_language = $obj_localize->get_language(); putenv("LANG=" . $sys_language); setlocale(LC_ALL, $sys_language); bindtextdomain($sys_language, "./languages/"); textdomain($sys_language);
public static function set_page_tittle($tittle = '') { //get site name in localize selected if (is_null(self::$localize_settings)) { $obj_localize = new cls_localize(); self::$localize_settings = $obj_localize->get_localize(); self::$page_tittle = self::$localize_settings['name']; } self::$page_tittle = self::$localize_settings['name'] . ' | ' . $tittle; return self::$page_tittle; //now we want to send title to render function. }