'CustomHTML-1', 'enabled' => strpos('personal,business', $this->config['license']) !== false, 'image' => 'plugins/images/tabs/custom1.png', 'category' => 'Custom', 'settings' => array( 'Enable' => array( array( 'type' => 'switch', 'name' => 'homepageCustomHTMLoneEnabled', 'label' => 'Enable', 'value' => $this->config['homepageCustomHTMLoneEnabled'] ), array( 'type' => 'select', 'name' => 'homepageCustomHTMLoneAuth', 'label' => 'Minimum Authentication', 'value' => $this->config['homepageCustomHTMLoneAuth'], 'options' => $this->groupOptions ) ), 'Code' => array( array( 'type' => 'textbox', 'name' => 'customHTMLone', 'class' => 'hidden customHTMLoneTextarea', 'label' => '', 'value' => $this->config['customHTMLone'], ), array( 'type' => 'html', 'override' => 12, 'label' => 'Custom HTML/JavaScript', 'html' => '
' . htmlentities($this->config['customHTMLone']) . '
' ), ) ) ); } public function htmlTwoSettingsArray() { return array( 'name' => 'CustomHTML-2', 'enabled' => strpos('personal,business', $this->config['license']) !== false, 'image' => 'plugins/images/tabs/custom2.png', 'category' => 'Custom', 'settings' => array( 'Enable' => array( array( 'type' => 'switch', 'name' => 'homepageCustomHTMLtwoEnabled', 'label' => 'Enable', 'value' => $this->config['homepageCustomHTMLtwoEnabled'] ), array( 'type' => 'select', 'name' => 'homepageCustomHTMLtwoAuth', 'label' => 'Minimum Authentication', 'value' => $this->config['homepageCustomHTMLtwoAuth'], 'options' => $this->groupOptions ) ), 'Code' => array( array( 'type' => 'textbox', 'name' => 'customHTMLtwo', 'class' => 'hidden customHTMLtwoTextarea', 'label' => '', 'value' => $this->config['customHTMLtwo'], ), array( 'type' => 'html', 'override' => 12, 'label' => 'Custom HTML/JavaScript', 'html' => '
' . htmlentities($this->config['customHTMLtwo']) . '
' ), ) ) ); } public function htmlHomepagePermissions($key = null) { $permissions = [ 'one' => [ 'enabled' => [ 'homepageCustomHTMLoneEnabled' ], 'auth' => [ 'homepageCustomHTMLoneAuth' ], 'not_empty' => [ 'customHTMLone' ] ], 'two' => [ 'enabled' => [ 'homepageCustomHTMLtwoEnabled' ], 'auth' => [ 'homepageCustomHTMLtwoAuth' ], 'not_empty' => [ 'customHTMLtwo' ] ] ]; if (array_key_exists($key, $permissions)) { return $permissions[$key]; } elseif ($key == 'all') { return $permissions; } else { return []; } } public function homepageOrdercustomhtml() { if ($this->homepageItemPermissions($this->htmlHomepagePermissions('one'))) { return '
' . $this->config['customHTMLone'] . '
'; } } public function homepageOrdercustomhtmlTwo() { if ($this->homepageItemPermissions($this->htmlHomepagePermissions('two'))) { return '
' . $this->config['customHTMLtwo'] . '
'; } } }