1 | <?php
|
---|
2 | /**
|
---|
3 | * Copyright 2006, 2007, 2008, 2009 Eric D. Hough (http://ehough.com)
|
---|
4 | *
|
---|
5 | * This file is part of TubePress (http://tubepress.org)
|
---|
6 | *
|
---|
7 | * TubePress is free software: you can redistribute it and/or modify
|
---|
8 | * it under the terms of the GNU General Public License as published by
|
---|
9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
10 | * (at your option) any later version.
|
---|
11 | *
|
---|
12 | * TubePress is distributed in the hope that it will be useful,
|
---|
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | * GNU General Public License for more details.
|
---|
16 | *
|
---|
17 | * You should have received a copy of the GNU General Public License
|
---|
18 | * along with TubePress. If not, see <http://www.gnu.org/licenses/>.
|
---|
19 | *
|
---|
20 | */
|
---|
21 |
|
---|
22 | function tubepress_admin_menu_hook()
|
---|
23 | {
|
---|
24 | if (function_exists('add_options_page')) {
|
---|
25 | add_options_page("TubePress Options", "TubePress", 9,
|
---|
26 | __FILE__, '_tubepress_admin_menu_hook');
|
---|
27 | }
|
---|
28 | }
|
---|
29 |
|
---|
30 | function _tubepress_admin_menu_hook()
|
---|
31 | {
|
---|
32 | if (version_compare(PHP_VERSION, '5.0.0', '>=')) {
|
---|
33 | function_exists("__tp_executeOptionsPage")
|
---|
34 | || require "options_page_php5.php";
|
---|
35 | __tp_executeOptionsPage();
|
---|
36 | } else {
|
---|
37 | print <<<EOT
|
---|
38 | <div id="message" class="error fade">
|
---|
39 | <p>
|
---|
40 | <strong>
|
---|
41 | This version of TubePress requires PHP5 or higher.
|
---|
42 | Please <a href="http://php.net">upgrade your PHP installation</a>
|
---|
43 | or visit <a href="http://tubepress.org">tubepress.org</a> to obtain
|
---|
44 | a different version of the plugin.
|
---|
45 | </strong>
|
---|
46 | </p>
|
---|
47 | </div>
|
---|
48 | EOT
|
---|
49 | ;
|
---|
50 | }
|
---|
51 | }
|
---|
52 | function tubepress_admin_head_hook()
|
---|
53 | {
|
---|
54 | global $tubepress_base_url;
|
---|
55 | $jsColorFile = $tubepress_base_url . "/ui/options_page/js/jscolor/jscolor.js";
|
---|
56 | echo '<script type="text/javascript" src="' . $jsColorFile . '"></script>';
|
---|
57 | } |
---|