本文整理汇总了PHP中EmailTemplate::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailTemplate::delete方法的具体用法?PHP EmailTemplate::delete怎么用?PHP EmailTemplate::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailTemplate
的用法示例。
在下文中一共展示了EmailTemplate::delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action
public function action()
{
$checked = @array_keys($_POST['items']);
if (is_array($checked) && !empty($checked)) {
if ($_POST['with-selected'] == 'delete') {
foreach ($checked as $id) {
EmailTemplate::delete($id);
}
}
}
redirect(extension_members::baseURL() . 'email_templates/');
}
示例2: action
public function action()
{
$email_template_id = $this->_context[0];
$fields = $_POST['fields'];
if (isset($_POST['action']['delete'])) {
EmailTemplate::delete($email_template_id);
redirect(extension_members::baseURL() . 'email_templates/');
} elseif (isset($_POST['action']['save'])) {
$et = EmailTemplate::loadFromID($email_template_id);
$et->removeAllRoles();
$et->subject = $fields['subject'];
$et->type = $fields['type'];
$et->body = $fields['body'];
if (isset($fields['roles']) && strlen(trim($fields['roles'])) > 0) {
$roles = preg_split('/\\s*,\\s*/i', $fields['roles'], -1, PREG_SPLIT_NO_EMPTY);
foreach ($roles as $r) {
$et->addRoleFromName($r);
}
}
EmailTemplate::save($et);
redirect(extension_members::baseURL() . 'email_templates_edit/' . $et->id . '/saved/');
}
}
示例3: array
$ajaxResult = array();
if ($template_id == $id_to_show_if_new) {
$obj->create($name, $info, $info_technical, $default_languages_id);
$ajaxResult['id'] = is_null($obj->id) ? '0' : $obj->id;
$ajaxResult['action'] = $id_to_show_if_new;
} else {
$obj->update($name, $info, $info_technical, $default_languages_id);
$ajaxResult['id'] = $template_id;
$ajaxResult['action'] = 'UPDATED';
}
echo ajaxReturn($ajaxResult);
exit;
} elseif ($_POST['me_action'] == 'DELETEDATA') {
$template_id = tep_db_prepare_input($_POST['template_id']);
if ($template_id != $id_to_show_if_new && $template_id == $obj->id) {
$obj->delete();
}
echo is_null($obj->id) ? '1' : '0';
exit;
} elseif ($_POST['me_action'] == 'ADDLANGUAGE') {
$languages_id = tep_db_prepare_input($_POST['languages_id']);
$obj->addContent($languages_id);
exit;
} elseif ($_POST['me_action'] == 'DELETELANGUAGE') {
$languages_id = tep_db_prepare_input($_POST['languages_id']);
$obj->deleteContent($languages_id);
exit;
} elseif ($_POST['me_action'] == 'SAVELANGUAGE') {
$languages_id = tep_db_prepare_input($_POST['languages_id']);
$email_subject = tep_db_prepare_input($_POST['email_subject']);
$email_content = tep_db_prepare_input($_POST['email_content']);