Пример #1
0
        /**
         * Returns the heading of a certain box type.
         *
         * This heading contains the title of the box and a beautiful icon.
         *
         * @param string $type the type of the heading we want to create.
         *
         * @return string the heading of a certain box type.
         *
         * @since 4.1.3
         */
        protected function get_action_heading($type)
        {
            switch ($type) {
                case 'basic-info':
                    $icon = nelioab_admin_asset_link('/images/freetrial-mail.png');
                    $aux = __('Your Basic Information (%s)', 'nelioab');
                    $alt = __('You and Your E-Mail', 'nelioab');
                    $num = 100;
                    break;
                case 'tweet':
                    $icon = nelioab_admin_asset_link('/images/freetrial-twitter.png');
                    $aux = __('Tweet About Us (%s)', 'nelioab');
                    $alt = __('Twitter', 'nelioab');
                    $num = 200;
                    break;
                case 'site-info':
                    $icon = nelioab_admin_asset_link('/images/freetrial-site.png');
                    $aux = __('Information About Your Site (%s)', 'nelioab');
                    $alt = __('Tiny form about your site', 'nelioab');
                    $num = 100;
                    break;
                case 'connect':
                    $icon = nelioab_admin_asset_link('/images/freetrial-facebook.png');
                    $aux = __('Like Our Facebook Profile (%s)', 'nelioab');
                    $alt = __('Facebook', 'nelioab');
                    $num = 200;
                    break;
                case 'recommend':
                    $icon = nelioab_admin_asset_link('/images/freetrial-friends.png');
                    $aux = __('Recommend Us to Your Friends (%s)', 'nelioab');
                    $alt = __('Friends', 'nelioab');
                    $num = 100;
                    break;
                case 'goals':
                    $icon = nelioab_admin_asset_link('/images/freetrial-life-goals.png');
                    $aux = __('The Goals You Pursue (%s)', 'nelioab');
                    $alt = __('Goals', 'nelioab');
                    $num = 200;
                    break;
                case 'subscribe':
                    $icon = nelioab_admin_asset_link('/images/freetrial-subscribe.png');
                    $aux = __('Subscribe to Nelio A/B Testing (%s)', 'nelioab');
                    $alt = __('Subscribe', 'nelioab');
                    $num = 5000;
                    break;
            }
            $num = '+' . number_format_i18n($num);
            $title = sprintf($aux, $num);
            $completed_title = sprintf($aux, __('Done!', 'nelioab'));
            $completed_icon = nelioab_admin_asset_link('/images/action-completed.png');
            // Workaround for BASIC INFO (which might use Confirmation...)
            if ('basic-info' === $type) {
                if (NelioABAccountSettings::is_promo_completed('basic-info')) {
                    $icon = nelioab_admin_asset_link('/images/action-pending.png');
                } else {
                    $completed_icon = nelioab_admin_asset_link('/images/action-pending.png');
                }
                $type = 'basic-info-check';
                $completed_title = sprintf($aux, __('Awaiting Confirmation...', 'nelioab'));
            }
            // End of the workaround
            if (NelioABAccountSettings::is_promo_completed($type)) {
                $animation = '';
            } else {
                $animation = 'animated flipInY';
            }
            $html = <<<HTML
\t\t\t<span class="nelio-freetrial-heading regular">
\t\t\t\t<img width="32" height="32" src="{$icon}" alt="{$alt}"/>
\t\t\t\t<span>{$title}</span>
\t\t\t</span>
\t\t\t<span class="nelio-freetrial-heading completed">
\t\t\t\t<img class="{$animation}" width="32" height="32" src="{$completed_icon}" alt="{$alt}"/>
\t\t\t\t<span>{$completed_title}</span>
\t\t\t</span>
HTML;
            return $html;
        }