コード例 #1
0
 /**
  * Constructor
  */
 function __construct()
 {
     parent::__construct();
     // Load the database and execute our sql file
     $this->db = JFactory::getDBO();
     // Get information of our plugin so we can pass it on to MDS Collivery for Logs
     $sel_query = "SELECT * FROM `#__extensions` where type = 'plugin' and element = 'mds_shipping' and folder = 'vmshipment';";
     $this->db->setQuery($sel_query);
     $this->db->query();
     $this->extension_id = $this->db->loadObjectList()[0]->extension_id;
     $this->app_name = $this->db->loadObjectList()[0]->extension_id;
     $this->app_info = json_decode($this->db->loadObjectList()[0]->manifest_cache);
     // Get our login information
     $config_query = "SELECT * FROM `#__mds_collivery_config` where id = 1;";
     $this->db->setQuery($config_query);
     $this->db->query();
     $this->password = $this->db->loadObjectList()[0]->password;
     $this->username = $this->db->loadObjectList()[0]->username;
     $version = new JVersion();
     require_once preg_replace('|com_installer|i', "", JPATH_COMPONENT_ADMINISTRATOR) . '/helpers/config.php';
     $config = array('app_name' => $this->app_info->name, 'app_version' => $this->app_info->version, 'app_host' => "Joomla: " . $version->getShortVersion() . ' - Virtuemart: ' . VmConfig::getInstalledVersion(), 'app_url' => JURI::base(), 'user_email' => $this->username, 'user_password' => $this->password);
     // Use the MDS API Files
     require_once JPATH_PLUGINS . '/vmshipment/mds_shipping/Mds/Cache.php';
     require_once JPATH_PLUGINS . '/vmshipment/mds_shipping/Mds/Collivery.php';
     $this->collivery = new Mds\Collivery($config);
 }
コード例 #2
0
ファイル: view.pdf.php プロジェクト: jdrzaic/joomla-dummy
 function __construct($config = array())
 {
     $config['base_path'] = JPATH_COMPONENT_SITE;
     parent::__construct($config);
 }