Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2008
    Posts
    19
    Plugin Contributions
    1

    Default Pulling in front end classes into admin for plugins

    So I wanted to use MobileDetect inside an admin plugin page.

    This is a class inside front end

    I am guessing that I can pull it in via an auto loader.

    But will this break things if another plugin also pulls it in and how should this be managed?

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,595
    Plugin Contributions
    88

    Default Re: Pulling in front end classes into admin for plugins

    Quote Originally Posted by hellsbit View Post
    So I wanted to use MobileDetect inside an admin plugin page.

    This is a class inside front end

    I am guessing that I can pull it in via an auto loader.

    But will this break things if another plugin also pulls it in and how should this be managed?
    That class is not "normally" used on the admin-side, so unless you have multiple plugins that might be installed and all need that class you should be OK.

    For multiple plugins that "might" be installed, you can use the following section in each:
    PHP Code:
    if (!class_exists('MobileDetect')) {
        require 
    DIR_FS_CATALOG DIR_WS_CLASSES 'MobileDetect.php';


  3. #3
    Join Date
    Apr 2006
    Location
    West Salem, IL
    Posts
    2,753
    Plugin Contributions
    0

    Default Re: Pulling in front end classes into admin for plugins

    and why would you use mobile detect? The admin use bootstrap....so code your admin interface using bootstrap classes
    Mike
    AEIIA - Zen Cart Certified & PCI Compliant Hosting
    The Zen Cart Forum...Better than a monitor covered with post-it notes!

  4. #4
    Join Date
    Mar 2008
    Posts
    19
    Plugin Contributions
    1

    Default Re: Pulling in front end classes into admin for plugins

    Because the page in question uses the camera on a mobile phone to scan barcodes but on pc it uses a barcode reader and it works already so why would I rewrite when I can just do what lat9 said

 

 

Similar Threads

  1. v151 login from front end using admin login for any customer?
    By gsmsalers in forum General Questions
    Replies: 11
    Last Post: 1 Oct 2013, 03:52 PM
  2. Reinstall: Functioning Admin...No Front End
    By ZC Newbie in forum Installing on a Windows Server
    Replies: 1
    Last Post: 9 Jan 2012, 10:56 AM
  3. Imported products missing from admin, but present for orders and front-end display
    By AustinThemes in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 20 Feb 2011, 09:48 AM
  4. Front-end admin?
    By jernej in forum General Questions
    Replies: 6
    Last Post: 10 Jan 2007, 12:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR