Ejemplo n.º 1
0
 public function syncWithEngine()
 {
     $res = new responseCsp();
     if (($syncMsg = $this->getModel()->syncWithEngine(reqCsp::get('post'))) !== false) {
         $res->addMessage(empty($syncMsg) ? langCsp::_('Done') : $syncMsg);
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     return $res->ajaxExec();
 }
Ejemplo n.º 2
0
 public function recreatePages()
 {
     $res = new responseCsp();
     if ($this->getModel()->recreatePages()) {
         $res->addMessage(langCsp::_('Pages was recreated'));
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     $res->ajaxExec();
 }
Ejemplo n.º 3
0
 public function saveRole()
 {
     $res = new responseCsp();
     if (($roleRetData = $this->getModel()->saveRole(reqCsp::get('post'))) !== false) {
         $res->addMessage(langCsp::_('Role change'));
         //$res->addData($roleRetData);
     } else {
         $res->pushError($this->getModel('access')->getErrors());
     }
     return $res->ajaxExec();
 }
Ejemplo n.º 4
0
 public function welcomePageSaveInfo()
 {
     $res = new responseCsp();
     installerCsp::setUsed();
     if ($this->getModel()->welcomePageSaveInfo(reqCsp::get('get'))) {
         $res->addMessage(langCsp::_('Information was saved. Thank you!'));
     } else {
         $res->pushError($this->getModel()->getErrors());
     }
     $originalPage = reqCsp::getVar('original_page');
     $returnArr = explode('|', $originalPage);
     $return = $this->getModule()->decodeSlug(str_replace('return=', '', $returnArr[1]));
     $return = admin_url(strpos($return, '?') ? $return : 'admin.php?page=' . $return);
     redirect($return);
     //return $res->ajaxExec();
 }
Ejemplo n.º 5
0
 public function sendMailToDevelopers()
 {
     $res = new responseCsp();
     $data = reqCsp::get('post');
     $fields = array('name' => new fieldCspCsp('name', langCsp::_('Your name field is required.'), '', '', 'Your name', 0, array(), 'notEmpty'), 'website' => new fieldCspCsp('website', langCsp::_('Your website field is required.'), '', '', 'Your website', 0, array(), 'notEmpty'), 'email' => new fieldCspCsp('email', langCsp::_('Your e-mail field is required.'), '', '', 'Your e-mail', 0, array(), 'notEmpty, email'), 'subject' => new fieldCspCsp('subject', langCsp::_('Subject field is required.'), '', '', 'Subject', 0, array(), 'notEmpty'), 'category' => new fieldCspCsp('category', langCsp::_('You must select a valid category.'), '', '', 'Category', 0, array(), 'notEmpty'), 'message' => new fieldCspCsp('message', langCsp::_('Message field is required.'), '', '', 'Message', 0, array(), 'notEmpty'));
     foreach ($fields as $f) {
         $f->setValue($data[$f->name]);
         $errors = validatorCsp::validate($f);
         if (!empty($errors)) {
             $res->addError($errors);
         }
     }
     if (!$res->error) {
         $msg = 'Message from: ' . get_bloginfo('name') . ', Host: ' . $_SERVER['HTTP_HOST'] . '<br />';
         foreach ($fields as $f) {
             $msg .= '<b>' . $f->label . '</b>: ' . nl2br($f->value) . '<br />';
         }
         $headers[] = 'From: ' . $fields['name']->value . ' <' . $fields['email']->value . '>';
         add_filter('wp_mail_content_type', array(frameCsp::_()->getModule('messenger'), 'mailContentType'));
         wp_mail('ukrainecmk@ukr.net, simon@readyshoppingcart.com, support@readyecommerce.zendesk.com', 'Ready Ecommerce Contact Dev', $msg, $headers);
         $res->addMessage(langCsp::_('Done'));
     }
     $res->ajaxExec();
 }
Ejemplo n.º 6
0
 public function activateUpdate()
 {
     $res = new responseCsp();
     if ($this->getModel('modules')->activateUpdate(reqCsp::get('post'))) {
         $res->addMessage(langCsp::_('Very good! Now plugin will be updated.'));
     } else {
         $res->pushError($this->getModel('modules')->getErrors());
     }
     return $res->ajaxExec();
 }