'https://bludit.com', 'Donate'=>'https://paypal.me/bludit' )); // Fields and default values for the database of this plugin $this->dbFields = array( 'label'=>'Links', 'jsondb'=>$jsondb ); } public function post() { $jsondb = $this->getValue('jsondb', $unsanitized=false); $links = json_decode($jsondb, true); $name = $_POST['linkName']; $url = $_POST['linkURL']; $links[$url] = $name; $this->db['jsondb'] = json_encode($links); $this->save(); } // Method called on plugin settings on the admin area public function form() { global $Language; $html = '
'; $html .= ''; $html .= ''; $html .= '
'; // Get the JSON DB, getValue() with the option unsanitized HTML code $jsondb = $this->getValue('jsondb', $unsanitized=false); $links = json_decode($jsondb, true); foreach($links as $name=>$url) { $html .= '
'; $html .= ''; $html .= ''; $html .= '
'; } $html .= '
'; $html .= 'Nombre '; $html .= '
URL '; $html .= '
'; return $html; } // Method called on the sidebar of the website public function siteSidebar() { global $Language; // HTML for sidebar $html = '
'; $html .= '

'.$this->getValue('label').'

'; $html .= '
'; $html .= ''; $html .= '
'; $html .= '
'; return $html; } }