diff --git a/bmlt-versions.php b/bmlt-versions.php index 53e861d..197b14e 100644 --- a/bmlt-versions.php +++ b/bmlt-versions.php @@ -46,11 +46,13 @@ public function bmltVersionsRegisterSettings() add_option('yapDoc', 'Yap Documentation Link'); add_option('breadDoc', 'Bread Documentation Link'); add_option('bmltVersionsGithubApiKey', 'Github API Key.'); + add_option('workflowDoc', 'BMLT Workflow Documentation Link'); register_setting('bmltVersionsOptionGroup', 'bmltVersionsGithubApiKey', 'bmltVersionsCallback'); register_setting('bmltVersionsOptionGroup', 'rootServerDoc', 'bmltVersionsCallback'); register_setting('bmltVersionsOptionGroup', 'croutonDoc', 'bmltVersionsCallback'); register_setting('bmltVersionsOptionGroup', 'yapDoc', 'bmltVersionsCallback'); register_setting('bmltVersionsOptionGroup', 'breadDoc', 'bmltVersionsCallback'); + register_setting('bmltVersionsOptionGroup', 'workflowDoc', 'bmltVersionsCallback'); } public function bmltVersionsOptionsPage() @@ -90,6 +92,11 @@ public function bmltVersionsAdminOptionsPage() + + + + + @@ -110,6 +117,7 @@ public function bmltVersionsSimpleFunc($atts = []) 'crouton' => '1', 'bread' => '1', 'yap' => '1', + 'workflow' => '1', 'sort_by' => 'date' ), $atts @@ -119,12 +127,14 @@ public function bmltVersionsSimpleFunc($atts = []) $crouton = sanitize_text_field($args['crouton']); $bread = sanitize_text_field($args['bread']); $yap = sanitize_text_field($args['yap']); + $workflow = sanitize_text_field($args['workflow']); $sort_by = sanitize_text_field($args['sort_by']); $rootServerDocs = get_option('rootServerDoc'); $croutonDocs = get_option('croutonDoc'); $breadDocs = get_option('breadDoc'); $yapDocs = get_option('yapDoc'); + $workflowDocs = get_option('workflowDoc'); $content = ''; $releases = []; @@ -152,11 +162,11 @@ public function bmltVersionsSimpleFunc($atts = []) $root_server_content .= '
  • '; $root_server_content .= 'View On Github'; $root_server_content .= '
  • '; - + $root_server_content .= '
  • '; $root_server_content .= 'Download Latest Release'; $root_server_content .= '
  • '; - + $root_server_content .= ''; $root_server_content .= ''; $releases[0]['content'] = $root_server_content; @@ -189,11 +199,11 @@ public function bmltVersionsSimpleFunc($atts = []) $crouton_content .= '
  • '; $crouton_content .= 'View On Github'; $crouton_content .= '
  • '; - + $crouton_content .= '
  • '; $crouton_content .= 'Download Latest Release'; $crouton_content .= '
  • '; - + $crouton_content .= ''; $crouton_content .= ''; $releases[4]['content'] = $crouton_content; @@ -226,11 +236,11 @@ public function bmltVersionsSimpleFunc($atts = []) $bread_content .= '
  • '; $bread_content .= 'View On Github'; $bread_content .= '
  • '; - + $bread_content .= '
  • '; $bread_content .= 'Download Latest Release'; $bread_content .= '
  • '; - + $bread_content .= ''; $bread_content .= ''; $releases[5]['content'] = $bread_content; @@ -263,11 +273,11 @@ public function bmltVersionsSimpleFunc($atts = []) $yap_content .= '
  • '; $yap_content .= 'View On Github'; $yap_content .= '
  • '; - + $yap_content .= '
  • '; $yap_content .= 'Download Latest Release'; $yap_content .= '
  • '; - + $yap_content .= ''; $yap_content .= ''; $releases[12]['content'] = $yap_content; @@ -276,6 +286,43 @@ public function bmltVersionsSimpleFunc($atts = []) $releases[12]['version'] = $yap_version; } + if ($workflow) { + $workflow_content = '
    '; + $workflow_content .= ''; + $workflow_content .= '
    '; + $releases[13]['content'] = $workflow_content; + $releases[13]['name'] = "workflow"; + $releases[13]['date'] = strtotime($workflow_date); + $releases[13]['version'] = $workflow_version; + } + if ($sort_by == "name") { usort($releases, function ($a, $b) { return strnatcasecmp($a['name'], $b['name']); @@ -300,6 +347,7 @@ public function bmltVersionsFunc($atts = []) 'basic' => '1', 'crouton' => '1', 'bread' => '1', + 'workflow' => '1', 'yap' => '1', 'tabbed_map' => '1', 'meeting_map' => '1', @@ -319,6 +367,7 @@ public function bmltVersionsFunc($atts = []) $crouton = sanitize_text_field($args['crouton']); $bread = sanitize_text_field($args['bread']); $yap = sanitize_text_field($args['yap']); + $workflow = sanitize_text_field($args['workflow']); $tabbed_map = sanitize_text_field($args['tabbed_map']); $meeting_map = sanitize_text_field($args['meeting_map']); $list_locations = sanitize_text_field($args['list_locations']); @@ -577,6 +626,27 @@ public function bmltVersionsFunc($atts = []) $releases[12]['date'] = strtotime($yap_date); $releases[12]['version'] = $yap_version; } + + if ($workflow) { + $workflow_content = '
    '; + $workflow_content .= ''; + $workflow_content .= '
    '; + $releases[13]['content'] = $workflow_content; + $releases[13]['name'] = "workflow"; + $releases[13]['date'] = strtotime($workflow_date); + $releases[13]['version'] = $workflow_version; + } + if ($sort_by == "name") { usort($releases, function ($a, $b) { return strnatcasecmp($a['name'], $b['name']);