images
12 years ago
class-wpfront-base-menu.php
12 years ago
class-wpfront-base.php
12 years ago
class-wpfront-options-base.php
12 years ago
class-wpfront-static.php
12 years ago
class-wpfront-static.php
64 lines
| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | WPFront Plugins Static Helpers |
| 5 | Copyright (C) 2013, WPFront.com |
| 6 | Website: wpfront.com |
| 7 | Contact: syam@wpfront.com |
| 8 | |
| 9 | WPFront Plugins are distributed under the GNU General Public License, Version 3, |
| 10 | June 2007. Copyright (C) 2007 Free Software Foundation, Inc., 51 Franklin |
| 11 | St, Fifth Floor, Boston, MA 02110, USA |
| 12 | |
| 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 20 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 23 | */ |
| 24 | |
| 25 | if (!class_exists('WPFront_Static')) { |
| 26 | |
| 27 | /** |
| 28 | * Plugin framework static helpers |
| 29 | * |
| 30 | * @author Syam Mohan <syam@wpfront.com> |
| 31 | * @copyright 2013 WPFront.com |
| 32 | */ |
| 33 | class WPFront_Static { |
| 34 | |
| 35 | public static function is_admin_bar_showing() { |
| 36 | if (function_exists('is_admin_bar_showing')) { |
| 37 | return is_admin_bar_showing(); |
| 38 | } |
| 39 | |
| 40 | return FALSE; |
| 41 | } |
| 42 | |
| 43 | public static function self_admin_url($path = '', $scheme = 'admin') { |
| 44 | if (function_exists('self_admin_url')) |
| 45 | return self_admin_url($path, $scheme); |
| 46 | |
| 47 | return admin_url($path, $scheme); |
| 48 | } |
| 49 | |
| 50 | public static function doing_ajax() { |
| 51 | if (defined('DOING_AJAX') && DOING_AJAX) { |
| 52 | return TRUE; |
| 53 | } |
| 54 | |
| 55 | if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { |
| 56 | return TRUE; |
| 57 | } |
| 58 | |
| 59 | return FALSE; |
| 60 | } |
| 61 | |
| 62 | } |
| 63 | |
| 64 | } |