Example #1
0
 public static function get_instance()
 {
     if (self::$instance == null) {
         self::$instance = new AE_Options('et_options');
     }
     return self::$instance;
 }
function ae_payu_add_settings($pages)
{
    $sections = array();
    $options = AE_Options::get_instance();
    // $api_link = " <a class='find-out-more' target='_blank' href='https://dashboard.paymill.com/account/apikeys' >" . __("Find out more", ET_DOMAIN) . " <span class='icon' data-icon='i' ></span></a>";
    /**
     * ae fields settings
     */
    $sections = array('args' => array('title' => __("PayuMoney API", ET_DOMAIN), 'id' => 'payu_field', 'icon' => 'F', 'class' => ''), 'groups' => array(array('args' => array('title' => __("PayuMoney API", ET_DOMAIN), 'id' => 'payu-secret-key', 'class' => '', 'desc' => __('for test mode <b>Merchant ID: JBZaLc | SALT: GQs7yium</b>', ET_DOMAIN), 'name' => 'payu'), 'fields' => array(array('id' => 'payu_Merchant_ID', 'type' => 'text', 'label' => __("Merchant ID PayuMoney", ET_DOMAIN), 'name' => 'payu_merchan_ID', 'class' => ''), array('id' => 'payu_salt', 'type' => 'text', 'label' => __("Salt Key PayuMoney", ET_DOMAIN), 'name' => 'payu_salt', 'class' => '')))));
    $temp = new AE_section($sections['args'], $sections['groups'], $options);
    $payu_setting = new AE_container(array('class' => 'field-settings', 'id' => 'settings'), $temp, $options);
    $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('PayuMoney', ET_DOMAIN), 'menu_title' => __('PAYUMONEY', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'ae-payu', 'icon' => '$', 'icon_class' => 'fa fa-inr', 'desc' => __("Integrate the PayU payment gateway to your site", ET_DOMAIN)), 'container' => $payu_setting);
    return $pages;
}
function ae_ppdigital_add_settings($pages)
{
    $sections = array();
    $options = AE_Options::get_instance();
    $api_link = " <a class='find-out-more' target='_blank' href='https://dashboard.ppdigital.com/account/apikeys' >" . __("Find out more", ET_DOMAIN) . " <span class='icon' data-icon='i' ></span></a>";
    /**
     * ae fields settings
     */
    $sections = array('args' => array('title' => __("Paypal Digital Goods API", ET_DOMAIN), 'id' => 'meta_field', 'icon' => 'F', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Paypal Digital Goods API", ET_DOMAIN), 'id' => 'ppdigital-key', 'class' => '', 'desc' => __('The Paypal Digital Goods API by providing one of your API keys in the request.', ET_DOMAIN), 'name' => 'ppdigital'), 'fields' => array(array('id' => 'Title', 'type' => 'text', 'label' => __("Title", ET_DOMAIN), 'name' => 'title', 'class' => '', 'default' => __("Papal DG", ET_DOMAIN)), array('id' => 'Description', 'type' => 'text', 'label' => __("Description", ET_DOMAIN), 'name' => 'desc', 'class' => '', 'default' => __("Send your payment to our Paypal account", ET_DOMAIN)), array('id' => 'username', 'type' => 'text', 'label' => __("Username", ET_DOMAIN), 'name' => 'username', 'class' => ''), array('id' => 'password', 'type' => 'text', 'label' => __("Password", ET_DOMAIN), 'name' => 'password', 'class' => ''), array('id' => 'signature', 'type' => 'text', 'label' => __("Signature", ET_DOMAIN), 'name' => 'signature', 'class' => '')))));
    $temp = new AE_section($sections['args'], $sections['groups'], $options);
    $ppdigital_setting = new AE_container(array('class' => 'field-settings', 'id' => 'settings'), $temp, $options);
    $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Paypal Digital Goods Settings', ET_DOMAIN), 'menu_title' => __('PAYPAL DIGITAL', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'ae-ppdigital', 'icon' => '$', 'desc' => __("Integrate the Paypal Digital Goods payment gateway to your site", ET_DOMAIN)), 'container' => $ppdigital_setting);
    return $pages;
}
Example #4
0
function ae_paymill_add_settings($pages)
{
    $sections = array();
    $options = AE_Options::get_instance();
    // $api_link = " <a class='find-out-more' target='_blank' href='https://dashboard.paymill.com/account/apikeys' >" . __("Find out more", ET_DOMAIN) . " <span class='icon' data-icon='i' ></span></a>";
    /**
     * ae fields settings
     */
    $sections = array('args' => array('title' => __("Paymill API", ET_DOMAIN), 'id' => 'paymill_field', 'icon' => 'F', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Paymill API", ET_DOMAIN), 'id' => 'paymill-secret-key', 'class' => '', 'desc' => __('The Paymill API by providing one of your API keys in the request.', ET_DOMAIN), 'name' => 'paymill'), 'fields' => array(array('id' => 'paymill_secret_key', 'type' => 'text', 'label' => __("Private Key", ET_DOMAIN), 'name' => 'private_key', 'class' => ''), array('id' => 'paymill_publishable_key', 'type' => 'text', 'label' => __("Public Key", ET_DOMAIN), 'name' => 'public_key', 'class' => '')))));
    $temp = new AE_section($sections['args'], $sections['groups'], $options);
    $paymill_setting = new AE_container(array('class' => 'field-settings', 'id' => 'settings'), $temp, $options);
    $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Paymill', ET_DOMAIN), 'menu_title' => __('PAYMILL', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'ae-paymill', 'icon' => '$', 'desc' => __("Integrate the Paymill payment gateway to your site", ET_DOMAIN)), 'container' => $paymill_setting);
    return $pages;
}
Example #5
0
function fre_escrow_settings($pages)
{
    $options = AE_Options::get_instance();
    $sections = array();
    $sections[] = array('args' => array('title' => __("Settings", ET_DOMAIN), 'id' => 'escrow-settings', 'icon' => 'y', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Using Escrow", ET_DOMAIN), 'id' => 'use-escrow', 'class' => '', 'desc' => __("Enabling this will activate the Escrow system.", ET_DOMAIN)), 'fields' => array(array('id' => 'use_escrow', 'type' => 'switch', 'title' => __("use escrow", ET_DOMAIN), 'name' => 'use_escrow', 'class' => ''))), array('args' => array('title' => __("Commission", ET_DOMAIN), 'id' => 'commission-amount', 'class' => '', 'desc' => __("Decide the amount of commission to be paid for using the service.", ET_DOMAIN)), 'fields' => array(array('id' => 'commission', 'type' => 'text', 'title' => __("commission", ET_DOMAIN), 'name' => 'commission', 'class' => ''))), array('args' => array('title' => __("Commission type", ET_DOMAIN), 'id' => 'commission-type', 'class' => '', 'desc' => __("Select the type of commission you want to use.", ET_DOMAIN)), 'fields' => array(array('id' => 'commission_type', 'type' => 'select', 'title' => __("commission", ET_DOMAIN), 'name' => 'commission_type', 'class' => '', 'data' => array('percent' => __("By percentage", ET_DOMAIN), 'currency' => __("By specific amount", ET_DOMAIN))))), array('args' => array('title' => __("Payer of commission", ET_DOMAIN), 'id' => 'commision-fees', 'class' => '', 'desc' => __("Select the user role to pay for the commission.", ET_DOMAIN)), 'fields' => array(array('id' => 'payer_of_commission', 'type' => 'select', 'title' => __("Payer of fees", ET_DOMAIN), 'name' => 'payer_of_commission', 'class' => '', 'data' => array('project_owner' => __("Project owner", ET_DOMAIN), 'worker' => __("Freelancer", ET_DOMAIN))))), array('args' => array('title' => __("Manual Transfer", ET_DOMAIN), 'id' => 'manual_transfer-escrow', 'class' => '', 'desc' => __("Enabling this will allow you to manually transfer the money when the project's completed.", ET_DOMAIN)), 'fields' => array(array('id' => 'manual_transfer', 'type' => 'switch', 'title' => __("Manual Transfer", ET_DOMAIN), 'name' => 'manual_transfer', 'class' => '')))));
    $api_link = " <a class='find-out-more' target='_blank' href='https://developer.paypal.com/docs/classic/api/apiCredentials/' >" . __("Find out more", ET_DOMAIN) . " <span class='icon' data-icon='i' ></span></a>";
    $sections[] = array('args' => array('title' => __("Gateways", ET_DOMAIN), 'id' => 'escrow-gateways', 'icon' => '$', 'class' => 'payment-gateways'), 'groups' => array(array('args' => array('title' => __("Payment Test Mode", ET_DOMAIN), 'id' => 'payment-test-mode', 'class' => 'payment-test-mode', 'desc' => __("Enabling this will allow you to test payment without charging your account.", ET_DOMAIN)), 'fields' => array(array('id' => 'test-mode', 'type' => 'switch', 'title' => __("Align", ET_DOMAIN), 'name' => 'test_mode', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Paypal Settings", ET_DOMAIN), 'id' => 'use-escrow-paypal', 'class' => '', 'name' => 'escrow_paypal', 'desc' => __("Use Paypal Adaptive API to setup escrow system.", ET_DOMAIN) . $api_link), 'fields' => array(array('id' => 'use_escrow_paypal', 'type' => 'text', 'label' => __("Your paypal business email", ET_DOMAIN), 'name' => 'business_mail', 'class' => ''), array('id' => 'paypal_fee', 'type' => 'select', 'title' => __("Paypal fees", ET_DOMAIN), 'label' => __("Paypal fees", ET_DOMAIN), 'name' => 'paypal_fee', 'class' => '', 'data' => array('PRIMARYRECEIVER' => __("Primary receiver pays all fees", ET_DOMAIN), 'EACHRECEIVER' => __("Each receiver pays their own fee", ET_DOMAIN), 'SECONDARYONLY' => __("Secondary receivers pay all fees", ET_DOMAIN))))), array('args' => array('title' => __("Paypal API", ET_DOMAIN), 'id' => 'use-escrow-paypal', 'class' => '', 'name' => 'escrow_paypal_api'), 'fields' => array(array('id' => 'username', 'type' => 'text', 'name' => 'username', 'label' => __("Your paypal API username", ET_DOMAIN), 'class' => ''), array('id' => 'password', 'type' => 'text', 'label' => __("Your paypal API password", ET_DOMAIN), 'name' => 'password', 'class' => ''), array('id' => 'signature', 'type' => 'text', 'label' => __("Your paypal API signature", ET_DOMAIN), 'name' => 'signature', 'class' => ''), array('id' => 'appID', 'type' => 'text', 'label' => __("Your Paypal Adaptive AppID", ET_DOMAIN), 'name' => 'appID', 'class' => '')))));
    $temp = array();
    foreach ($sections as $key => $section) {
        $temp[] = new AE_section($section['args'], $section['groups'], $options);
    }
    $orderlist = new AE_container(array('class' => 'escrow-settings', 'id' => 'settings'), $temp, $options);
    $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Escrow', ET_DOMAIN), 'menu_title' => __('ESCROW CONFIGURATION', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'fre-escrow', 'icon' => '%', 'desc' => __("Setting up a trustworthy environment for freelancers and employers.", ET_DOMAIN)), 'container' => $orderlist);
    return $pages;
}
 /**
  * get a package by sku
  */
 public function get($sku)
 {
     $options = AE_Options::get_instance();
     $option_name = $this->option_name;
     if ($options->{$option_name}) {
         $this->fetch();
     }
     if ($options->{$option_name}) {
         $packages = $options->{$option_name};
         foreach ($packages as $key => $value) {
             if ($value->sku == $sku) {
                 return $value;
             }
         }
     }
     return false;
 }
Example #7
0
function ae_fields_menu($pages)
{
    $sections = array();
    $options = AE_Options::get_instance();
    /**
     * ae fields settings
     */
    $sections[] = array('args' => array('title' => __("Meta Fields", ET_DOMAIN), 'id' => 'meta_field', 'icon' => 'F', 'class' => ''), 'groups' => array(array('type' => 'field_list', 'args' => array('title' => __("Fields List", ET_DOMAIN), 'id' => 'list-field', 'class' => 'list-package', 'desc' => '', 'name' => 'ae_field', 'custom_field' => 'meta'), 'fields' => array('form' => plugin_dir_path(__FILE__) . '/settings-template/field-form.php', 'form_js' => plugin_dir_path(__FILE__) . '/settings-template/field-form-js.php', 'js_template' => plugin_dir_path(__FILE__) . '/settings-template/package-js-item.php', 'template' => plugin_dir_path(__FILE__) . '/settings-template/package-item.php'))));
    /**
     * ae fields settings
     */
    $sections[] = array('args' => array('title' => __("Taxonomies", ET_DOMAIN), 'id' => 'tax_field', 'icon' => 'z', 'class' => ''), 'groups' => array(array('type' => 'field_list', 'args' => array('title' => __("Taxonomies Lists", ET_DOMAIN), 'id' => 'list-tax', 'class' => 'list-tax', 'desc' => '', 'name' => 'ae_field', 'custom_field' => 'tax'), 'fields' => array('form' => plugin_dir_path(__FILE__) . '/settings-template/tax-form.php', 'form_js' => plugin_dir_path(__FILE__) . '/settings-template/tax-form-js.php', 'js_template' => plugin_dir_path(__FILE__) . '/settings-template/package-js-item.php', 'template' => plugin_dir_path(__FILE__) . '/settings-template/package-item.php'))));
    foreach ($sections as $key => $section) {
        $temp[] = new AE_section($section['args'], $section['groups'], $options);
    }
    $orderlist = new AE_container(array('class' => 'field-settings', 'id' => 'settings'), $temp, $options);
    $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Custom Fields', ET_DOMAIN), 'menu_title' => __('CUSTOM FIELDS', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'ae-fields', 'icon' => 'x', 'desc' => __("Easily add custom fields for your content", ET_DOMAIN)), 'container' => $orderlist);
    return $pages;
}
Example #8
0
function ae_social_login_settings($pages)
{
    $options = AE_Options::get_instance();
    $sections = array();
    /**
     * social settings section
     */
    $user_roles = ae_social_auth_support_role();
    $authentication_page = ae_get_social_connect_page_link();
    $default_role = ae_get_social_login_user_roles_default();
    $sections[] = array('args' => array('title' => __("Social API", ET_DOMAIN), 'id' => 'social-settings', 'icon' => 'B', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Twitter API", ET_DOMAIN), 'id' => 'twitter-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via Twitter.", ET_DOMAIN)), 'fields' => array(array('id' => 'twitter_login', 'type' => 'switch', 'title' => __("Twitter API ", ET_DOMAIN), 'name' => 'twitter_login', 'class' => ''), array('id' => 'et_twitter_key', 'type' => 'text', 'title' => __("Twitter key ", ET_DOMAIN), 'name' => 'et_twitter_key', 'placeholder' => __("Twitter Consumer Key", ET_DOMAIN), 'class' => ''), array('id' => 'et_twitter_secret', 'type' => 'text', 'title' => __("Twitter secret ", ET_DOMAIN), 'name' => 'et_twitter_secret', 'placeholder' => __("Twitter Consumer Secret", ET_DOMAIN), 'class' => ''))), array('args' => array('title' => __("Facebook API", ET_DOMAIN), 'id' => 'facebook-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via Facebook.", ET_DOMAIN)), 'fields' => array(array('id' => 'facebook_login', 'type' => 'switch', 'title' => __("Facebook API ", ET_DOMAIN), 'name' => 'facebook_login', 'class' => ''), array('id' => 'et_facebook_key', 'type' => 'text', 'title' => __("Facebook key ", ET_DOMAIN), 'name' => 'et_facebook_key', 'placeholder' => __("Facebook Application ID", ET_DOMAIN), 'class' => ''), array('id' => 'et_facebook_secret_key', 'type' => 'text', 'title' => __("Facebook secret key ", ET_DOMAIN), 'name' => 'et_facebook_secret_key', 'placeholder' => __("Facebook Secret Key", ET_DOMAIN), 'class' => ''))), array('args' => array('title' => __("Google API", ET_DOMAIN), 'id' => 'google-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via Google.", ET_DOMAIN)), 'fields' => array(array('id' => 'gplus_login', 'type' => 'switch', 'title' => __("Google API ", ET_DOMAIN), 'name' => 'gplus_login', 'class' => ''), array('id' => 'gplus_client_id', 'type' => 'text', 'title' => __("Google key ", ET_DOMAIN), 'name' => 'gplus_client_id', 'placeholder' => __("Client ID", ET_DOMAIN), 'class' => ''), array('id' => 'gplus_secret_id', 'type' => 'text', 'title' => __("Google Secret key ", ET_DOMAIN), 'name' => 'gplus_secret_id', 'placeholder' => __("Google secret key", ET_DOMAIN), 'class' => ''))), array('args' => array('title' => __("LinkedIn API", ET_DOMAIN), 'id' => 'linkedin-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via LinkedIn.", ET_DOMAIN)), 'fields' => array(array('id' => 'linkedin_login', 'type' => 'switch', 'title' => __("LinkedIn API ", ET_DOMAIN), 'name' => 'linkedin_login', 'class' => ''), array('id' => 'linkedin_api_key', 'type' => 'text', 'title' => __("Consumer Key / API Key ", ET_DOMAIN), 'name' => 'linkedin_api_key', 'placeholder' => __("LinkedIn API Key", ET_DOMAIN), 'class' => ''), array('id' => 'linkedin_secret_key', 'type' => 'text', 'title' => __("Consumer Secret / Secret Key ", ET_DOMAIN), 'name' => 'linkedin_secret_key', 'placeholder' => __("LinkedIn secret key", ET_DOMAIN), 'class' => '')))));
    /**
     * social settings section
     */
    $sections[] = array('args' => array('title' => __("General setting", ET_DOMAIN), 'id' => 'social-page-settings', 'icon' => 'y', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Social connect page", ET_DOMAIN), 'id' => 'social-connect', 'class' => '', 'desc' => __("You can create a new page and paste shortcode [social_connect_page] here", ET_DOMAIN)), 'fields' => array(array('id' => 'social_connect', 'type' => 'text', 'title' => __("Social connect page url ", ET_DOMAIN), 'name' => 'social_connect', 'placeholder' => __("eg:http://enginethemes.com/directoryengine/social-connect", ET_DOMAIN), 'class' => '', 'default' => $authentication_page))), array('args' => array('title' => __("Select User roles", ET_DOMAIN), 'id' => 'user_roles', 'class' => '', 'desc' => __("Select the user roles.", ET_DOMAIN)), 'fields' => array(array('id' => 'user-roles', 'type' => 'multi_select', 'data' => $user_roles, 'title' => __("Select user roles", ET_DOMAIN), 'name' => 'social_user_role', 'class' => 'option-item bg-grey-input ', 'placeholder' => __("Select user roles", ET_DOMAIN), 'label' => __("Select user roles", ET_DOMAIN), 'default' => $default_role)))));
    $temp = array();
    foreach ($sections as $key => $section) {
        $temp[] = new AE_section($section['args'], $section['groups'], $options);
    }
    $orderlist = new AE_container(array('class' => 'social-login-settings', 'id' => 'settings'), $temp, $options);
    $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Social login', ET_DOMAIN), 'menu_title' => __('SOCIAL LOGIN', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'ae-social-login', 'icon' => 'B', 'desc' => __("setup a way for users to login via their socile network accounts", ET_DOMAIN)), 'container' => $orderlist);
    return $pages;
}
Example #9
0
/**
 * get site current currency sign (icon)
 * @param $echo bool
 * @author Dakachi
 */
function ae_currency_align($echo = true)
{
    // get option instance to retrieve option value
    $options = AE_Options::get_instance();
    if ($echo) {
        echo $options->currency['align'];
    } else {
        return $options->currency['align'];
    }
}
Example #10
0
 /**
  * get payment mode setting
  * return bool : true : test, false is real
  */
 public static function get_payment_test_mode()
 {
     $options = AE_Options::get_instance();
     return $options->test_mode;
 }
 /**
  * static function to load text domain,
  * it should be call by add_action ('after_setup_theme', array ('AE_Language', 'load_text_domain'));
  * @since 1.0
  */
 public static function load_text_domain()
 {
     //load mo file and localize
     $options = AE_Options::get_instance();
     $selected_lang = $options->website_language;
     if (in_array($selected_lang, get_available_languages(THEME_LANGUAGE_PATH))) {
         load_textdomain(ET_DOMAIN, THEME_LANGUAGE_PATH . "/{$selected_lang}.mo");
     } else {
         load_textdomain(ET_DOMAIN, DEFAULT_LANGUAGE_PATH . "/{$selected_lang}.mo");
     }
 }
Example #12
0
/**
 * get theme option
 * @param $name the name of option
 * @return $option_value
 * @author Dakachi
*/
function ae_get_option($name, $default = false)
{
    $option = AE_Options::get_instance();
    return $option->{$name} ? $option->{$name} : $default;
}
Example #13
0
 /**
  * return mail header template
  */
 function get_mail_header()
 {
     $mail_header = apply_filters('ae_get_mail_header', '');
     if ($mail_header != '') {
         return $mail_header;
     }
     $logo_url = get_template_directory_uri() . "/img/logo-de.png";
     $options = AE_Options::get_instance();
     // save this setting to theme options
     $site_logo = $options->site_logo;
     if (!empty($site_logo)) {
         $logo_url = $site_logo['large'][0];
     }
     $logo_url = apply_filters('ae_mail_logo_url', $logo_url);
     $customize = et_get_customization();
     $mail_header = '<html>
                     <head>              
                     </head>
                     <body style="font-family: Arial, sans-serif;font-size: 0.9em;margin: 0; padding: 0; color: #222222;">
                     <div style="margin: 0px auto; width:600px; border: 1px solid ' . $customize['background'] . '">
                         <table width="100%" cellspacing="0" cellpadding="0">
                         <tr style="background: ' . $customize['header'] . '; height: 63px; vertical-align: middle;">
                             <td style="padding: 10px 5px 10px 20px; width: 20%;">
                                 <img style="max-height: 100px" src="' . $logo_url . '" alt="' . get_option('blogname') . '">
                             </td>
                             <td style="padding: 10px 20px 10px 5px">
                                 <span style="text-shadow: 0 0 1px #151515; color: #b0b0b0;">' . get_option('blogdescription') . '</span>
                             </td>
                         </tr>
                         <tr><td colspan="2" style="height: 5px; background-color: ' . $customize['background'] . ';"></td></tr>
                         <tr>
                             <td colspan="2" style="background: #ffffff; color: #222222; line-height: 18px; padding: 10px 20px;">';
     return $mail_header;
 }
 function do_checkout(ET_Order $order)
 {
     global $ae_post_factory, $user_ID;
     /**
      * check session
      */
     $session = et_read_session();
     $ad_id = isset($session['ad_id']) ? $session['ad_id'] : '';
     if ($ad_id) {
         $post = get_post($ad_id);
         // ad id existed
         /**
          * get object by post type and convert
          */
         $post_obj = $ae_post_factory->get($post->post_type);
         $ad = $post_obj->convert($post);
         if (!is_wp_error($ad)) {
             /**
              * check user is available to use selected package
              */
             $available = AE_Package::check_use_package($ad->et_payment_package, $ad->post_author);
             if ($available) {
                 // process order data
                 $payment_return = array('ACK' => true, 'payment_type' => 'usePackage');
                 /**
                  * get user current order for package
                  */
                 $current_order = AE_Payment::get_current_order($ad->post_author, $ad->et_payment_package);
                 $order = get_post($current_order);
                 if (!$order || is_wp_error($order)) {
                     return array('ACK' => false, 'payment_type' => 'usePackage', 'msg' => __("Invalid Order or Package", ET_DOMAIN));
                 }
                 $ad_data = array();
                 $ad_data['ID'] = $ad->ID;
                 /**
                  * update ad order
                  */
                 $ad_data['et_ad_order'] = $current_order;
                 $ad_data['post_status'] = 'pending';
                 if ($order->post_status == 'publish') {
                     $options = AE_Options::get_instance();
                     $ad_data['et_paid'] = 1;
                     if (!$options->use_pending) {
                         $ad_data['post_status'] = 'publish';
                     }
                 } else {
                     $ad_data['et_paid'] = 0;
                 }
                 $ad_data['change_status'] = 'change_status';
                 $ad_data['method'] = 'update';
                 /**
                  * sync Ad data
                  */
                 $return = wp_update_post($ad_data);
                 // update post paid status
                 update_post_meta($ad->ID, 'et_paid', $ad_data['et_paid']);
                 // update post package order id
                 update_post_meta($ad->ID, 'et_ad_order', $ad_data['et_ad_order']);
                 /**
                  * update seller package quantity
                  */
                 AE_Package::update_package_data($ad->et_payment_package, $ad->post_author);
                 return $payment_return;
             }
         }
     }
     return array('ACK' => false, 'payment_type' => 'usePackage', 'msg' => __("Invalid Ad ID", ET_DOMAIN));
 }
Example #15
0
 /**
  * update branding : logo, mobile icon
  */
 function change_branding()
 {
     $res = array('success' => false, 'msg' => __('There is an error occurred', ET_DOMAIN), 'code' => 400);
     // check fileID
     if (!isset($_POST['fileID']) || empty($_POST['fileID']) || !isset($_POST['imgType']) || empty($_POST['imgType'])) {
         $res['msg'] = __('Missing image ID', ET_DOMAIN);
     } else {
         $fileID = $_POST["fileID"];
         $imgType = $_POST['imgType'];
         // check ajax nonce
         if (!check_ajax_referer($imgType . '_et_uploader', '_ajax_nonce', false)) {
             $res['msg'] = __('Security error!', ET_DOMAIN);
         } elseif (isset($_FILES[$fileID])) {
             // handle file upload
             $attach_id = et_process_file_upload($_FILES[$fileID], 0, 0, array('jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff'));
             if (!is_wp_error($attach_id)) {
                 try {
                     $attach_data = et_get_attachment_data($attach_id);
                     $options = AE_Options::get_instance();
                     // save this setting to theme options
                     $options->{$imgType} = $attach_data;
                     $options->save();
                     $res = array('success' => true, 'msg' => __('Branding image has been uploaded successfully', ET_DOMAIN), 'data' => $attach_data);
                 } catch (Exception $e) {
                     $res['msg'] = __('Error when updating settings.', ET_DOMAIN);
                 }
             } else {
                 $res['msg'] = $attach_id->get_error_message();
             }
         } else {
             $res['msg'] = __('Uploaded file not found', ET_DOMAIN);
         }
     }
     wp_send_json($res);
 }
Example #16
0
    /**
     * update admin setup
     */
    function admin_setup()
    {
        // disable admin bar for all users except admin
        if (!current_user_can('administrator') && !is_admin()) {
            show_admin_bar(false);
        }
        $sections = array();
        /**
         * general settings section
         */
        $sections['general-settings'] = array('args' => array('title' => __("General", 'admin-backend'), 'id' => 'general-settings', 'icon' => 'y', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Website Title", 'admin-backend'), 'id' => 'site-name', 'class' => '', 'desc' => __("Enter your website title.", 'admin-backend')), 'fields' => array(array('id' => 'blogname', 'type' => 'text', 'title' => __("Website Title", 'admin-backend'), 'name' => 'blogname', 'class' => 'option-item bg-grey-input'))), array('args' => array('title' => __("Website Description", 'admin-backend'), 'id' => 'site-description', 'class' => '', 'desc' => __("Enter your website description", 'admin-backend')), 'fields' => array(array('id' => 'blogdescription', 'type' => 'text', 'title' => __("Website Title", 'admin-backend'), 'name' => 'blogdescription', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Copyright", 'admin-backend'), 'id' => 'site-copyright', 'class' => '', 'desc' => __("This copyright information will appear in the footer.", 'admin-backend')), 'fields' => array(array('id' => 'copyright', 'type' => 'text', 'title' => __("Copyright", 'admin-backend'), 'name' => 'copyright', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Google Analytics Script", 'admin-backend'), 'id' => 'site-analytics', 'class' => '', 'desc' => __("Google analytics is a service offered by Google that generates detailed statistics about the visits to a website.", 'admin-backend')), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'textarea', 'title' => __("Google Analytics Script", 'admin-backend'), 'name' => 'google_analytics', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Email Confirmation ", 'admin-backend'), 'id' => 'user-confirm', 'class' => '', 'desc' => __("Enabling this will require users to confirm their email addresses after registration.", 'admin-backend')), 'fields' => array(array('id' => 'user_confirm', 'type' => 'switch', 'title' => __("Email Confirmation", 'admin-backend'), 'name' => 'user_confirm', 'class' => ''))), array('args' => array('title' => __("Login in admin panel", 'admin-backend'), 'id' => 'login_init', 'class' => '', 'desc' => __("Prevent directly login to admin page.", 'admin-backend')), 'fields' => array(array('id' => 'login-init', 'type' => 'switch', 'label' => __("Enable this option will prevent directly login to admin page.", 'admin-backend'), 'name' => 'login_init', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Social Links", 'admin-backend'), 'id' => 'Social-Links', 'class' => 'Social-Links', 'desc' => __("Social links are displayed in the footer and in your blog sidebar..", 'admin-backend')), 'fields' => array()), array('args' => array('title' => __("Twitter URL", 'admin-backend'), 'id' => 'site-twitter', 'class' => 'payment-gateway'), 'fields' => array(array('id' => 'site-twitter', 'type' => 'text', 'title' => __("Twitter URL", 'admin-backend'), 'name' => 'site_twitter', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Facebook URL", 'admin-backend'), 'id' => 'site-facebook', 'class' => 'payment-gateway'), 'fields' => array(array('id' => 'site-facebook', 'type' => 'text', 'title' => __("Copyright", 'admin-backend'), 'name' => 'site_facebook', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Google Plus URL", 'admin-backend'), 'id' => 'site-google', 'class' => 'payment-gateway'), 'fields' => array(array('id' => 'site-google', 'type' => 'text', 'title' => __("Google Plus URL", 'admin-backend'), 'name' => 'site_google', 'class' => 'option-item bg-grey-input ')))));
        /**
         * branding section
         */
        $sections['branding'] = array('args' => array('title' => __("Branding", 'admin-backend'), 'id' => 'branding-settings', 'icon' => 'b', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Site logo ", 'admin-backend'), 'id' => 'site-logo-black', 'class' => '', 'name' => '', 'desc' => __("Your logo should be in PNG, GIF or JPG format, within 150x50px and less than 1500Kb.", 'admin-backend')), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Site Logo", 'admin-backend'), 'name' => 'site_logo_black', 'class' => '', 'size' => array('143', '29')))), array('args' => array('title' => __("Site logo in front page", 'admin-backend'), 'id' => 'site-logo-while', 'class' => '', 'name' => '', 'desc' => __("Your logo should be in PNG, GIF or JPG format, within 150x50px and less than 1500Kb.", 'admin-backend')), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Site Logo while", 'admin-backend'), 'name' => 'site_logo_white', 'class' => '', 'size' => array('143', '29')))), array('args' => array('title' => __("Mobile logo", 'admin-backend'), 'id' => 'mobile-logo', 'class' => '', 'name' => '', 'desc' => __("Your logo should be in PNG, GIF or JPG format, within 150x50px and less than 1500Kb.", 'admin-backend')), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Mobile Logo", 'admin-backend'), 'name' => 'mobile_logo', 'class' => '', 'size' => array('150', '50')))), array('args' => array('title' => __("Mobile Icon", 'admin-backend'), 'id' => 'mobile-icon', 'class' => '', 'name' => '', 'desc' => __("This icon will be used as a launcher icon for iPhone and Android smartphones and also as the website favicon. The image dimensions should be 57x57px.", 'admin-backend')), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Mobile Icon", 'admin-backend'), 'name' => 'mobile_icon', 'class' => '', 'size' => array('57', '57')))), array('args' => array('title' => __("User default logo & avtar", 'admin-backend'), 'id' => 'default-logo', 'class' => '', 'name' => '', 'desc' => __("Your logo should be in PNG, GIF or JPG format, within 150x50px and less than 1500Kb.", 'admin-backend')), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("User default logo & avtar", 'admin-backend'), 'name' => 'default_avatar', 'class' => '', 'size' => array('150', '150'))))));
        $sections['content'] = array('args' => array('title' => __("Content", 'admin-backend'), 'id' => 'content-settings', 'icon' => 'l', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Sharing Role Capabilities", 'admin-backend'), 'id' => 'fre-share-role', 'class' => 'fre-share-role', 'desc' => __("Enabling this will make employer and freelancer have the same capabilities.", 'admin-backend')), 'fields' => array(array('id' => 'fre_share_role', 'type' => 'switch', 'title' => __("Shared Roles", 'admin-backend'), 'name' => 'fre_share_role', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Currency", 'admin-backend'), 'id' => 'content-payment-currency', 'class' => 'content-list-package', 'desc' => __("Enter currency code and sign ....", 'admin-backend'), 'name' => 'content_currency'), 'fields' => array(array('id' => 'content-currency-code', 'type' => 'text', 'title' => __("Code", 'admin-backend'), 'name' => 'code', 'placeholder' => __("Code", 'admin-backend'), 'class' => 'option-item bg-grey-input '), array('id' => 'content-currency-code', 'type' => 'text', 'title' => __("Sign", 'admin-backend'), 'name' => 'icon', 'placeholder' => __("Sign", 'admin-backend'), 'class' => 'option-item bg-grey-input '), array('id' => 'currency-align', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'align', 'class' => 'option-item bg-grey-input ', 'label_1' => __("Left", 'admin-backend'), 'label_2' => __("Right", 'admin-backend')))), array('args' => array('title' => __("Budget limitation", 'admin-backend'), 'id' => 'pending-post', 'class' => 'pending-post', 'desc' => __("Set up the limitation for the 'Budget' filter in 'Projects' page.", 'admin-backend')), 'fields' => array(array('id' => 'fre-slide-max-budget', 'type' => 'text', 'title' => __("Slide max budget", 'admin-backend'), 'name' => 'fre_slide_max_budget', 'placeholder' => __("Slide max budget", 'admin-backend'), 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Pending Post", 'admin-backend'), 'id' => 'pending-post', 'class' => 'pending-post', 'desc' => __("Enabling this will make every new project posted pending until you review and approve it manually.", 'admin-backend')), 'fields' => array(array('id' => 'use_pending', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'use_pending', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Maximum Number of Categories", 'admin-backend'), 'id' => 'max-categories', 'class' => 'max-categories', 'desc' => __("Set a maximum number of categories a project can assign to", 'admin-backend')), 'fields' => array(array('id' => 'max_cat', 'type' => 'text', 'title' => __("Max Number Of Project Categories", 'admin-backend'), 'name' => 'max_cat', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Project Category Order", 'admin-backend'), 'id' => 'unit_measurement', 'class' => '', 'desc' => __("Order list project categories by.", 'admin-backend')), 'fields' => array(array('id' => 'order-project-category', 'type' => 'select', 'data' => array('name' => __("Name", 'admin-backend'), 'slug' => __("Slug", 'admin-backend'), 'id' => __("ID", 'admin-backend'), 'count' => __("Count", 'admin-backend')), 'title' => __("Project Category Order", 'admin-backend'), 'name' => 'project_category_order', 'class' => 'option-item bg-grey-input ', 'placeholder' => __("Project Category Order", 'admin-backend')))), array('args' => array('title' => __("Project Type Order", 'admin-backend'), 'id' => 'unit_measurement', 'class' => '', 'desc' => __("Order list project types by.", 'admin-backend')), 'fields' => array(array('id' => 'order-project-type', 'type' => 'select', 'data' => array('name' => __("Name", 'admin-backend'), 'slug' => __("Slug", 'admin-backend'), 'id' => __("ID", 'admin-backend'), 'count' => __("Count", 'admin-backend')), 'title' => __("Project Type Order", 'admin-backend'), 'name' => 'project_type_order', 'class' => 'option-item bg-grey-input ', 'placeholder' => __("Project Type Order", 'admin-backend')))), array('args' => array('title' => __("Disable Comment", 'admin-backend'), 'id' => 'disable-project-comment', 'class' => '', 'desc' => __("Disable comment on project page.", 'admin-backend')), 'fields' => array(array('id' => 'disable_project_comment', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'disable_project_comment', 'class' => 'option-item bg-grey-input ', 'label_1' => __("Yes", 'admin-backend'), 'label_2' => __("No", 'admin-backend')))), array('args' => array('title' => __("Invited To Bid", 'admin-backend'), 'id' => 'invited-to-bid', 'class' => '', 'desc' => __("If you enable this option, freelancers have to be invited first before bidding a project.", 'admin-backend')), 'fields' => array(array('id' => 'invited_to_bid', 'type' => 'switch', 'title' => __("Invited To Bid", 'admin-backend'), 'name' => 'invited_to_bid', 'class' => 'option-item bg-grey-input ', 'label_1' => __("Yes", 'admin-backend'), 'label_2' => __("No", 'admin-backend')))), array('args' => array('title' => __("Select Skill From Predefined List", 'admin-backend'), 'id' => 'switch-skill', 'class' => '', 'desc' => __("Enabling this will force user select skill from the predefined list.", 'admin-backend')), 'fields' => array(array('id' => 'switch_skill', 'type' => 'switch', 'title' => __("Switch Skill", 'admin-backend'), 'name' => 'switch_skill', 'class' => 'option-item bg-grey-input ', 'label_1' => __("Yes", 'admin-backend'), 'label_2' => __("No", 'admin-backend'))))));
        // $sections['freelancer'] = array(
        //     'args' => array(
        //         'title' => __("Freelancer", 'admin-backend') ,
        //         'id' => 'freelancer-settings',
        //         'icon' => 'U',
        //         'class' => ''
        //     ) ,
        //      //fre_share_role
        //     'groups' => array(
        //         array(
        //             'args' => array(
        //                 'title' => __("Pay to Bid", 'admin-backend') ,
        //                 'id' => 'pay-to-bid',
        //                 'class' => 'pay-to-bid',
        //                 'desc' => __("Enabling this will require freelancer pay to bid.", 'admin-backend') ,
        //             ) ,
        //             'fields' => array(
        //                 array(
        //                     'id' => 'pay_to_bid',
        //                     'type' => 'switch',
        //                     'title' => __("Pay to Bid", 'admin-backend') ,
        //                     'name' => 'pay_to_bid',
        //                     'class' => 'option-item bg-grey-input '
        //                 )
        //             )
        //         ),
        //         /**
        //          * package plan list
        //          */
        //         array(
        //             'type' => 'list',
        //             'args' => array(
        //                 'title' => __("Bid Plans", 'admin-backend') ,
        //                 'id' => 'list-package',
        //                 'class' => 'list-package',
        //                 'desc' => '',
        //                 'name' => 'bid_plan',
        //                 'custom_field' => 'bid_plan'
        //             ) ,
        //             'fields' => array(
        //                 'form' => '/admin-template/bid-plan-form.php',
        //                 'form_js' => '/admin-template/bid-plan-form-js.php',
        //                 'js_template' => '/admin-template/bid-plan-js-item.php',
        //                 'template' => '/admin-template/bid-plan-item.php'
        //             )
        //         ) ,
        //     )
        // );
        /**
         * slug settings
         */
        $sections['url_slug'] = array('args' => array('title' => __("Url slug", 'admin-backend'), 'id' => 'Url-Slug', 'icon' => 'i', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Project", 'admin-backend'), 'id' => 'project-slug', 'class' => 'list-package', 'desc' => __("Enter slug for your Single Project page", 'admin-backend')), 'fields' => array(array('id' => 'fre_project_slug', 'type' => 'text', 'title' => __("Single Project page Slug", 'admin-backend'), 'name' => 'fre_project_slug', 'placeholder' => __("Single Project page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'project'))), array('args' => array('title' => __("Project Listing", 'admin-backend'), 'id' => 'project-archive_slug', 'class' => 'list-package', 'desc' => __("Enter slug for your Projects listing page", 'admin-backend')), 'fields' => array(array('id' => 'fre_project_archive', 'type' => 'text', 'title' => __("Projects listing page Slug", 'admin-backend'), 'name' => 'fre_project_archive', 'placeholder' => __("Projects listing page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'projects'))), array('args' => array('title' => __("Project Category", 'admin-backend'), 'id' => 'Project-Category', 'class' => 'list-package', 'desc' => __("Enter slug for your Project Category page", 'admin-backend')), 'fields' => array(array('id' => 'project_category_slug', 'type' => 'text', 'title' => __("Project Category page Slug", 'admin-backend'), 'name' => 'project_category_slug', 'placeholder' => __("Project Category page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'project_category'))), array('args' => array('title' => __("Project Type", 'admin-backend'), 'id' => 'Project-Type', 'class' => 'list-package', 'desc' => __("Enter slug for your Project Type page", 'admin-backend')), 'fields' => array(array('id' => 'project_type_slug', 'type' => 'text', 'title' => __("Project Type page Slug", 'admin-backend'), 'name' => 'project_type_slug', 'placeholder' => __("Project Type page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'project_type'))), array('args' => array('title' => __("Profile", 'admin-backend'), 'id' => 'Profile-slug', 'class' => 'list-package', 'desc' => __("Enter slug for your User Profile page", 'admin-backend')), 'fields' => array(array('id' => 'fre_profile_slug', 'type' => 'text', 'title' => __("User Profile page Slug", 'admin-backend'), 'name' => 'author_base', 'placeholder' => __("User Profile page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'profile'))), array('args' => array('title' => __("Profiles Listing", 'admin-backend'), 'id' => 'profiles-archive_slug', 'class' => 'list-package', 'desc' => __("Enter slug for your Profiles listing page", 'admin-backend')), 'fields' => array(array('id' => 'fre_profile_archive', 'type' => 'text', 'title' => __(" Profiles listing page Slug", 'admin-backend'), 'name' => 'fre_profile_archive', 'placeholder' => __("Profiles listing page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'profiles'))), array('args' => array('title' => __("Country", 'admin-backend'), 'id' => 'profile-Country', 'class' => 'list-package', 'desc' => __("Enter slug for your Country tag page", 'admin-backend')), 'fields' => array(array('id' => 'country_slug', 'type' => 'text', 'title' => __("Country tag page Slug", 'admin-backend'), 'name' => 'country_slug', 'placeholder' => __("Country tag page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'country'))), array('args' => array('title' => __("Skill", 'admin-backend'), 'id' => 'profile-Skill', 'class' => 'list-package', 'desc' => __("Enter slug for your Skill tag page", 'admin-backend')), 'fields' => array(array('id' => 'skill_slug', 'type' => 'text', 'title' => __("Skill tag page Slug", 'admin-backend'), 'name' => 'skill_slug', 'placeholder' => __("Skill tag page Slug", 'admin-backend'), 'class' => 'option-item bg-grey-input ', 'default' => 'skill')))));
        /**
         * video background settings section
         */
        $sections['header_video'] = array('args' => array('title' => __("Header Video", 'admin-backend'), 'id' => 'header-settings', 'icon' => 'V', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Video Background Url", 'admin-backend'), 'id' => 'header-slider-settings', 'class' => '', 'desc' => __("Enter your video background url in page-home.php template (.mp4)", 'admin-backend')), 'fields' => array(array('id' => 'header-video', 'type' => 'text', 'title' => __("header video url", 'admin-backend'), 'name' => 'header_video', 'class' => 'option-item bg-grey-input ', 'placeholder' => __('Enter your header video url', 'admin-backend')))), array('args' => array('title' => __("Video Background Via Youtube ID", 'admin-backend'), 'id' => 'header-youtube_id', 'class' => '', 'desc' => __("Enter youtube ID for background video instead of video url", 'admin-backend')), 'fields' => array(array('id' => 'youtube_id-video', 'type' => 'text', 'title' => __("header video url", 'admin-backend'), 'name' => 'header_youtube_id', 'class' => 'option-item bg-grey-input ', 'placeholder' => __('Enter youtube video ID', 'admin-backend')))), array('args' => array('title' => __("Video Background Fallback", 'admin-backend'), 'id' => 'header-slider-settings', 'class' => '', 'desc' => __("Fallback image for video background when browser not support", 'admin-backend')), 'fields' => array(array('id' => 'header-video', 'type' => 'text', 'title' => __("header video url", 'admin-backend'), 'name' => 'header_video_fallback', 'class' => 'option-item bg-grey-input ', 'placeholder' => __('Enter your header video fallback image url', 'admin-backend')))), array('args' => array('title' => __("Project Demonstration", 'admin-backend'), 'id' => 'header-slider-settings', 'class' => '', 'name' => 'project_demonstration'), 'fields' => array(array('id' => 'header-left-text', 'type' => 'text', 'title' => __("header left text", 'admin-backend'), 'name' => 'home_page', 'class' => 'option-item bg-grey-input ', 'label' => __('Project demonstration on header video background which can be view by employer', 'admin-backend')), array('id' => 'header-right-text', 'type' => 'text', 'title' => __("header right text", 'admin-backend'), 'name' => 'list_project', 'class' => 'option-item bg-grey-input ', 'label' => __('Project demonstration on header video background which can be view by freelancer', 'admin-backend')))), array('args' => array('title' => __("Profile Demonstration", 'admin-backend'), 'id' => 'header-slider-settings', 'class' => '', 'name' => 'profile_demonstration'), 'fields' => array(array('id' => 'header-left-text', 'type' => 'text', 'title' => __("header left text", 'admin-backend'), 'name' => 'home_page', 'class' => 'option-item bg-grey-input ', 'label' => __('Profile demonstration on header video background which can be view by freelancer', 'admin-backend')), array('id' => 'header-right-text', 'type' => 'text', 'title' => __("header right text", 'admin-backend'), 'name' => 'list_profile', 'class' => 'option-item bg-grey-input ', 'label' => __('Profiles demonstration on list profiles page which can be view by employer', 'admin-backend')))), array('args' => array('title' => __("Loop Header Video", 'admin-backend'), 'id' => 'header-video-loop-option', 'class' => '', 'desc' => __(" Enabling this will make the video on the header automatically repeated.", 'admin-backend')), 'fields' => array(array('id' => 'header-video-loop', 'type' => 'switch', 'title' => __("Select video loop", 'admin-backend'), 'name' => 'header_video_loop', 'class' => 'option-item bg-grey-input ')))));
        /**
         * Payment settings
         */
        $sections['payment_settings'] = array('args' => array('title' => __("Payment", 'admin-backend'), 'id' => 'payment-settings', 'icon' => '%', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Payment Currency", 'admin-backend'), 'id' => 'payment-currency', 'class' => 'list-package', 'desc' => __("Enter currency code and sign ....", 'admin-backend'), 'name' => 'currency'), 'fields' => array(array('id' => 'currency-code', 'type' => 'text', 'title' => __("Code", 'admin-backend'), 'name' => 'code', 'placeholder' => __("Code", 'admin-backend'), 'class' => 'option-item bg-grey-input '), array('id' => 'currency-sign', 'type' => 'text', 'title' => __("Sign", 'admin-backend'), 'name' => 'icon', 'placeholder' => __("Sign", 'admin-backend'), 'class' => 'option-item bg-grey-input '), array('id' => 'currency-align', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'align', 'class' => 'option-item bg-grey-input ', 'label_1' => __("Left", 'admin-backend'), 'label_2' => __("Right", 'admin-backend')))), array('args' => array('title' => __("Number Format", 'admin-backend'), 'id' => 'number-format', 'class' => 'list-package', 'desc' => __("Format a number with grouped thousands", 'admin-backend'), 'name' => 'number_format'), 'fields' => array(array('id' => 'decimal-point', 'type' => 'text', 'title' => __("Decimal point", 'admin-backend'), 'label' => __("Decimal point", 'admin-backend'), 'name' => 'dec_point', 'placeholder' => __("Decimal point", 'admin-backend'), 'class' => 'option-item bg-grey-input '), array('id' => 'thousand_sep', 'type' => 'text', 'label' => __("Thousand separator", 'admin-backend'), 'title' => __("Thousand separator", 'admin-backend'), 'name' => 'thousand_sep', 'placeholder' => __("Thousand separator", 'admin-backend'), 'class' => 'option-item bg-grey-input '), array('id' => 'et_decimal', 'type' => 'text', 'label' => __("Number of decimal points", 'admin-backend'), 'title' => __("Number of decimal points", 'admin-backend'), 'name' => 'et_decimal', 'placeholder' => __("Sets the number of decimal points.", 'admin-backend'), 'class' => 'option-item bg-grey-input positive_int', 'default' => 2))), array('args' => array('title' => __("Free to submit listing", 'admin-backend'), 'id' => 'free-to-submit-listing', 'class' => 'free-to-submit-listing', 'desc' => __("Enabling this will allow users to submit listing free.", 'admin-backend')), 'fields' => array(array('id' => 'disable-plan', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'disable_plan', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Payment Test Mode", 'admin-backend'), 'id' => 'payment-test-mode', 'class' => 'payment-test-mode', 'desc' => __("Enabling this will allow you to test payment without charging your account.", 'admin-backend')), 'fields' => array(array('id' => 'test-mode', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'test_mode', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Payment Gateways", 'admin-backend'), 'id' => 'payment-gateways', 'class' => 'payment-gateways', 'desc' => __("Set payment plans your users can choose when posting new project.", 'admin-backend')), 'fields' => array()), array('args' => array('title' => __("Paypal", 'admin-backend'), 'id' => 'Paypal', 'class' => 'payment-gateway', 'desc' => __("Enabling this will allow your users to pay through PayPal", 'admin-backend'), 'name' => 'paypal'), 'fields' => array(array('id' => 'paypal', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'enable', 'class' => 'option-item bg-grey-input '), array('id' => 'paypal_mode', 'type' => 'text', 'title' => __("Align", 'admin-backend'), 'name' => 'api_username', 'class' => 'option-item bg-grey-input ', 'placeholder' => __('Enter your PayPal email address', 'admin-backend')))), array('args' => array('title' => __("2Checkout", 'admin-backend'), 'id' => '2Checkout', 'class' => 'payment-gateway', 'desc' => __("Enabling this will allow your users to pay through 2Checkout", 'admin-backend'), 'name' => '2checkout'), 'fields' => array(array('id' => '2Checkout_mode', 'type' => 'switch', 'title' => __("2Checkout mode", 'admin-backend'), 'name' => 'enable', 'class' => 'option-item bg-grey-input '), array('id' => 'sid', 'type' => 'text', 'title' => __("Sid", 'admin-backend'), 'name' => 'sid', 'class' => 'option-item bg-grey-input ', 'placeholder' => __('Your 2Checkout Seller ID', 'admin-backend')), array('id' => 'secret_key', 'type' => 'text', 'title' => __("Secret Key", 'admin-backend'), 'name' => 'secret_key', 'class' => 'option-item bg-grey-input ', 'placeholder' => __('Your 2Checkout Secret Key', 'admin-backend')))), array('args' => array('title' => __("Cash", 'admin-backend'), 'id' => 'Cash', 'class' => 'payment-gateway', 'desc' => __("Enabling this will allow your user to send cash to your bank account.", 'admin-backend'), 'name' => 'cash'), 'fields' => array(array('id' => 'cash_message_enable', 'type' => 'switch', 'title' => __("Align", 'admin-backend'), 'name' => 'enable', 'class' => 'option-item bg-grey-input '), array('id' => 'cash_message', 'type' => 'editor', 'title' => __("Align", 'admin-backend'), 'name' => 'cash_message', 'class' => 'option-item bg-grey-input '))), array('type' => 'list', 'args' => array('title' => __("Payment Plans", 'admin-backend'), 'id' => 'list-package', 'class' => 'list-package', 'desc' => '', 'name' => 'pack'), 'fields' => array('form' => '/admin-template/package-form.php', 'form_js' => '/admin-template/package-form-js.php', 'js_template' => '/admin-template/package-js-item.php', 'template' => '/admin-template/package-item.php')), array('args' => array('title' => __("Limit Free Plan Use", 'admin-backend'), 'id' => 'limit_free_plan', 'class' => 'limit_free_plan', 'desc' => __("Enter the maximum number allowed for employers to use your Free plan", 'admin-backend')), 'fields' => array(array('id' => 'cash_message_enable', 'type' => 'text', 'title' => __("Align", 'admin-backend'), 'name' => 'limit_free_plan', 'class' => 'option-item bg-grey-input ')))));
        /**
         * mail template settings section
         */
        $sections['mailing'] = array('args' => array('title' => __("Mailing", 'admin-backend'), 'id' => 'mail-settings', 'icon' => 'M', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Authentication Mail Template", 'admin-backend'), 'id' => 'mail-description-group', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'mail-description', 'type' => 'desc', 'title' => __("Mail description here", 'admin-backend'), 'text' => __("Email templates for authentication process. You can use placeholders to include some specific content.", 'admin-backend') . '<a class="icon btn-template-help payment" data-icon="?" href="#" title="View more details"></a>' . '<div class="cont-template-help payment-setting">
                                                    [user_login],[display_name],[user_email] : ' . __("user's details you want to send mail", 'admin-backend') . '<br />
                                                    [dashboard] : ' . __("member dashboard url ", 'admin-backend') . '<br />
                                                    [title], [link], [excerpt],[desc], [author] : ' . __("project title, link, details, author", 'admin-backend') . ' <br />
                                                    [activate_url] : ' . __("activate link is require for user to renew their pass", 'admin-backend') . ' <br />
                                                    [site_url],[blogname],[admin_email] : ' . __(" site info, admin email", 'admin-backend') . '
                                                    [project_list] : ' . __("list projects employer send to freelancer when invite him to join", 'admin-backend') . '

                                                </div>', 'class' => '', 'name' => 'mail_description'))), array('args' => array('title' => __("Register Mail Template", 'admin-backend'), 'id' => 'register-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users when he register successfull.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'register_mail_template', 'type' => 'textarea', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'register_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'register_mail_template', 'type' => 'textarea', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'register_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Register Mail Template", 'admin-backend'), 'id' => 'register-mail-freelancer', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to user-freelancers when he register successfull.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'register_mail_template_freelancer', 'type' => 'textarea', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'register_mail_freelancer_template_en', 'class' => '', 'reset' => 1), array('id' => 'register_mail_template_freelancer', 'type' => 'textarea', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'register_mail_freelancer_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Confirm Mail Template", 'admin-backend'), 'id' => 'confirm-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users after he registered successfull when option confirm email is on.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'confirm_mail_template', 'type' => 'textarea', 'title' => __("Confirme Mail", 'admin-backend'), 'name' => 'confirm_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'confirm_mail_template', 'type' => 'textarea', 'title' => __("Confirme Mail", 'admin-backend'), 'name' => 'confirm_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Confirm Mail Freelancer Template", 'admin-backend'), 'id' => 'confirm-freelancer-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users after he registered successfull when option confirm email is on.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'confirm_mail_freelancer_template', 'type' => 'textarea', 'title' => __("Confirmed Mail Freelancer", 'admin-backend'), 'name' => 'confirm_mail_freelancer_template_en', 'class' => '', 'reset' => 1), array('id' => 'confirm_mail_freelancer_template', 'type' => 'textarea', 'title' => __("Confirmed Mail Freelancer", 'admin-backend'), 'name' => 'confirm_mail_freelancer_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Confirmed Mail Template", 'admin-backend'), 'id' => 'confirmed-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users to notify that he was confirm email successfull.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'confirmed_mail_template', 'type' => 'textarea', 'title' => __("Confirmed Mail", 'admin-backend'), 'name' => 'confirmed_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'confirmed_mail_template', 'type' => 'textarea', 'title' => __("Confirmed Mail", 'admin-backend'), 'name' => 'confirmed_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Confirmed Phone No Template", 'admin-backend'), 'id' => 'confirmed-phone', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users to notify that he was confirm phone no successfull.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'confirmed_phone_template', 'type' => 'textarea', 'title' => __("Confirmed Phone", 'admin-backend'), 'name' => 'confirmed_phone_template_en', 'class' => '', 'reset' => 1), array('id' => 'confirmed_phone_template', 'type' => 'textarea', 'title' => __("Confirmed Phone", 'admin-backend'), 'name' => 'confirmed_phone_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Forgotpass Mail Template", 'admin-backend'), 'id' => 'forgotpass-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users when he request resetpass.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'forgotpass_mail_template', 'type' => 'textarea', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'forgotpass_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'forgotpass_mail_template', 'type' => 'textarea', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'forgotpass_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Resetpass Mail Template", 'admin-backend'), 'id' => 'resetpass-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to user to notify him has resetpass successfully.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'resetpass_mail_template', 'type' => 'textarea', 'title' => __("Resetpassword Mail", 'admin-backend'), 'name' => 'resetpass_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'resetpass_mail_template', 'type' => 'textarea', 'title' => __("Resetpassword Mail", 'admin-backend'), 'name' => 'resetpass_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Project Related Mail Template", 'admin-backend'), 'id' => 'mail-description-group', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'mail-description', 'type' => 'desc', 'title' => __("Mail description here", 'admin-backend'), 'text' => __("Email templates used for project-related event. You can use placeholders to include some specific content", 'admin-backend'), 'class' => '', 'name' => 'mail_description'))), array('args' => array('title' => __("New Message Mail Template", 'admin-backend'), 'id' => 'new-message-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users when he have a new message on workspace.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'new_message_mail_template', 'type' => 'textarea', 'title' => __("Inbox Mail", 'admin-backend'), 'name' => 'new_message_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'new_message_mail_template', 'type' => 'textarea', 'title' => __("Inbox Mail", 'admin-backend'), 'name' => 'new_message_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Inbox Mail Template", 'admin-backend'), 'id' => 'inbox-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users when someone contact him.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'inbox_mail_template', 'type' => 'textarea', 'title' => __("Inbox Mail", 'admin-backend'), 'name' => 'inbox_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'inbox_mail_template', 'type' => 'textarea', 'title' => __("Inbox Mail", 'admin-backend'), 'name' => 'inbox_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Invite Mail Template", 'admin-backend'), 'id' => 'invite-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users when someone invite him join a project", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'invite_mail_template', 'type' => 'textarea', 'title' => __("Invite Mail", 'admin-backend'), 'name' => 'invite_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'invite_mail_template', 'type' => 'textarea', 'title' => __("Invite Mail", 'admin-backend'), 'name' => 'invite_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Cash Notification Mail Template", 'admin-backend'), 'id' => 'cash-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to user cash message when they pay by cash", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'cash_notification_mail', 'type' => 'textarea', 'title' => __("Cash Notification Mail", 'admin-backend'), 'name' => 'cash_notification_mail_en', 'class' => '', 'reset' => 1), array('id' => 'cash_notification_mail', 'type' => 'textarea', 'title' => __("Cash Notification Mail", 'admin-backend'), 'name' => 'cash_notification_mail_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Receipt Mail Template", 'admin-backend'), 'id' => 'ae-receipt_mail', 'class' => 'payment-gateway', 'name' => '', 'toggle' => true, 'desc' => __("Send to users after they finish a payment", 'admin-backend')), 'fields' => array(array('id' => 'ae_receipt_mail', 'type' => 'textarea', 'title' => __("Receipt Mail Template", 'admin-backend'), 'name' => 'ae_receipt_mail_en', 'class' => '', 'reset' => 1), array('id' => 'ae_receipt_mail', 'type' => 'textarea', 'title' => __("Receipt Mail Template", 'admin-backend'), 'name' => 'ae_receipt_mail_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Disput Mail Template", 'admin-backend'), 'id' => 'ae-receipt_mail', 'class' => 'payment-gateway', 'name' => '', 'toggle' => true, 'desc' => __("Send to users after they finish a payment", 'admin-backend')), 'fields' => array(array('id' => 'ae_receipt_mail', 'type' => 'textarea', 'title' => __("Disput Mail Template", 'admin-backend'), 'name' => 'ae_disput_mail_en', 'class' => '', 'reset' => 1), array('id' => 'ae_receipt_mail', 'type' => 'textarea', 'title' => __("Disput Mail Template", 'admin-backend'), 'name' => 'ae_disput_mail_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Publish Mail Template", 'admin-backend'), 'id' => 'publish-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Sent to users to notify that one of their listing has been published.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'publish_mail_template', 'type' => 'textarea', 'title' => __("publish Mail", 'admin-backend'), 'name' => 'publish_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'publish_mail_template', 'type' => 'textarea', 'title' => __("publish Mail", 'admin-backend'), 'name' => 'publish_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Archive Mail Template", 'admin-backend'), 'id' => 'archive-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Sent to users to notify that one of their listing has been archived due to expiration or manual administrative action.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'archive_mail_template', 'type' => 'textarea', 'title' => __("archive Mail", 'admin-backend'), 'name' => 'archive_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'archive_mail_template', 'type' => 'textarea', 'title' => __("archive Mail", 'admin-backend'), 'name' => 'archive_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Reject Mail Template", 'admin-backend'), 'id' => 'reject-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Sent to users to notify that one of their listing has been rejected.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'reject_mail_template', 'type' => 'textarea', 'title' => __("reject Mail", 'admin-backend'), 'name' => 'reject_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'reject_mail_template', 'type' => 'textarea', 'title' => __("reject Mail", 'admin-backend'), 'name' => 'reject_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("New Bid Mail Template", 'admin-backend'), 'id' => 'bid-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Sent to users when a candidate bid their projects.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'bid_mail_template', 'type' => 'textarea', 'title' => __("Bid Mail", 'admin-backend'), 'name' => 'bid_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'bid_mail_template', 'type' => 'textarea', 'title' => __("Bid Mail", 'admin-backend'), 'name' => 'bid_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Bid Accepted Mail Template", 'admin-backend'), 'id' => 'bid_accepted_-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to freelancer when his bid was accepted.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'bid_accepted_template', 'type' => 'textarea', 'title' => __("Bid Accepted Mail", 'admin-backend'), 'name' => 'bid_accepted_template_en', 'class' => '', 'reset' => 1), array('id' => 'bid_accepted_template', 'type' => 'textarea', 'title' => __("Bid Accepted Mail", 'admin-backend'), 'name' => 'bid_accepted_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Complete Project Mail Template", 'admin-backend'), 'id' => 'complete-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to user when project he worked on was marked complete.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'complete_mail_template', 'type' => 'textarea', 'title' => __("Complete Mail", 'admin-backend'), 'name' => 'complete_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'complete_mail_template', 'type' => 'textarea', 'title' => __("Complete Mail", 'admin-backend'), 'name' => 'complete_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Project Report Mail Template", 'admin-backend'), 'id' => 'mail-description-group', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'mail-description', 'type' => 'desc', 'title' => __("Mail description here", 'admin-backend'), 'text' => __("Email templates used for project-report event. You can use placeholders to include some specific content", 'admin-backend'), 'class' => '', 'name' => 'mail_description'))), array('args' => array('title' => __("Project was Reported by Employer", 'admin-backend'), 'id' => 'employer-report-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to freelancer when employer sends a report on the project.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'employer_report_mail_template', 'type' => 'textarea', 'title' => __("Employer Report  Mail", 'admin-backend'), 'name' => 'employer_report_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'employer_report_mail_template', 'type' => 'textarea', 'title' => __("Employer Report  Mail", 'admin-backend'), 'name' => 'employer_report_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Employer closed the project", 'admin-backend'), 'id' => 'employer-close-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to freelancer when employer close project.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'employer_close_mail_template', 'type' => 'textarea', 'title' => __("Employer Report  Mail", 'admin-backend'), 'name' => 'employer_close_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'employer_close_mail_template', 'type' => 'textarea', 'title' => __("Employer Report  Mail", 'admin-backend'), 'name' => 'employer_close_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Project Reported by Freelancer", 'admin-backend'), 'id' => 'freelancer-report-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to employer when freelancer send report on project.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'freelancer_report_mail_template', 'type' => 'textarea', 'title' => __("Freelancer Report  Mail", 'admin-backend'), 'name' => 'freelancer_report_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'freelancer_report_mail_template', 'type' => 'textarea', 'title' => __("Freelancer Report  Mail", 'admin-backend'), 'name' => 'freelancer_report_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Freelancer Quit The Project", 'admin-backend'), 'id' => 'freelancer-quit-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to the employer when the freelancer quits the project", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'freelancer_quit_mail_template', 'type' => 'textarea', 'title' => __("Freelancer Quit  Mail", 'admin-backend'), 'name' => 'freelancer_quit_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'freelancer_quit_mail_template', 'type' => 'textarea', 'title' => __("Freelancer Quit  Mail", 'admin-backend'), 'name' => 'freelancer_quit_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("New Report was sent to Admin", 'admin-backend'), 'id' => 'admin-new-report-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to admin when user sends a report.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'admin_report_mail_template', 'type' => 'textarea', 'title' => __("Admin New Report Mail", 'admin-backend'), 'name' => 'admin_report_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'admin_report_mail_template', 'type' => 'textarea', 'title' => __("Admin New Report Mail", 'admin-backend'), 'name' => 'admin_report_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Admin Refunded The Payment", 'admin-backend'), 'id' => 'admin-refund-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to users when admin refunds the escrow payment to the project's owner.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'fre_refund_mail_template', 'type' => 'textarea', 'title' => __("Admin Refund Payment", 'admin-backend'), 'name' => 'fre_refund_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'fre_refund_mail_template', 'type' => 'textarea', 'title' => __("Admin Refund Payment", 'admin-backend'), 'name' => 'fre_refund_mail_template_de', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Admin Executed The Payment", 'admin-backend'), 'id' => 'admin-execute-payment-mail', 'class' => 'payment-gateway', 'name' => '', 'desc' => __("Send to user when admin executes the escrow payment and send to the freelancer.", 'admin-backend'), 'toggle' => true), 'fields' => array(array('id' => 'fre_execute_mail_template', 'type' => 'textarea', 'title' => __("Admin Execute Payment Mail", 'admin-backend'), 'name' => 'fre_execute_mail_template_en', 'class' => '', 'reset' => 1), array('id' => 'fre_execute_mail_template', 'type' => 'textarea', 'title' => __("Admin Execute Payment Mail", 'admin-backend'), 'name' => 'fre_execute_mail_template_de', 'class' => '', 'reset' => 1)))));
        /**
         * language settings
         */
        $sections['language'] = array('args' => array('title' => __("Language", 'admin-backend'), 'id' => 'language-settings', 'icon' => 'G', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Website Language", 'admin-backend'), 'id' => 'website-language', 'class' => '', 'name' => '', 'desc' => __("Select the language you want to use for your website.", 'admin-backend')), 'fields' => array(array('id' => 'forgotpass_mail_template', 'type' => 'language_list', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'website_language', 'class' => ''))), array('args' => array('title' => __("Translator", 'admin-backend'), 'id' => 'translator', 'class' => '', 'name' => 'translator', 'desc' => __("Translate a language", 'admin-backend')), 'fields' => array(array('id' => 'translator-field', 'type' => 'translator', 'title' => __("Register Mail", 'admin-backend'), 'name' => 'translate', 'class' => '')))));
        /**
         * license key settings
         */
        $sections['update'] = array('args' => array('title' => __("Update", 'admin-backend'), 'id' => 'update-settings', 'icon' => '~', 'class' => ''), 'groups' => array(array('args' => array('title' => __("License Key", 'admin-backend'), 'id' => 'license-key', 'class' => '', 'desc' => ''), 'fields' => array(array('id' => 'et_license_key', 'type' => 'text', 'title' => __("License Key", 'admin-backend'), 'name' => 'et_license_key', 'class' => '')))));
        $temp = array();
        $options = AE_Options::get_instance();
        foreach ($sections as $key => $section) {
            $temp[] = new AE_section($section['args'], $section['groups'], $options);
        }
        $pages = array();
        /**
         * overview container
         */
        $container = new AE_Overview(array(PROFILE, PROJECT), true);
        //$statics      =   array();
        // $header      =   new AE_Head( array( 'page_title'    => __('Overview', 'admin-backend'),
        //                                  'menu_title'    => __('OVERVIEW', 'admin-backend'),
        //                                  'desc'          => __("Overview", 'admin-backend') ) );
        $pages['overview'] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Overview', 'admin-backend'), 'menu_title' => __('OVERVIEW', 'admin-backend'), 'cap' => 'administrator', 'slug' => 'et-overview', 'icon' => 'L', 'desc' => sprintf(__("%s overview", 'admin-backend'), $options->blogname)), 'container' => $container);
        /**
         * setting view
         */
        $container = new AE_Container(array('class' => '', 'id' => 'settings'), $temp, '');
        $pages['settings'] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Settings', 'admin-backend'), 'menu_title' => __('SETTINGS', 'admin-backend'), 'cap' => 'administrator', 'slug' => 'et-settings', 'icon' => 'y', 'desc' => __("Manage how your FreelanceEngine looks and feels", 'admin-backend')), 'container' => $container);
        /**
         * user list view
         */
        $container = new AE_UsersContainer(array('filter' => array('moderate')));
        $pages['members'] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Members', 'admin-backend'), 'menu_title' => __('MEMBERS', 'admin-backend'), 'cap' => 'administrator', 'slug' => 'et-users', 'icon' => 'g', 'desc' => __("Overview of registered members", 'admin-backend')), 'container' => $container);
        /**
         * order list view
         */
        $orderlist = new AE_OrderList(array());
        $pages['payments'] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Payments', 'admin-backend'), 'menu_title' => __('PAYMENTS', 'admin-backend'), 'cap' => 'administrator', 'slug' => 'et-payments', 'icon' => '%', 'desc' => __("Overview of all payments", 'admin-backend')), 'container' => $orderlist);
        /**
         * setup wizard view
         */
        // $container = new AE_Wizard();
        // $pages[] = array(
        //     'args' => array(
        //         'parent_slug' => 'et-overview',
        //         'page_title'  => __('Setup Wizard', 'admin-backend') ,
        //         'menu_title'  => __('Setup Wizard', 'admin-backend') ,
        //         'cap'         => 'administrator',
        //         'slug'        => 'et-wizard',
        //         'icon'        => 'help',
        //         'desc'        => __("Set up and manage every content of your site", 'admin-backend')
        //     ) ,
        //     'container' => $container
        // );
        /**
         *  filter pages config params so user can hook to here
         */
        $pages = apply_filters('ae_admin_menu_pages', $pages);
        /**
         * add menu page
         */
        $this->admin_menu = new AE_Menu($pages);
        /**
         * add sub menu page
         */
        foreach ($pages as $key => $page) {
            new AE_Submenu($page, $pages);
        }
    }
 public function __construct()
 {
     parent::__construct("et_options");
 }
Example #18
0
 /**
  * render mobile icon, favicon image get from option
  * @author Dakachi
  * @return void
  */
 function ae_favicon()
 {
     $img = get_template_directory_uri() . "/img/favicon.png";
     $options = AE_Options::get_instance();
     // save this setting to theme options
     $mobile_icon = $options->mobile_icon;
     if (!empty($mobile_icon)) {
         $img = $mobile_icon['thumbnail'][0];
     }
     echo '<link href="' . $img . '" rel="shortcut icon" type="image/x-icon">';
     if (et_load_mobile()) {
         echo '<link href="' . $img . '" rel="apple-touch-icon" />';
     }
 }
    /**
     * return mail header template
     */
    function get_mail_header()
    {
        $mail_header = apply_filters('ae_get_mail_header', '');
        if ($mail_header != '') {
            return $mail_header;
        }
        $logo_url = get_template_directory_uri() . "/img/logo-de.png";
        $options = AE_Options::get_instance();
        // save this setting to theme options
        $site_logo = $options->site_logo;
        if (!empty($site_logo)) {
            $logo_url = $site_logo['large'][0];
        }
        $logo_url = get_template_directory_uri() . "/img/logo-fre-white.png";
        //$logo_url = apply_filters('ae_mail_logo_url', $logo_url);
        $styles = '<style type="text/css">table.button:active td,table.button:hover td,table.button:visited td,table.large-button:hover td,table.medium-button:hover td,table.small-button:hover td,table.tiny-button:hover td{background:#2795b6!important}a:active,a:hover{color:#2795b6!important}a:visited{color:#2ba6cb!important}h1 a:active,h1 a:visited,h2 a:active,h2 a:visited,h3 a:active,h3 a:visited,h4 a:active,h4 a:visited,h5 a:active,h5 a:visited,h6 a:active,h6 a:visited{color:#3783c4!important}table.button td a:visited,table.button:active td a,table.button:hover td a,table.button:visited td a,table.large-button td a:visited,table.large-button:active td a,table.large-button:hover td a,table.medium-button td a:visited,table.medium-button:active td a,table.medium-button:hover td a,table.small-button td a:visited,table.small-button:active td a,table.small-button:hover td a,table.tiny-button td a:visited,table.tiny-button:active td a,table.tiny-button:hover td a{color:#fff!important}table.secondary:hover td{background:#d0d0d0!important;color:#555}table.secondary td a:visited,table.secondary:active td a,table.secondary:hover td a{color:#555!important}table.success:hover td{background:#457a1a!important}table.alert:hover td{background:#970b0e!important}@media only screen and (max-width:600px){table[class=body] img{width:auto!important;height:auto!important}table[class=body] center{min-width:0!important}table[class=body] .container{width:95%!important}table[class=body] .row{width:100%!important;display:block!important}table[class=body] .wrapper{display:block!important;padding-right:0!important}table[class=body] .column,table[class=body] .columns{table-layout:fixed!important;float:none!important;width:100%!important;padding-right:0!important;padding-left:0!important;display:block!important}table[class=body] .left-text-pad,table[class=body] .text-pad-left{padding-right:10px!important}table[class=body] .wrapper.first .column,table[class=body] .wrapper.first .columns{display:table!important}table[class=body] table.column td,table[class=body] table.columns td{width:100%!important}table[class=body] .column td.one,table[class=body] .columns td.one{width:8.333333%!important}table[class=body] .column td.two,table[class=body] .columns td.two{width:16.666666%!important}table[class=body] .column td.three,table[class=body] .columns td.three{width:25%!important}table[class=body] .column td.four,table[class=body] .columns td.four{width:33.333333%!important}table[class=body] .column td.five,table[class=body] .columns td.five{width:41.666666%!important}table[class=body] .column td.six,table[class=body] .columns td.six{width:50%!important}table[class=body] .column td.seven,table[class=body] .columns td.seven{width:58.333333%!important}table[class=body] .column td.eight,table[class=body] .columns td.eight{width:66.666666%!important}table[class=body] .column td.nine,table[class=body] .columns td.nine{width:75%!important}table[class=body] .column td.ten,table[class=body] .columns td.ten{width:83.333333%!important}table[class=body] .column td.eleven,table[class=body] .columns td.eleven{width:91.666666%!important}table[class=body] .column td.twelve,table[class=body] .columns td.twelve{width:100%!important}table[class=body] td.offset-by-eight,table[class=body] td.offset-by-eleven,table[class=body] td.offset-by-five,table[class=body] td.offset-by-four,table[class=body] td.offset-by-nine,table[class=body] td.offset-by-one,table[class=body] td.offset-by-seven,table[class=body] td.offset-by-six,table[class=body] td.offset-by-ten,table[class=body] td.offset-by-three,table[class=body] td.offset-by-two{padding-left:0!important}table[class=body] .right-text-pad,table[class=body] .text-pad-right{padding-left:10px!important}table[class=body] table.columns td.expander{width:1px!important}table[class=body] .hide-for-small,table[class=body] .show-for-desktop{display:none!important}table[class=body] .hide-for-desktop,table[class=body] .show-for-small{display:inherit!important}}</style>';
        $customize = et_get_customization();
        $mail_header = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width" />
    <title>Perssistant</title>
</head>

<body style="width: 100% !important; min-width: 100%; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; text-align: left; line-height: 24px; font-size: 14px; margin: 0; padding: 0;">

' . $styles . '
    <table class="body" style="border-spacing: 0; border-collapse: collapse; vertical-align: middle; text-align: left; height: 100%; width: 100%; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 0;">
        <tr style="vertical-align: middle; text-align: left; padding: 0;" align="left">
            <td class="center" align="center" valign="top" style="word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: middle; text-align: center; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 0;">
                <center style="width: 100%; min-width: 580px;">
                    <table class="row header" style="border-spacing: 0; border-collapse: collapse; vertical-align: middle; text-align: left; width: 100%; position: relative; background: #54b3db; padding: 0px;" bgcolor="#54b3db">
                        <tr style="vertical-align: middle; text-align: left; padding: 0;" align="left">
                            <td class="center" align="center" style="word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: middle; text-align: center; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 0;" valign="middle">
                                <center style="width: 100%; min-width: 580px;">
                                    <table class="container" style="border-spacing: 0; border-collapse: collapse; vertical-align: middle; text-align: inherit; width: 580px; margin: 0 auto; padding: 0;">
                                        <tr style="vertical-align: middle; text-align: left; padding: 0;" align="left">
                                            <td class="wrapper last" style="word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: middle; text-align: left; position: relative; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 10px 0px 0px;" align="left" valign="middle">
                                                <table class="twelve columns" style="border-spacing: 0; border-collapse: collapse; vertical-align: middle; text-align: left; width: 580px; margin: 0 auto; padding: 0;">
                                                    <tr style="vertical-align: middle; text-align: left; padding: 0;" align="left">
                                                        <td class="center" style="word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: middle; text-align: center; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 0px 0px 10px;" align="center" valign="middle">
                                                            <center style="width: 100%; min-width: 580px;">
                                                                <img class="center" src="' . $logo_url . '" alt="Perssistant" style="outline: none; text-decoration: none; -ms-interpolation-mode: bicubic; width: auto; max-width: 100%; float: none; clear: both; display: block; margin: 0 auto;" align="none" />
                                                            </center>
                                                        </td>
                                                        <td class="expander" style="word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: middle; text-align: left; visibility: hidden; width: 0px; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 0;" align="left" valign="middle"></td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </center>
                            </td>
                        </tr>
                    </table>
                    <table class="container" style="border-spacing: 0; border-collapse: collapse; vertical-align: middle; text-align: inherit; width: 580px; margin: 0 auto; padding: 0;">
                        <tr style="vertical-align: middle; text-align: left; padding: 0;" align="left">
                            <td style="word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; border-collapse: collapse !important; vertical-align: middle; text-align: left; color: #737373; font-family: \'Arial\', sans-serif; font-weight: normal; line-height: 24px; font-size: 14px; margin: 0; padding: 0;" align="left" valign="middle">
                               ';
        return $mail_header;
    }
Example #20
0
<!DOCTYPE html>
<html <?php 
language_attributes();
?>
>
	<!--[if lt IE 7]> <html class="ie ie6 oldie" lang="en"> <![endif]-->
	<!--[if IE 7]>    <html class="ie ie7 oldie" lang="en"> <![endif]-->
	<!--[if IE 8]>    <html class="ie ie8 oldie" lang="en"> <![endif]-->
	<!--[if gt IE 8]> <html class="ie ie9 newest" lang="en"> <![endif]-->
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=Edge">
		<meta charset="utf-8">
            <?php 
$options = AE_Options::get_instance();
?>
        <title><?php 
wp_title('|', true, 'right');
?>
</title>

		<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />

		<?php 
$favicon = $options->mobile_icon['thumbnail'][0];
?>
		<link rel="shortcut icon" href="<?php 
echo $favicon;
?>
"/>
		<link href='//fonts.googleapis.com/css?family=Lato:400,700&subset=latin,cyrillic,cyrillic-ext,vietnamese,latin-ext' rel='stylesheet' type='text/css'>
		<script type="text/javascript" src="<?php 
Example #21
0
 function ae_set_option($name, $new_value)
 {
     if (!current_user_can('manage_options')) {
         return;
     }
     $option = AE_Options::get_instance();
     return $option->update_option($name, $new_value);
 }
Example #22
0
function fre_upload_file()
{
    $res = array('success' => false, 'msg' => __('There is an error occurred', 'theme-backend'), 'code' => 400);
    // check fileID
    if (!isset($_POST['fileID']) || empty($_POST['fileID'])) {
        $res['msg'] = __('Missing image ID', 'theme-backend');
    } else {
        $fileID = $_POST["fileID"];
        $imgType = $_POST['imgType'];
        // check ajax nonce
        if (!de_check_ajax_referer('file_et_uploader', false, false) && !check_ajax_referer('file_et_uploader', false, false)) {
            $res['msg'] = __('Security error!', 'theme-backend');
        } elseif (isset($_FILES[$fileID])) {
            // handle file upload
            $attach_id = et_process_file_upload($_FILES[$fileID], 0, 0, array('jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff', 'pdf' => 'application/pdf', 'doc|docx' => 'application/msword', 'odt' => 'application/vnd.oasis.opendocument.text', 'zip' => 'application/zip', 'rar' => 'application/rar'));
            if (!is_wp_error($attach_id)) {
                try {
                    $attach_data = et_get_attachment_data($attach_id);
                    $options = AE_Options::get_instance();
                    // save this setting to theme options
                    // $options->$imgType = $attach_data;
                    // $options->save();
                    /** 
                     * do action to control how to store data
                     * @param $attach_data the array of image data
                     * @param $request['data']
                     * @param $attach_id the uploaded file id
                     */
                    //do_action('ae_upload_image' , $attach_data , $_POST['data'], $attach_id );
                    $res = array('success' => true, 'msg' => __('File has been uploaded successfully', 'theme-backend'), 'data' => $attach_data);
                } catch (Exception $e) {
                    $res['msg'] = __('Error when updating settings.', 'theme-backend');
                }
            } else {
                $res['msg'] = $attach_id->get_error_message();
            }
        } else {
            $res['msg'] = __('Uploaded file not found', 'theme-backend');
        }
    }
    // send json to client
    wp_send_json($res);
}
 function __construct(AE_Pack $pack)
 {
     $this->post = $pack;
     // add an action to catch ajax request sync pack
     $this->add_ajax('ae-pack-sync', 'pack_sync', true, false);
     $this->add_ajax('et_sort_payment_plan', 'et_ajax_payment_sorting');
     // add filter to order pack
     $this->add_filter('posts_orderby', 'ae_order_pack_by_menu_order', 10, 2);
     $this->options = AE_Options::get_instance();
 }
Example #24
0
 /**
  * render admin setup
  */
 function admin_setup()
 {
     $sections = array();
     /**
      * general settings section
      */
     $sections[] = array('args' => array('title' => __("General", ET_DOMAIN), 'id' => 'general-settings', 'icon' => 'y', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Website Title", ET_DOMAIN), 'id' => 'site-name', 'class' => '', 'desc' => __("Enter your website title.", ET_DOMAIN)), 'fields' => array(array('id' => 'blogname', 'type' => 'text', 'title' => __("Website Title", ET_DOMAIN), 'name' => 'blogname', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Website Description", ET_DOMAIN), 'id' => 'site-description', 'class' => '', 'desc' => __("Enter your website description", ET_DOMAIN)), 'fields' => array(array('id' => 'blogdescription', 'type' => 'text', 'title' => __("Website Title", ET_DOMAIN), 'name' => 'blogdescription', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Copyright", ET_DOMAIN), 'id' => 'site-copyright', 'class' => '', 'desc' => __("This copyright information will appear in the footer.", ET_DOMAIN)), 'fields' => array(array('id' => 'copyright', 'type' => 'text', 'title' => __("Copyright", ET_DOMAIN), 'name' => 'copyright', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Google Analytics Script", ET_DOMAIN), 'id' => 'site-analytics', 'class' => '', 'desc' => __("Google analytics is a service offered by Google that generates detailed statistics about the visits to a website.", ET_DOMAIN)), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'textarea', 'title' => __("Google Analytics Script", ET_DOMAIN), 'name' => 'google_analytics', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Email Confirmation", ET_DOMAIN), 'id' => 'user-confirm', 'class' => '', 'desc' => __("Enabling this will require users to confirm their email addresses after registration.", ET_DOMAIN)), 'fields' => array(array('id' => 'user_confirm', 'type' => 'switch', 'title' => __("User Confirm", ET_DOMAIN), 'name' => 'user_confirm', 'class' => '')))));
     /**
      * social settings section
      */
     $sections[] = array('args' => array('title' => __("Social", ET_DOMAIN), 'id' => 'social-settings', 'icon' => 'B', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Twitter API", ET_DOMAIN), 'id' => 'twitter-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via Twitter.", ET_DOMAIN)), 'fields' => array(array('id' => 'twitter_login', 'type' => 'switch', 'title' => __("Twitter API ", ET_DOMAIN), 'name' => 'twitter_login', 'class' => ''), array('id' => 'et_twitter_key', 'type' => 'text', 'title' => __("Twitter key ", ET_DOMAIN), 'name' => 'et_twitter_key', 'placeholder' => __("Twitter Consumer Key", ET_DOMAIN), 'class' => ''), array('id' => 'et_twitter_secret', 'type' => 'text', 'title' => __("Twitter secret ", ET_DOMAIN), 'name' => 'et_twitter_secret', 'placeholder' => __("Twitter Consumer Secret", ET_DOMAIN), 'class' => ''))), array('args' => array('title' => __("Facebook API", ET_DOMAIN), 'id' => 'facebook-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via Facebook.", ET_DOMAIN)), 'fields' => array(array('id' => 'facebook_login', 'type' => 'switch', 'title' => __("Facebook API ", ET_DOMAIN), 'name' => 'facebook_login', 'class' => ''), array('id' => 'et_facebook_key', 'type' => 'text', 'title' => __("Facebook key ", ET_DOMAIN), 'name' => 'et_facebook_key', 'placeholder' => __("Facebook Application ID", ET_DOMAIN), 'class' => ''))), array('args' => array('title' => __("Google API", ET_DOMAIN), 'id' => 'google-api', 'class' => '', 'desc' => __("Enabling this will allow users to login via Google.", ET_DOMAIN)), 'fields' => array(array('id' => 'gplus_login', 'type' => 'switch', 'title' => __("Google API ", ET_DOMAIN), 'name' => 'gplus_login', 'class' => ''), array('id' => 'gplus_client_id', 'type' => 'text', 'title' => __("Google key ", ET_DOMAIN), 'name' => 'gplus_client_id', 'placeholder' => __("Client ID", ET_DOMAIN), 'class' => '')))));
     /**
      * content settings section
      */
     $sections[] = array('args' => array('title' => __("Content", ET_DOMAIN), 'id' => 'content-settings', 'icon' => 'l', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Filter Bad Words ( Questions / Answers )", ET_DOMAIN), 'id' => 'filter_keywords', 'class' => '', 'desc' => __("Each word seperate by comma (,)", ET_DOMAIN)), 'fields' => array(array('id' => 'filter_keywords', 'type' => 'textarea', 'title' => __("Enter Keywords Here", ET_DOMAIN), 'name' => 'filter_keywords', 'class' => 'option-item bg-grey-input'))), array('args' => array('title' => __("Intro Text", ET_DOMAIN), 'id' => 'intro-text', 'class' => '', 'desc' => __("This text will appear in the intro page.", ET_DOMAIN)), 'fields' => array(array('id' => 'intro-heading', 'type' => 'text', 'title' => __("Intro Slide Texts", ET_DOMAIN), 'name' => 'intro_slide_text', 'class' => 'option-item bg-grey-input '), array('id' => 'text-bottom', 'type' => 'text', 'title' => __("Intro Bottom Texts", ET_DOMAIN), 'name' => 'intro_bottom_text', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Custom Slugs", ET_DOMAIN), 'id' => 'intro-text', 'class' => '', 'desc' => __("Add custom slugs for question & category here. (You need to save permalink structure to apply this change.)", ET_DOMAIN)), 'fields' => array(array('id' => 'question-slug', 'type' => 'text', 'title' => __("Question Slug", ET_DOMAIN), 'placeholder' => __("Question Slug", ET_DOMAIN), 'name' => 'question_slug', 'class' => 'option-item bg-grey-input '), array('id' => 'category-slug', 'type' => 'text', 'title' => __("Category Slug", ET_DOMAIN), 'placeholder' => __("Category Slug", ET_DOMAIN), 'name' => 'category_slug', 'class' => 'option-item bg-grey-input '), array('id' => 'tag-slug', 'type' => 'text', 'title' => __("Tag Slug", ET_DOMAIN), 'placeholder' => __("Tag Slug", ET_DOMAIN), 'name' => 'tag_slug', 'class' => 'option-item bg-grey-input '))), array('args' => array('title' => __("Editor Upload Images", ET_DOMAIN), 'id' => 'upload-images', 'class' => '', 'desc' => __("Turn on / off Feature Images Upload in Editor.", ET_DOMAIN)), 'fields' => array(array('id' => 'upload-images', 'type' => 'switch', 'title' => __("Upload Images", ET_DOMAIN), 'name' => 'ae_upload_images', 'class' => ''))), array('args' => array('title' => __("Login To View Content", ET_DOMAIN), 'id' => 'login-view', 'class' => '', 'desc' => __("If you enable this option, users have to login to see content.", ET_DOMAIN)), 'fields' => array(array('id' => 'login-view-content', 'type' => 'switch', 'title' => __("Login", ET_DOMAIN), 'name' => 'login_view_content', 'class' => ''))), array('args' => array('title' => __("Pending Questions", ET_DOMAIN), 'id' => 'pending-questions', 'class' => '', 'desc' => __("If you enable this option, the new posted questions have to be approved to be displayed.", ET_DOMAIN)), 'fields' => array(array('id' => 'pending-questions-field', 'type' => 'switch', 'title' => __("Pending Questions", ET_DOMAIN), 'name' => 'pending_questions', 'class' => ''))), array('args' => array('title' => __("Pending Answers", ET_DOMAIN), 'id' => 'pending-answers', 'class' => '', 'desc' => __("If you enable this option, the new posted answers have to be approved to be displayed.", ET_DOMAIN)), 'fields' => array(array('id' => 'pending-answers-field', 'type' => 'switch', 'title' => __("Pending Answers", ET_DOMAIN), 'name' => 'pending_answers', 'class' => ''))), array('args' => array('title' => __("Email Notification For Followed Questions", ET_DOMAIN), 'id' => 'following-questions', 'class' => '', 'desc' => __("If you enable this option, whenever there’s a new answer for the followed questions, the system will automatically send emails to the following users.", ET_DOMAIN)), 'fields' => array(array('id' => 'following-quesitons-field', 'type' => 'switch', 'title' => __("Send Mail Following", ET_DOMAIN), 'name' => 'qa_send_following_mail', 'class' => ''))), array('args' => array('title' => __("Live Notifications", ET_DOMAIN), 'id' => 'live-notifications', 'class' => '', 'desc' => __("Turn on / off live notifications feature.", ET_DOMAIN)), 'fields' => array(array('id' => 'live-notifications', 'type' => 'switch', 'title' => __("Live Notifications", ET_DOMAIN), 'name' => 'qa_live_notifications', 'class' => '')))));
     /**
      * branding section
      */
     $sections[] = array('args' => array('title' => __("Branding", ET_DOMAIN), 'id' => 'branding-settings', 'icon' => 'b', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Site logo", ET_DOMAIN), 'id' => 'site-logo', 'class' => '', 'name' => '', 'desc' => __("Your logo should be in PNG, GIF or JPG format, within 150x50px and less than 1500Kb.", ET_DOMAIN)), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Site Logo", ET_DOMAIN), 'name' => 'site_logo', 'class' => '', 'size' => array('150', '50')))), array('args' => array('title' => __("Mobile Icon", ET_DOMAIN), 'id' => 'mobile-icon', 'class' => '', 'name' => '', 'desc' => __("This icon will be used as a launcher icon for iPhone and Android smartphones and also as the website favicon. The image dimensions should be 57x57px.", ET_DOMAIN)), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Mobile Icon", ET_DOMAIN), 'name' => 'mobile_icon', 'class' => '', 'size' => array('57', '57')))), array('args' => array('title' => __("Intro Page Background", ET_DOMAIN), 'id' => 'intro-background', 'class' => '', 'name' => '', 'desc' => __("This image will be used as a background image in Intro Page. The image dimensions should be 1400x700px or more and size less than 1000KB.", ET_DOMAIN)), 'fields' => array(array('id' => 'opt-ace-editor-js', 'type' => 'image', 'title' => __("Intro Page Background", ET_DOMAIN), 'name' => 'intro_background', 'class' => '', 'size' => array('140', '70'))))));
     /**
      * mail template settings section
      */
     $sections[] = array('args' => array('title' => __("Mailing", ET_DOMAIN), 'id' => 'mail-settings', 'icon' => 'M', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Authentication Mail Template", ET_DOMAIN), 'id' => 'mail-description-group', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'mail-description', 'type' => 'desc', 'title' => __("Mail description here", ET_DOMAIN), 'text' => __("Email templates for authentication process. You can use placeholders to include some specific content.", ET_DOMAIN) . '<a class="icon btn-template-help payment" data-icon="?" href="javascript:void(0)" title="View more details"></a>' . '<div class="cont-template-help payment-setting">
                         [user_login],[display_name],[user_email] : ' . __("user's details you want to send mail", ET_DOMAIN) . '<br />
                         [dashboard] : ' . __("member dashboard url ", ET_DOMAIN) . '<br />
                         [title], [link], [excerpt],[desc] : ' . __("question title, link and details", ET_DOMAIN) . ' <br />
                         [activate_url] : ' . __("activate link is require for user to renew their pass", ET_DOMAIN) . ' <br />
                         [site_url],[blogname],[admin_email] : ' . __(" site info, admin email", ET_DOMAIN) . '
                         </div>', 'class' => '', 'name' => 'mail_description'))), array('args' => array('title' => __("Register Mail Template", ET_DOMAIN), 'id' => 'register-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'register_mail_template', 'type' => 'editor', 'title' => __("Register Mail", ET_DOMAIN), 'name' => 'register_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Confirmation Mail Template", ET_DOMAIN), 'id' => 'confirm-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'confirm_mail_template', 'type' => 'editor', 'title' => __("Confirmation Mail", ET_DOMAIN), 'name' => 'confirm_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Confirmed Mail Template", ET_DOMAIN), 'id' => 'confirmed-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'confirmed_mail_template', 'type' => 'editor', 'title' => __("Confirmation Mail", ET_DOMAIN), 'name' => 'confirmed_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Forgotpass Mail Template", ET_DOMAIN), 'id' => 'forgotpass-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'forgotpass_mail_template', 'type' => 'editor', 'title' => __("Register Mail", ET_DOMAIN), 'name' => 'forgotpass_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Resetpass Mail Template", ET_DOMAIN), 'id' => 'resetpass-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'resetpass_mail_template', 'type' => 'editor', 'title' => __("Resetpassword Mail", ET_DOMAIN), 'name' => 'resetpass_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Pending Questions Mail Template", ET_DOMAIN), 'id' => 'pending-questions-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'pending_question_mail_template', 'type' => 'editor', 'title' => __("Pending Questions Mail", ET_DOMAIN), 'name' => 'pending_question_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("New Answer Mail Template", ET_DOMAIN), 'id' => 'new-answer-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'new_answer_mail_template', 'type' => 'editor', 'title' => __("New Answer Mail", ET_DOMAIN), 'name' => 'new_answer_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Report Mail Template", ET_DOMAIN), 'id' => 'report-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'report_mail_template', 'type' => 'editor', 'title' => __("Report Mail", ET_DOMAIN), 'name' => 'report_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Best Answer Mail Template", ET_DOMAIN), 'id' => 'best-answer-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'best_answer_mail_template', 'type' => 'editor', 'title' => __("Best Answer Mail", ET_DOMAIN), 'name' => 'best_answer_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Ban User Mail Template", ET_DOMAIN), 'id' => 'ban-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'ban_mail_template', 'type' => 'editor', 'title' => __("Ban User Mail", ET_DOMAIN), 'name' => 'ban_mail_template', 'class' => '', 'reset' => 1))), array('args' => array('title' => __("Inbox Mail Template", ET_DOMAIN), 'id' => 'inbox-mail', 'class' => '', 'name' => ''), 'fields' => array(array('id' => 'inbox_mail_template', 'type' => 'editor', 'title' => __("Inbox User Mail", ET_DOMAIN), 'name' => 'inbox_mail_template', 'class' => '', 'reset' => 1)))));
     /**
      * language settings
      */
     $sections[] = array('args' => array('title' => __("Language", ET_DOMAIN), 'id' => 'language-settings', 'icon' => 'G', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Website Language", ET_DOMAIN), 'id' => 'website-language', 'class' => '', 'name' => '', 'desc' => __("Select the language you want to use for your website.", ET_DOMAIN)), 'fields' => array(array('id' => 'forgotpass_mail_template', 'type' => 'language_list', 'title' => __("Register Mail", ET_DOMAIN), 'name' => 'website_language', 'class' => ''))), array('args' => array('title' => __("Translator", ET_DOMAIN), 'id' => 'translator', 'class' => '', 'name' => 'translator', 'desc' => __("Translate a language", ET_DOMAIN)), 'fields' => array(array('id' => 'translator-field', 'type' => 'translator', 'title' => __("Register Mail", ET_DOMAIN), 'name' => 'translate', 'class' => '')))));
     /**
      * language settings
      */
     $sections[] = array('args' => array('title' => __("Update", ET_DOMAIN), 'id' => 'update-settings', 'icon' => '~', 'class' => ''), 'groups' => array(array('args' => array('title' => __("License Key", ET_DOMAIN), 'id' => 'license-key', 'class' => '', 'desc' => ''), 'fields' => array(array('id' => 'et_license_key', 'type' => 'text', 'title' => __("License Key", ET_DOMAIN), 'name' => 'et_license_key', 'class' => '')))));
     $temp = array();
     $options = AE_Options::get_instance();
     foreach ($sections as $key => $section) {
         $temp[] = new AE_section($section['args'], $section['groups'], $options);
     }
     $pages = array();
     /**
      * overview container
      */
     $container = new AE_Overview(array('question', 'answer'));
     //$statics		=	array();
     // $header		=	new AE_Head( array(	'page_title' 	=> __('Overview', ET_DOMAIN),
     // 									'menu_title' 	=> __('OVERVIEW', ET_DOMAIN),
     // 									'desc'			=> __("Overview", ET_DOMAIN) ) );
     $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Overview', ET_DOMAIN), 'menu_title' => __('OVERVIEW', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'et-overview', 'icon' => 'menu-overview', 'desc' => sprintf(__("%s overview", ET_DOMAIN), $options->blogname)), 'container' => $container);
     /**
      * setting view
      */
     $container = new AE_Container(array('class' => '', 'id' => 'settings'), $temp, '');
     /**
      * page overview
      */
     $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Settings', ET_DOMAIN), 'menu_title' => __('SETTINGS', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'et-settings', 'icon' => 'gear', 'desc' => __("Manage how your Q&A Engine looks and feels", ET_DOMAIN)), 'container' => $container);
     /**
      * user list view
      */
     $container = new AE_UsersContainer(array('filter' => array('moderate'), 'id' => 'users_container'));
     /**
      * page user list
      */
     $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('Members', ET_DOMAIN), 'menu_title' => __('MEMBERS', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'et-users', 'icon' => 'users', 'desc' => __("Overview of registered members", ET_DOMAIN)), 'container' => $container);
     $badge = array();
     /**
      * user badges view
      */
     $temp = array();
     $sections = array();
     $sections[] = array('args' => array('title' => __("Points", ET_DOMAIN), 'id' => 'badge-active', 'icon' => 'W', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Positive Point", ET_DOMAIN), 'id' => 'active-point', 'class' => '', 'desc' => __("Set up points that users can gain", ET_DOMAIN), 'name' => 'pos_badges'), 'fields' => array(array('id' => 'q-vote-up', 'type' => 'text', 'title' => __("create a question", ET_DOMAIN), 'name' => 'create_question', 'class' => '', 'label' => __("create a question", ET_DOMAIN)), array('id' => 'q-vote-up', 'type' => 'text', 'title' => __("answer a question", ET_DOMAIN), 'name' => 'post_answer', 'class' => '', 'label' => __("answer a question", ET_DOMAIN)), array('id' => 'q-vote-up', 'type' => 'text', 'title' => __("question is voted up", ET_DOMAIN), 'name' => 'q_vote_up', 'class' => '', 'label' => __("question is voted up", ET_DOMAIN)), array('id' => 'a-vote-up', 'type' => 'text', 'title' => __("answer is voted up", ET_DOMAIN), 'name' => 'a_vote_up', 'class' => '', 'label' => __("answer is voted up", ET_DOMAIN)), array('id' => 'a-accepted', 'type' => 'text', 'title' => __("answer is marked 'accepted' ", ET_DOMAIN), 'name' => 'a_accepted', 'class' => '', 'label' => __("answer is marked 'accepted' ", ET_DOMAIN)))), array('args' => array('title' => __("Negative Point", ET_DOMAIN), 'id' => 'active-point', 'class' => '', 'desc' => __("Set up points that user can lose", ET_DOMAIN), 'name' => 'neg_badges'), 'fields' => array(array('id' => 'q_vote_down', 'type' => 'text', 'title' => __("your question is voted down", ET_DOMAIN), 'name' => 'q_vote_down', 'class' => '', 'label' => __("your question is voted down", ET_DOMAIN)), array('id' => 'a_vote_down', 'type' => 'text', 'title' => __("your answer is voted down", ET_DOMAIN), 'name' => 'a_vote_down', 'class' => '', 'label' => __("your answer is voted down", ET_DOMAIN)), array('id' => 'vote_down', 'type' => 'text', 'title' => __("you vote down an answer or question", ET_DOMAIN), 'name' => 'vote_down', 'class' => '', 'label' => __("you vote down an answer or question", ET_DOMAIN))))));
     // privileges
     $privi = qa_privileges();
     $fields = array();
     foreach ($privi as $key => $value) {
         $fields[] = array('id' => $key, 'type' => 'text', 'title' => '', 'name' => $key, 'class' => '', 'label' => $value);
     }
     $sections[] = array('args' => array('title' => __("Privileges", ET_DOMAIN), 'id' => 'badge-privileges', 'icon' => 'K', 'class' => ''), 'groups' => array(array('args' => array('title' => __("Privileges", ET_DOMAIN), 'id' => 'active-point', 'class' => '', 'desc' => __("Set up point users have to achieve to have specific privileges", ET_DOMAIN), 'name' => 'privileges'), 'fields' => $fields)));
     $temp = array(new QA_SectionBadge(array('title' => __("Level", ET_DOMAIN), 'id' => 'badge-level', 'icon' => 'S', 'class' => ''), array(), ''));
     $options = QA_BadgeOptions::get_instance();
     foreach ($sections as $key => $section) {
         $temp[] = new AE_section($section['args'], $section['groups'], $options);
     }
     $container = new AE_Container(array('class' => '', 'id' => 'badge'), $temp, $options);
     /**
      * page badges
      */
     $pages[] = array('args' => array('parent_slug' => 'et-overview', 'page_title' => __('User Badges', ET_DOMAIN), 'menu_title' => __('USER BADGES', ET_DOMAIN), 'cap' => 'administrator', 'slug' => 'et-badge', 'icon' => 'badge', 'desc' => __("Manage what your members can do.", ET_DOMAIN)), 'container' => $container);
     /**
      *	filter pages config params so user can hook to here
      */
     $pages = apply_filters('ae_admin_menu_pages', $pages);
     /**
      * add menu page
      */
     $this->admin_menu = new AE_Menu($pages);
     /**
      * add sub menu page
      */
     foreach ($pages as $key => $page) {
         new AE_Submenu($page, $pages);
     }
 }
Example #25
0
 /**
  * catch action ae_process_payment_action and update post data after payment success
  *
  * @param $payment_return
  * @param $data
  *
  * @return array $payment_return
  *
  * @since 1.0
  * @author dakachi <*****@*****.**>
  */
 function process_payment($payment_return, $data)
 {
     global $ae_post_factory;
     // process user order after pay
     do_action('ae_select_process_payment', $payment_return, $data);
     $this->member_payment_process($payment_return, $data);
     //  if not exist post id
     if (!isset($data['ad_id']) || !$data['ad_id']) {
         return $payment_return;
     }
     $options = AE_Options::get_instance();
     $ad_id = $data['ad_id'];
     extract($data);
     if (!$payment_return['ACK']) {
         return;
     }
     $post = get_post($ad_id);
     /**
      * get object by post type and convert
      */
     $post_obj = $ae_post_factory->get($post->post_type);
     $ad = $post_obj->convert($post);
     if ($payment_type != 'usePackage') {
         /**
          * update seller package quantity
          */
         AE_Package::update_package_data($ad->et_payment_package, $ad->post_author);
         if (!is_super_admin()) {
             $post_data = array('ID' => $ad_id, 'post_status' => 'pending');
         } else {
             $post_data = array('ID' => $ad_id, 'post_status' => 'publish');
         }
     }
     // disable pending and auto publish post
     /** @var string $payment_type */
     if (!$options->use_pending && 'cash' != $payment_type) {
         $post_data['post_status'] = 'publish';
     }
     // when buy new package will got and order
     if (isset($data['order_id'])) {
         // update post order id
         update_post_meta($ad_id, 'et_ad_order', $data['order_id']);
     }
     // Change Status Publish places that posted by Admin
     if (is_super_admin()) {
         wp_update_post(array('ID' => $ad_id, 'post_status' => 'publish'));
     }
     switch ($payment_type) {
         case 'cash':
             wp_update_post($post_data);
             // update unpaid payment
             update_post_meta($ad_id, 'et_paid', 0);
             return $payment_return;
         case 'free':
             wp_update_post($post_data);
             // update free payment
             update_post_meta($ad_id, 'et_paid', 2);
             return $payment_return;
         case 'usePackage':
             return $payment_return;
         default:
             // code...
             break;
     }
     /**
      * payment succeed
      */
     if ('PENDING' != strtoupper($payment_return['payment_status'])) {
         wp_update_post($post_data);
         // paid
         update_post_meta($ad_id, 'et_paid', 1);
     } else {
         /**
          * in some case the payment will be pending
          */
         wp_update_post(array('ID' => $ad_id, 'post_status' => 'pending'));
         // unpaid
         update_post_meta($ad_id, 'et_paid', 0);
     }
     return $payment_return;
 }
 function update_site_branding($attach_data, $data)
 {
     switch ($data) {
         case 'site_logo':
         case 'mobile_icon':
         case 'mobile_logo':
         case 'pre_loading':
         case 'default_avatar':
         case 'default_thumbnail_img':
             $options = AE_Options::get_instance();
             // save this setting to theme options
             $options->{$data} = $attach_data;
             $options->save();
             break;
         default:
             # code...
             break;
     }
 }
Example #27
0
 /**
  * update branding : logo, mobile icon
  */
 function upload_image()
 {
     $res = array('success' => FALSE, 'msg' => __('There is an error occurred', ET_DOMAIN), 'code' => 400);
     // check fileID
     if (!isset($_POST['fileID']) || empty($_POST['fileID']) || !isset($_POST['imgType']) || empty($_POST['imgType'])) {
         $res['msg'] = __('Missing image ID', ET_DOMAIN);
     } else {
         $fileID = $_POST["fileID"];
         $imgType = $_POST['imgType'];
         // check ajax nonce
         if (!de_check_ajax_referer($imgType . '_et_uploader', FALSE, FALSE) && !check_ajax_referer($imgType . '_et_uploader', FALSE, FALSE)) {
             $res['msg'] = __('Security error!', ET_DOMAIN);
         } elseif (isset($_FILES[$fileID])) {
             // handle file upload
             $attach_id = et_process_file_upload($_FILES[$fileID], 0, 0, array('jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tif|tiff' => 'image/tiff'));
             if (!is_wp_error($attach_id)) {
                 try {
                     $attach_data = et_get_attachment_data($attach_id);
                     $options = AE_Options::get_instance();
                     // save this setting to theme options
                     // $options->$imgType = $attach_data;
                     // $options->save();
                     /**
                      * do action to control how to store data
                      *
                      * @param $attach_data the array of image data
                      * @param $request     ['data']
                      * @param $attach_id   the uploaded file id
                      */
                     do_action('ae_upload_image', $attach_data, $_POST['data'], $attach_id);
                     $res = array('success' => TRUE, 'msg' => __('Branding image has been uploaded successfully', ET_DOMAIN), 'data' => $attach_data);
                 } catch (Exception $e) {
                     $res['msg'] = __('Error when updating settings.', ET_DOMAIN);
                 }
             } else {
                 $res['msg'] = $attach_id->get_error_message();
             }
         } else {
             $res['msg'] = __('Uploaded file not found', ET_DOMAIN);
         }
     }
     // send json to client
     wp_send_json($res);
 }