| 1 |
<?php |
| 2 |
|
| 3 |
namespace LWS\WOOREWARDS; |
| 4 |
|
| 5 |
// don't call the file directly |
| 6 |
if (!defined('ABSPATH')) exit(); |
| 7 |
|
| 8 |
/** All Documentation Links*/ |
| 9 |
class DocLinks |
| 10 |
{ |
| 11 |
const FALLBACK = 'home'; |
| 12 |
|
| 13 |
public static $doclinks = array( |
| 14 |
'adv-features' => "https://plugins.longwatchstudio.com/kb/combining-systems/", |
| 15 |
'customers' => "https://plugins.longwatchstudio.com/kb/customers-management/", |
| 16 |
'disp-points' => "https://plugins.longwatchstudio.com/kb/wr-sc-points-information/", |
| 17 |
'home' => "https://plugins.longwatchstudio.com/kbtopic/wr/", |
| 18 |
'points' => "https://plugins.longwatchstudio.com/kb/spend-money/", |
| 19 |
'pools' => "https://plugins.longwatchstudio.com/kb/how-it-works/", |
| 20 |
'referral' => "https://plugins.longwatchstudio.com/kb/referral-sponsorship/", |
| 21 |
'rewards' => "https://plugins.longwatchstudio.com/kb/points-on-cart/", |
| 22 |
'past-orders' => "https://plugins.longwatchstudio.com/kb/process-past-orders/", |
| 23 |
); |
| 24 |
|
| 25 |
static function get($index=false, $escape = true) |
| 26 |
{ |
| 27 |
if (!($index && isset(self::$doclinks[$index]))) |
| 28 |
$index = self::FALLBACK; |
| 29 |
if ($escape) |
| 30 |
return \esc_attr(self::$doclinks[$index]); |
| 31 |
else |
| 32 |
return self::$doclinks[$index]; |
| 33 |
} |
| 34 |
|
| 35 |
static function toFields() |
| 36 |
{ |
| 37 |
$fields = array(); |
| 38 |
$prefix = (__CLASS__ . ':'); |
| 39 |
foreach (self::$doclinks as $key => $url) { |
| 40 |
$fields[$key] = array( |
| 41 |
'id' => $prefix . $key, |
| 42 |
'title' => $key, |
| 43 |
'type' => 'custom', |
| 44 |
'extra' => array( |
| 45 |
'gizmo' => true, |
| 46 |
'content' => sprintf('<a href="%s" target="_blank">%s</a>', \esc_attr($url), $url), |
| 47 |
), |
| 48 |
); |
| 49 |
} |
| 50 |
return $fields; |
| 51 |
} |
| 52 |
} |