PluginProbe
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments / 4.3.2
SureCart – Ecommerce Made Easy For Selling Physical Products, Digital Downloads, Subscriptions, Donations, & Payments v4.3.2
4.7.2 4.7.1 4.7.0 4.6.6 4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.1 4.5.0 4.4.2 4.4.1 4.4.0 4.3.3 4.3.2 4.3.1 4.3.0 4.2.3 4.2.2 4.2.1 1.0.3 1.0.4 1.0.5 All 281 releases
surecart / app / src / Controllers / Admin / Learn / LearnScriptsController.php
LearnScriptsController.php
51 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace SureCart\Controllers\Admin\Learn;
4
5 use SureCart\Models\Processor;
6 use SureCart\Support\Scripts\AdminModelEditController;
7
8 /**
9 * Learn page scripts.
10 */
11 class LearnScriptsController extends AdminModelEditController {
12 /**
13 * What types of data to add the the page.
14 *
15 * @var array
16 */
17 protected $with_data = [ 'currency', 'supported_currencies' ];
18
19 /**
20 * Script handle.
21 *
22 * @var string
23 */
24 protected $handle = 'surecart/scripts/admin/learn';
25
26 /**
27 * Script path.
28 *
29 * @var string
30 */
31 protected $path = 'admin/settings/learn';
32
33 /**
34 * Enqueue scripts with additional learn-specific data.
35 *
36 * @return void
37 */
38 public function enqueue() {
39 $this->data['processors'] = Processor::get();
40 $this->data['brand_logo_url'] = \SureCart::account()->brand->logo_url ?? null;
41 $this->data['brand_color'] = \SureCart::account()->brand->color ?? null;
42 $this->data['shop_page_edit_url'] = \SureCart::pages()->getId( 'shop' )
43 ? admin_url( 'post.php?post=' . \SureCart::pages()->getId( 'shop' ) . '&action=edit' )
44 : '';
45 $this->data['dashboard_page_edit_url'] = \SureCart::pages()->getId( 'dashboard' )
46 ? admin_url( 'post.php?post=' . \SureCart::pages()->getId( 'dashboard' ) . '&action=edit' )
47 : '';
48 parent::enqueue();
49 }
50 }
51