public function doModel() { parent::doModel(); switch (Params::getParam("route")) { case mdh_current_plugin_name() . '_init': $this->init(); break; case mdh_current_plugin_name() . '_do': $this->update(); break; default: $this->show(); break; } }
/** * Adds a submenu to the Madhouse main admin menu. * (hook: admin_menu_init) */ function mdh_emailmagick_admin_init() { osc_add_admin_submenu_divider('madhouse', "EmailMagick", mdh_current_plugin_name(), 'administrator'); osc_add_admin_submenu_page('madhouse', __('Manage your emails', mdh_current_plugin_name()), mdh_emailmagick_url(), mdh_current_plugin_name(), 'administrator'); }
} else { if ($data["i_filled"] == 0) { $data["s_label_filled"] = "label label-danger"; } else { $data["s_label_filled"] = "label label-warning"; } } madhouse_render_mustache(mdh_current_plugin_name() . "_edit_email", array("datas" => $data, "active_locales" => View::newInstance()->_get("active_locales"), "edit_url" => osc_admin_base_url(true) . '?page=emails&action=edit&id=', "texts" => array("title" => __("Title", mdh_current_plugin_name()), "excerpt" => __("Excerpt", mdh_current_plugin_name()), "excerpt_help" => __("Use the {{{EXCERPT}}} keyword at the top of your template to get it displayed as the excerpt in mail clients.", mdh_current_plugin_name()), "content" => __("Content", mdh_current_plugin_name()), "done" => __("done", mdh_current_plugin_name()), "delete" => __("Delete", mdh_current_plugin_name()), "confirm_delete" => __("Are you sure you want to delete this ?", mdh_current_plugin_name()), "email_link" => __("Link to the email", mdh_current_plugin_name()), "yes" => __("Yes", mdh_current_plugin_name()), "no" => __("No", mdh_current_plugin_name())))); } ?> </div> <div class="space-out-b-xl"> <p class="row-space-0 text-justify"> <label class="label label-danger space-out-r-xs"><?php _e("Important", mdh_current_plugin_name()); ?> </label> <strong class="text-danger"><?php _e("Saving your changes will <u>overwrite each and every email</u> with the combination of the template and the content you gave (title and content) unless title or content is empty. You might want to make a backup of your database the first time if you have already have worked on your emails via the default Osclass interface.", mdh_current_plugin_name()); ?> </strong> </p> </div> <input type="submit" id="save_changes" value="<?php echo osc_esc_html(__('Save changes')); ?> " class="btn btn-primary btn-block" /> </div> </form> </div> </div>
function mdh_emailmagick_do_url() { return osc_route_admin_url(mdh_current_plugin_name() . "_do"); }