예제 #1
0
 public function __construct()
 {
     parent::__construct($this->name);
     $this->EE->load->library('postmaster_lib');
     $this->lib = $this->EE->postmaster_lib;
 }
예제 #2
0
 public function __construct()
 {
     parent::__construct();
     $this->basepath = PATH_THIRD . 'postmaster/delegates/';
     $this->suffix = '_postmaster_delegate';
 }
예제 #3
0
 public function __construct()
 {
     parent::__construct($this->name);
 }
예제 #4
0
 public function index()
 {
     $this->EE->theme_loader->javascript('postmaster');
     $this->EE->theme_loader->javascript('qtip');
     $this->EE->theme_loader->css('qtip');
     require_once PATH_THIRD . 'postmaster/libraries/Postmaster_base_delegate.php';
     $delegate = new Postmaster_base_delegate();
     $delegate->suffix = '_postmaster_delegate';
     $delegate->basepath = PATH_THIRD . 'postmaster/delegates/';
     $hooks = $this->EE->postmaster_model->get_hooks()->result_array();
     foreach ($hooks as $index => $value) {
         $hooks[$index]['edit_url'] = $this->cp_url('hook') . '&id=' . $value['id'];
         $hooks[$index]['delete_url'] = $this->cp_url('delete_hook_action') . '&id=' . $value['id'];
         $hooks[$index]['duplicate_url'] = $this->cp_url('duplicate_hook_action') . '&id=' . $value['id'];
         $hooks[$index] = (object) $hooks[$index];
     }
     $tasks = $this->EE->postmaster_model->get_tasks()->result_array();
     foreach ($tasks as $index => $value) {
         $tasks[$index]['edit_url'] = $this->cp_url('task') . '&id=' . $value['id'];
         $tasks[$index]['delete_url'] = $this->cp_url('delete_task_action') . '&id=' . $value['id'];
         $tasks[$index]['duplicate_url'] = $this->cp_url('duplicate_task_action') . '&id=' . $value['id'];
         $tasks[$index]['ping_url'] = (int) $value['enable_cron'] == 1 ? $this->current_url('ACT', $this->EE->channel_data->get_action_id(__CLASS__, 'task_action')) . '&id=' . $value['id'] : 'N/A';
         $tasks[$index] = (object) $tasks[$index];
     }
     $notifications = $this->EE->postmaster_model->get_notifications()->result_array();
     foreach ($notifications as $index => $value) {
         $notifications[$index]['edit_url'] = $this->cp_url('notification') . '&id=' . $value['id'];
         $notifications[$index]['delete_url'] = $this->cp_url('delete_notification_action') . '&id=' . $value['id'];
         $notifications[$index]['duplicate_url'] = $this->cp_url('duplicate_notification_action') . '&id=' . $value['id'];
         $notifications[$index]['ping_url'] = $this->current_url('ACT', $this->EE->channel_data->get_action_id(__CLASS__, 'notification_action')) . '&id=' . $value['id'];
         $notifications[$index] = (object) $notifications[$index];
     }
     $vars = array('theme_url' => $this->EE->theme_loader->theme_url(), 'themes' => $this->themes, 'parcels' => $this->EE->postmaster_model->get_parcels(), 'hooks' => $hooks, 'tasks' => $tasks, 'notifications' => $notifications, 'create_parcel_url' => $this->cp_url('create_template'), 'add_hook_url' => $this->cp_url('hook'), 'add_task_url' => $this->cp_url('task'), 'edit_hook_action' => $this->current_url('ACT', $this->EE->channel_data->get_action_id(__CLASS__, 'edit_hook_action')), 'add_notification_url' => $this->cp_url('notification'), 'edit_hook_action' => $this->current_url('ACT', $this->EE->channel_data->get_action_id(__CLASS__, 'edit_notification_action')), 'delegates' => $delegate->get_delegates(FALSE, PATH_THIRD . 'postmaster/delegates'), 'doctag_url' => $this->cp_url('doctag'), 'ping_url' => $this->current_url('ACT', $this->EE->channel_data->get_action_id(__CLASS__, 'send_email')), 'lang' => array('documentation' => lang('postmaster_documentation')));
     if (version_compare(APP_VER, '2.6.0', '<')) {
         $this->EE->cp->set_variable('cp_page_title', $this->EE->lang->line('postmaster_module_name'));
     } else {
         $this->EE->view->cp_page_title = $this->EE->lang->line('postmaster_module_name');
     }
     $this->EE->cp->set_right_nav(array('postmaster_documentation' => $this->cp_url('doctag') . '&id=Core'));
     return $this->EE->load->view('index', $vars, TRUE);
 }