コード例 #1
1
            fn_em_delete_subscribers((array) $_REQUEST['subscriber_id']);
        }
        $suffix = '.manage';
    }
    if ($mode == 'sync') {
        EmailSync::instance()->sync();
        $suffix = '.manage';
    }
    if ($mode == 'import') {
        EmailSync::instance()->import();
        $suffix = '.manage';
    }
    return array(CONTROLLER_STATUS_OK, 'em_subscribers' . $suffix);
}
if ($mode == 'manage') {
    list($subscribers, $search) = fn_em_get_subscribers($_REQUEST, Registry::get('settings.Appearance.admin_elements_per_page'));
    // Get settings
    $em_settings = array();
    foreach (fn_em_get_managable_settings() as $option) {
        $option_data = Settings::instance()->getSettingDataByName($option);
        $em_settings[$option_data['object_id']] = $option_data;
    }
    Tygh::$app['view']->assign('em_settings', $em_settings);
    Tygh::$app['view']->assign('em_support', EmailSync::instance()->supports());
    Tygh::$app['view']->assign('subscribers', $subscribers);
    Tygh::$app['view']->assign('search', $search);
}
function fn_em_get_managable_settings()
{
    return array('em_show_on_checkout', 'em_checkout_enabled', 'em_double_opt_in', 'em_welcome_letter');
}
コード例 #2
0
ファイル: Subscribers.php プロジェクト: heg-arc-ne/cscart
 public function index($id = 0, $params = array())
 {
     if (empty($id)) {
         list($subscribers, $search) = fn_em_get_subscribers($params, Registry::get('settings.Appearance.admin_elements_per_page'));
         $data['subscribers'] = $subscribers;
         $data['params'] = $search;
     } else {
         list($data, $search) = fn_em_get_subscribers(array('subscriber_id' => $id), Registry::get('settings.Appearance.admin_elements_per_page'));
         if (!empty($data)) {
             $data = array_pop($data);
         }
     }
     if (empty($data)) {
         $status = Response::STATUS_NOT_FOUND;
     } else {
         $status = Response::STATUS_OK;
     }
     return array('status' => $status, 'data' => $data);
 }