Esempio n. 1
0
    private function buildSettings()
    {
        $html = null;
        foreach ($this->tabs as $name => $options) {
            $slug = sanitize_title($name);
            $html .= '<tbody data-tab="#' . $slug . '">';
            # Output each option
            foreach ($options as $o) {
                $name = $o['name'];
                $slug = sanitize_title($name);
                $type = sanitize_title($o['type']);
                $desc = sanitize_text_field($o['desc']);
                $value = BackEnd::getOption($slug);
                # Build the input type (text, textarea)
                switch ($type) {
                    case 'text':
                        $field = <<<S
<input
\tid="r[{$slug}]"
\tclass="regular-text"
\ttype="text"
\tname="r[{$slug}]"
\tplaceholder="Enter value&hellip;"
\tvalue="{$value}" />
S;
                        break;
                    case 'textarea':
                        $field = <<<S
<textarea
\tid="r[{$slug}]"
\tcols="90"
\trows="5"
\tname="r[{$slug}]"
\tplaceholder="Enter value&hellip;">{$value}</textarea>
S;
                        break;
                }
                # Parse the HTML for this option
                $html .= <<<S
<tr>
\t<th>
\t\t<label for="{$slug}">{$name}</label>
\t</th>

\t<td>
\t\t{$field}
\t\t<br />
\t\t<span class="description">{$desc}</span>
\t</td>
</tr>
S;
            }
        }
        return $html;
    }
Esempio n. 2
0
 public static function loop($callback, $query)
 {
     $result = BackEnd::getPostType('', $query);
     if ($result->have_posts()) {
         while ($result->have_posts()) {
             $result->the_post();
             if (is_callable($callback)) {
                 $callback();
             } elseif (file_exists(TEMPLATEPATH . '/build-' . $callback . '.php')) {
                 get_template_part('build', $callback);
             } else {
                 throw new Exception(__METHOD__ . ' - ' . $callback . ' is not a valid callback.');
             }
         }
         wp_reset_query();
     } else {
         throw new Exception(__METHOD__ . 'No posts found');
     }
 }
Esempio n. 3
0
 public function __construct()
 {
     self::$options = get_option('r');
 }
Esempio n. 4
0
<?php

/**
 * HTW
 *
 * Sidebar: left (default)
 */
?>

<aside class="left sidebar" role="complementary" itemscope itemtype="http://schema.org/WPSideBar">
<?php 
BackEnd::getMenu('main');
?>
</aside>
Esempio n. 5
0
 HowTradingWorks.com
		</p>
	</div>

	<div class="s6 right align-right">
		<p>Trading is risky and you are solely responsible for your success and any failures.</p>
	</div>
</footer>

<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-10405648-14', 'auto');
ga('send', 'pageview');
</script>

<?php 
echo BackEnd::getOption('extra-scripts');
wp_footer();
?>

<script src="<?php 
echo bowerDir;
?>
/materialize/js/waves.js"></script>

</body>
</html>