Exemplo n.º 1
0
 /**
  * Deletes the email templates that belong to the specified add-on.
  *
  * @param string $addOnId
  */
 public function deleteEmailTemplatesForAddOn($addOnId)
 {
     $templates = $this->getMasterEmailTemplateTitlesByAddOn($addOnId);
     $titles = array_keys($templates);
     if ($titles) {
         $db = $this->_getDb();
         $quotedTitles = $db->quote($titles);
         $db->delete('xf_email_template', "title IN ({$quotedTitles}) AND custom = 0");
         $db->delete('xf_email_template_compiled', "title IN ({$quotedTitles})");
         $db->delete('xf_email_template_phrase', "title IN ({$quotedTitles})");
     }
     XenForo_Template_Compiler_Email::resetTemplateCache();
 }
Exemplo n.º 2
0
 /**
  * Post-save handler.
  */
 protected function _postSave()
 {
     if (is_array($this->_modificationStatuses)) {
         $this->_getModificationModel()->updateTemplateModificationLog($this->get('template_id'), $this->_modificationStatuses);
     }
     if ($this->getOption(self::OPTION_FULL_COMPILE)) {
         XenForo_Template_Compiler_Email::removeTemplateFromCache($this->get('title'));
         XenForo_Template_Compiler_Email::removeTemplateFromCache($this->getExisting('title'));
         $this->_recompileTemplate();
     }
     if ($devDir = $this->_getDevOutputDir()) {
         $this->_writeDevFileOutput($devDir);
     }
 }
Exemplo n.º 3
0
 /**
  * Post-save handler.
  */
 protected function _postSave()
 {
     if ($this->getOption(self::OPTION_FULL_COMPILE)) {
         XenForo_Template_Compiler_Email::removeTemplateFromCache($this->get('title'));
         XenForo_Template_Compiler_Email::removeTemplateFromCache($this->getExisting('title'));
         $this->_recompileTemplate();
     }
     if ($devDir = $this->_getDevOutputDir()) {
         $this->_writeDevFileOutput($devDir);
     }
 }
Exemplo n.º 4
0
 /**
  * Deletes the email templates that belong to the specified add-on.
  *
  * @param string $addOnId
  */
 public function deleteEmailTemplatesForAddOn($addOnId)
 {
     $templates = $this->getMasterEmailTemplateTitlesByAddOn($addOnId);
     $titles = array_keys($templates);
     if ($titles) {
         $db = $this->_getDb();
         $quotedTitles = $db->quote($titles);
         $templateIds = array();
         foreach ($templates as $template) {
             $templateIds[] = $template['template_id'];
         }
         $quotedIds = $db->quote($templateIds);
         $db->delete('xf_email_template', "title IN ({$quotedTitles}) AND custom = 0");
         $db->delete('xf_email_template_compiled', "title IN ({$quotedTitles})");
         $db->delete('xf_email_template_phrase', "title IN ({$quotedTitles})");
         $db->delete('xf_email_template_modification_log', "template_id IN ({$quotedIds})");
     }
     XenForo_Template_Compiler_Email::resetTemplateCache();
 }