| @@ 164-174 (lines=11) @@ | ||
| 161 | $templateObj = $helper->getHandler('Template')->get($letter['templateid']); |
|
| 162 | $letter['template_err'] = false; |
|
| 163 | if (is_object($templateObj)) { |
|
| 164 | if ($templateObj->getVar('template_type') === _XNEWSLETTER_MAILINGLIST_TPL_FILE_VAL) { |
|
| 165 | $template_path = XOOPS_ROOT_PATH . '/modules/xnewsletter/language/' . $GLOBALS['xoopsConfig']['language'] . '/templates/'; |
|
| 166 | if (!is_dir($template_path)) { |
|
| 167 | $template_path = XOOPS_ROOT_PATH . '/modules/xnewsletter/language/english/templates/'; |
|
| 168 | } |
|
| 169 | $filename = $template_path . $templateObj->getVar('template_title') . '.tpl'; |
|
| 170 | if (!file_exists ( $filename )) { |
|
| 171 | $letter['template_err'] = true; |
|
| 172 | $letter['template_err_text'] = str_replace('%s', $template_path, _AM_XNEWSLETTER_TEMPLATE_ERR_FILE); |
|
| 173 | } |
|
| 174 | } |
|
| 175 | } else { |
|
| 176 | $letter['template_err'] = true; |
|
| 177 | $letter['template_err_text'] = _AM_XNEWSLETTER_TEMPLATE_ERR_TABLE; |
|
| @@ 109-119 (lines=11) @@ | ||
| 106 | $template = $templateObj->getValuesTemplate(); |
|
| 107 | // check whether template exist or not |
|
| 108 | $template['template_err'] = false; |
|
| 109 | if ( $templateObj->getVar('template_type') === _XNEWSLETTER_MAILINGLIST_TPL_FILE_VAL) { |
|
| 110 | $template_path = XOOPS_ROOT_PATH . '/modules/xnewsletter/language/' . $GLOBALS['xoopsConfig']['language'] . '/templates/'; |
|
| 111 | if (!is_dir($template_path)) { |
|
| 112 | $template_path = XOOPS_ROOT_PATH . '/modules/xnewsletter/language/english/templates/'; |
|
| 113 | } |
|
| 114 | $filename = $template_path . $templateObj->getVar('template_title') . '.tpl'; |
|
| 115 | if (!file_exists ( $filename )) { |
|
| 116 | $template['template_err'] = true; |
|
| 117 | $template['template_err_text'] = str_replace('%s', $template_path, _AM_XNEWSLETTER_TEMPLATE_ERR_FILE); |
|
| 118 | } |
|
| 119 | } |
|
| 120 | $GLOBALS['xoopsTpl']->append('templates_list', $template); |
|
| 121 | unset($template); |
|
| 122 | } |
|