function xlii_smt_adminpage_ga() { if (isset($_POST['save'])) { xlii_smt_adminprocess_ga(); } $settings = _xlii_smt_ga_options(); if (!$settings['code']) { $settings['code'] = "var _gaq = _gaq || [];\n _gaq.push(['_setAccount', 'XX-XXXXXXXX-X']);\n _gaq.push(['_trackPageview']);\n\n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();"; } ?> <form action="<?php echo esc_attr($_SERVER['REQUEST_URI']); ?> " method="post"> <div class="wrap"> <?php screen_icon(); ?> <h2><?php _e('Social Media Tracker'); ?> </h2> <?php _xlii_smt_notify(); _xlii_smt_navigation(); ?> <div id = "xlii-admin" class = "analytics"> <?php echo '<div class = "form"> <div class = "row">' . XLII_GUIFactory::textarea(array('label' => __('Analytics code'), 'name' => 'code', 'value' => $settings['code'], 'style' => 'width:600px;height:250px;')) . '</div> <div class = "row">' . XLII_GUIFactory::checkbox(array('label' => __('Track button interaction'), 'value' => $settings['tracking'], 'name' => 'tracking')) . ' <p class = "description">' . __('You can check this box if you\'d like to track the interaction with the social media buttons.') . '</p> </div> <div class = "row">' . XLII_GUIFactory::checkbox(array('label' => __('Append code to website'), 'value' => $settings['enabled'], 'name' => 'enabled')) . ' <p class = "description">' . __('In order to work propperly the Social Media Tracking plugin requires a valid Google Analytics code to be implemented on your website. In case you didn\'t implemented this code already our plugin can do it for you, the only thing you have to do is to') . ' <label for = "enabled" class = "link">click here</label> ' . __('and replace XX-XXXXXXXX-X in the sample by your own code.') . ' </p> <p class = "description"> <span style = "margin-top:-10px;">' . __('Your tracking code can be found in your Google Analytics panel.') . '</span> <img src = "' . XLII_SMT_BASE . 'media/gacode.png" alt = "Tracking code" title = "Tracking code" style = "vertical-align:baseline;" /> </p> </div> ' . XLII_GUIFactory::submit(array('label' => __('Save state'), 'name' => 'save')) . ' </div>'; ?> </div> </div> </form> <?php }
/** _GET FORM --------------------------------------------------------------------------------------------------------------------------------------------- * Render a form to give this button custom options, inner helper method of @see form. This is the only way a form can be overloaded. * * @return string */ protected function _getForm() { return '<strong>Layout</strong>' . '<div class = "buttonselect">' . XLII_GUIFactory::radio(array('name' => $this->_field('button'), 'value' => $this->option('button'), 'options' => array('standard' => '<span class = "xlii-icon facebook plain"></span><span class = "icontext">... people like this. Be the first of your friends.</span>', 'button_count' => '<span class = "xlii-icon facebook horizontal"></span>', 'box_count' => '<span class = "xlii-icon facebook vertical"></span>'))) . '</div>' . XLII_GUIFactory::checkbox(array('name' => $this->_field('send'), 'value' => $this->option('send'), 'label' => __('Include send button'))); }