/** * Definizione della funzione costruttore che viene richiamata * nel momento della creazione di un'istanza con questa classe */ function __construct() { // Richiamo la funzione della classe padre per elaborare le // variabili contenenti i valori di configurazione sezione parent::__construct(); // Aggiungo il link di setting nella descrizione di plugin presente // sul pannello di amministrazione dopo attivazione e disattivazione if (is_admin()) { add_filter("plugin_action_links_" . plugin_basename(SZ_PLUGIN_GOOGLE_MAIN), array($this, 'AddPluginSetting')); } // Aggiungere il foglio stile e gli script javsscript nelle // pagine di amministrazione che servono al plugin stesso add_action('admin_enqueue_scripts', array($this, 'moduleAdminAddStyles')); add_action('admin_enqueue_scripts', array($this, 'moduleAdminAddScripts')); // Controllo le opzioni dei moduli da caricare e richiamo // il file di amministrazione necessario se risulta attivo $object = new SZGoogleModule(); $options = $object->getOptionsSet('sz_google_options_base'); if ($options['plus'] == '1') { new SZGoogleAdminPlus(); } if ($options['analytics'] == '1') { new SZGoogleAdminAnalytics(); } if ($options['authenticator'] == '1') { new SZGoogleAdminAuthenticator(); } if ($options['calendar'] == '1') { new SZGoogleAdminCalendar(); } if ($options['drive'] == '1') { new SZGoogleAdminDrive(); } if ($options['fonts'] == '1') { new SZGoogleAdminFonts(); } if ($options['groups'] == '1') { new SZGoogleAdminGroups(); } if ($options['hangouts'] == '1') { new SZGoogleAdminHangouts(); } if ($options['panoramio'] == '1') { new SZGoogleAdminPanoramio(); } if ($options['translate'] == '1') { new SZGoogleAdminTranslate(); } if ($options['youtube'] == '1') { new SZGoogleAdminYoutube(); } if ($options['documentation'] == '1') { new SZGoogleAdminDocumentation(); } }
/** * FORM display the widget in the management of * sidebar in the administration panel of wordpress */ function form($instance) { // Creating arrays for list fields that must be // present in the form before calling wp_parse_args() $array = array('title' => '', 'type' => '', 'id' => '', 'folderview' => '', 'single' => '', 'gid' => '', 'range' => '', 'start' => '', 'loop' => '', 'delay' => '', 'width' => '', 'width_auto' => '', 'height' => '', 'height_auto' => ''); // Creating arrays for list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Reading of the options for the control of default values // be assigned to the widget when it is placed in the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleDrive')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { $width = $options->drive_embed_w_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->drive_embed_w_height; } } // Setting any of the default parameters for the // fields that contain invalid values or inconsistent $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_drive.php"); if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['drive_embed_w_width']['value']; $width_auto = '1'; } if (!ctype_digit($height) or $height == 0) { $height = $DEFAULT['drive_embed_w_height']['value']; $height_auto = '1'; } // Calling the template for displaying the part // that concerns the administration panel (admin) @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
/** * Generation of the HTML code of the widget * for the full display in the sidebar associated */ function widget($args, $instance) { // Checking whether there are the variables that are used during the processing // the script and check the default values in case they were not specified $options = $this->common_empty(array('url' => '', 'width' => '', 'align' => '', 'title' => '', 'class1' => '', 'class2' => ''), $instance); // Definition of the control variables of the widget, these values // do not affect the items of basic but affect some aspects $controls = $this->common_empty(array('method' => '', 'width_auto' => ''), $instance); // Correction of the value of size is specified in // the case the automatically and then use javascript if ($controls['method'] == '1') { $options['url'] = ''; } if ($controls['width_auto'] == '1') { $options['width'] = 'auto'; } // Create the HTML code for the current widget recalling the basic // function which is also invoked by the corresponding shortcode if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusCommentsShortcode($options); } // Output HTML code linked to the widget to // display call to the general standard for wrap echo $this->common_widget($args, $instance, $HTML); }
/** * Generazione del codice HTML del widget per la * visualizzazione completa nella sidebar di appartenenza */ function widget($args, $instance) { // Controllo se esistono le variabili che servono durante l'elaborazione // dello script e assegno dei valori di default nel caso non fossero specificati $options = $this->common_empty(array('url' => '', 'width' => '', 'align' => '', 'title' => '', 'class1' => '', 'class2' => ''), $instance); // Definizione delle variabili di controllo del widget, questi valori non // interessano le opzioni della funzione base ma incidono su alcuni aspetti $controls = $this->common_empty(array('method' => '', 'width_auto' => ''), $instance); // Se sul widget ho escluso il badge dal pulsante azzero anche // le variabili del badge eventualmente impostate e memorizzate if ($controls['method'] == '1') { $options['url'] = ''; } if ($controls['width_auto'] == '1') { $options['width'] = 'auto'; } // Creazione del codice HTML per il widget attuale richiamando la // funzione base che viene richiamata anche dallo shortcode corrispondente if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusCommentsShortcode($options); } // Output del codice HTML legato al widget da visualizzare // chiamata alla funzione generale per wrap standard echo $this->common_widget($args, $instance, $HTML); }
/** * Visualizzazione FORM del widget presente nella gestione * delle sidebar nel pannello di amministrazione di wordpress */ function form($instance) { // Creazione array per elenco campi che devono essere // presenti nel form prima di richiamare wp_parse_args() $array = array('title' => '', 'name' => '', 'width' => '', 'width_auto' => '', 'height' => '', 'height_auto' => '', 'showsearch' => '', 'showtabs' => '', 'hideforumtitle' => '', 'hidesubject' => '', 'hl' => ''); // Creazione array per elenco campi da recuperare su FORM e // caricamento del file con il template HTML da visualizzare extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Lettura delle opzioni per il controllo dei valori di default // da assegnare al widget nel momento che viene inserito in sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleGroups')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { $width = $options->groups_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->groups_height; } } // Impostazione eventuale di parametri di default per i // campi che contengono dei valori non validi o non coerenti $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_groups.php"); if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['groups_width']['value']; $width_auto = '1'; } if (!ctype_digit($height) or $height == 0) { $height = $DEFAULT['groups_height']['value']; $height_auto = '1'; } // Richiamo il template per la visualizzazione della // parte che riguarda il pannello di amministrazione @(require dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(require dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
/** * Generazione del codice HTML del widget per la * visualizzazione completa nella sidebar di appartenenza */ function widget($args, $instance) { // Controllo se esistono le variabili che servono durante l'elaborazione // dello script e assegno dei valori di default nel caso non fossero specificati $options = $this->common_empty(array('url' => '', 'width' => '', 'size' => '', 'annotation' => '', 'float' => '', 'align' => '', 'text' => '', 'img' => '', 'position' => '', 'margintop' => '', 'marginright' => '', 'marginbottom' => '', 'marginleft' => '', 'marginunit' => ''), $instance); // Definizione delle variabili di controllo del widget, questi valori non // interessano le opzioni della funzione base ma incidono su alcuni aspetti $controls = $this->common_empty(array('badge' => '', 'urltype' => ''), $instance); // Se sul widget ho escluso il badge dal pulsante azzero anche // le variabili del badge eventualmente impostate e memorizzate if ($controls['badge'] != '1') { $options['img'] = ''; $options['text'] = ''; $options['position'] = ''; } // Se sul widget ho selezionato di calcolare l'indirizzo dal // post corrente annullo la variabile con eventuale indirizzo if ($controls['urltype'] != '1') { $options['url'] = ''; } // Creazione del codice HTML per il widget attuale richiamando la // funzione base che viene richiamata anche dallo shortcode corrispondente if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusPlusoneShortcode($options); } // Output del codice HTML legato al widget da visualizzare // chiamata alla funzione generale per wrap standard echo $this->common_widget($args, $instance, $HTML); }
/** * Reperire il riferimento oggetto del modulo richiamato * per facilitare il richiamo dei metodi da questa azione */ function getModuleObject($name) { if (!($object = SZGoogleModule::getObject($name))) { $object = new $name(); } return $object; }
/** * Generation of the HTML code of the widget * for the full display in the sidebar associated */ function widget($args, $instance) { // Checking whether there are the variables that are used during the processing // the script and check the default values in case they were not specified $options = $this->common_empty(array('url' => '', 'size' => '', 'width' => '', 'annotation' => '', 'float' => '', 'align' => '', 'text' => '', 'img' => '', 'position' => '', 'margintop' => '', 'marginright' => '', 'marginbottom' => '', 'marginleft' => '', 'marginunit' => ''), $instance); // Definition of the control variables of the widget, these values // do not affect the items of basic but affect some aspects $controls = $this->common_empty(array('badge' => '', 'urltype' => ''), $instance); // If the widget I excluded from the badge button I reset // the variables of the badge possibly set and saved if ($controls['badge'] != '1') { $options['img'] = ''; $options['text'] = ''; $options['position'] = ''; } // If the widget I selected to calculate the address from // the current post cancel the variable with any address if ($controls['urltype'] != '1') { $options['url'] = ''; } // Create the HTML code for the current widget recalling the basic // function which is also invoked by the corresponding shortcode if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusShareShortcode($options); } // Output HTML code linked to the widget to // display call to the general standard for wrap echo $this->common_widget($args, $instance, $HTML); }
function szgoogle_translate_get_object() { if (!SZGoogleModule::getObject('SZGoogleModuleTranslate')) { return false; } else { return SZGoogleModule::getObject('SZGoogleModuleTranslate'); } }
function szgoogle_analytics_get_ID() { if (!($object = SZGoogleModule::getObject('SZGoogleModuleAnalytics'))) { return false; } else { return $object->getGAId(); } }
/** * Wrapper function to get the configuration options * included in the admin panel that covers the module */ function getOptions() { if (!($object = SZGoogleModule::getObject('SZGoogleModulePlus'))) { return false; } else { return $object->getOptions(); } }
function szgoogle_gplus_get_object() { if (!SZGoogleModule::getObject('SZGoogleModulePlus')) { return false; } else { return SZGoogleModule::getObject('SZGoogleModulePlus'); } }
function szgoogle_youtube_get_object() { if (!SZGoogleModule::getObject('SZGoogleModuleYoutube')) { return false; } else { return SZGoogleModule::getObject('SZGoogleModuleYoutube'); } }
function szgoogle_authenticator_check_emergency() { if (!($object = SZGoogleModule::getObject('SZGoogleModuleAuthenticator'))) { return false; } else { return $object->checkEmergencyFile(); } }
/** * FORM display the widget in the management of * sidebar in the administration panel of wordpress */ function form($instance) { // Creating arrays for list fields that must be // present in the form before calling wp_parse_args() $array = array('title' => '', 'type' => '', 'method' => '', 'specific' => '', 'width' => '', 'width_auto' => '', 'align' => '', 'layout' => '', 'theme' => '', 'cover' => '', 'tagline' => '', 'publisher' => '', 'text' => '', 'image' => ''); // Creating arrays for list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Reading of the options for the control of default values // be assigned to the widget when it is placed in the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { if ($layout == 'landscape') { $width = $options->plus_widget_size_landscape; } else { $width = $options->plus_widget_size_portrait; } } } // Setting any of the default parameters for the // fields that contain invalid values or inconsistent $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_plus.php"); if (!in_array($cover, array('true', 'false'))) { $cover = 'true'; } if (!in_array($tagline, array('true', 'false'))) { $tagline = 'true'; } if (!in_array($publisher, array('true', 'false'))) { $publisher = 'false'; } if (!in_array($theme, array('light', 'dark'))) { $theme = 'light'; } if (!in_array($layout, array('portrait', 'landscape'))) { $layout = 'portrait'; } if (!in_array($type, array('standard', 'popup'))) { $type = 'standard'; } if (!ctype_digit($method) or $method == 0) { $method = '1'; } if (!ctype_digit($width) or $width == 0) { if ($layout == 'landscape') { $width = $DEFAULT['plus_widget_size_landscape']['value']; } else { $width = $DEFAULT['plus_widget_size_portrait']['value']; } $width_auto = '1'; } // Calling the template for displaying the part // that concerns the administration panel (admin) @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
/** * Generazione del codice HTML del widget per la * visualizzazione completa nella sidebar di appartenenza */ function widget($args, $instance) { // Controllo se esistono le variabili che servono durante l'elaborazione // dello script e assegno dei valori di default nel caso non fossero specificati $options = $this->common_empty(array(), $instance); // Creazione del codice per widget google translate if ($object = SZGoogleModule::getObject('SZGoogleModuleTranslate')) { $HTML = $object->getTranslateCode($options); } // Output del codice HTML legato al widget da visualizzare // chiamata alla funzione generale per wrap standard echo $this->common_widget($args, $instance, $HTML); }
/** * Generazione del codice HTML del widget per la * visualizzazione completa nella sidebar di appartenenza */ function widget($args, $instance) { // Controllo se esistono le variabili che servono durante l'elaborazione // dello script e assegno dei valori di default nel caso non fossero specificati $options = $this->common_empty(array('url' => '', 'align' => ''), $instance); // Creazione del codice HTML per il widget attuale richiamando la // funzione base che viene richiamata anche dallo shortcode corrispondente if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusPostShortcode($options); } // Output del codice HTML legato al widget da visualizzare // chiamata alla funzione generale per wrap standard echo $this->common_widget($args, $instance, $HTML); }
/** * Generation of the HTML code of the widget * for the full display in the sidebar associated */ function widget($args, $instance) { // Checking whether there are the variables that are used during the processing // the script and check the default values in case they were not specified $options = $this->common_empty(array(), $instance); // Create the HTML code for the current widget recalling the basic // function which is also invoked by the corresponding shortcode if ($object = SZGoogleModule::getObject('SZGoogleModuleTranslate')) { $HTML = $object->getTranslateCode($options); } // Output HTML code linked to the widget to // display call to the general standard for wrap echo $this->common_widget($args, $instance, $HTML); }
/** * Calcolo le opzioni legate al modulo con esecuzione dei * controlli formali di coerenza e impostazione dei default * * @return array */ function getOptions() { if ($this->options) { return $this->options; } else { $this->options = parent::getOptionsSet('sz_google_options_translate'); } // Controllo opzione di codice GA-UA nel caso debba pendere il valore // specificato nel modulo corrispondente se risulta attivo. if ($object = self::getObject('SZGoogleModuleAnalytics') and $this->options['translate_analytics_ua'] == '') { $options_ga = $object->getOptions(); $this->options['translate_analytics_ua'] = $options_ga['ga_uacode']; } // Ritorno indietro il gruppo di opzioni corretto dai // controlli formali eseguito dalla funzione di controllo return $this->options; }
/** * Visualizzazione FORM del widget presente nella gestione * delle sidebar nel pannello di amministrazione di wordpress */ function form($instance) { // Creazione array per elenco campi che devono essere // presenti nel form prima di richiamare wp_parse_args() $array = array('title' => '', 'method' => '', 'specific' => '', 'width' => '', 'width_auto' => '', 'align' => '', 'layout' => '', 'theme' => '', 'cover' => '', 'tagline' => '', 'publisher' => ''); // Creazione array per elenco campi da recuperare su FORM e // caricamento del file con il template HTML da visualizzare extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Lettura delle opzioni per il controllo dei valori di default // da assegnare al widget nel momento che viene inserito in sidebar if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { $width = $options->plus_widget_size_portrait; } } // Impostazione eventuale di parametri di default per i // campi che contengono dei valori non validi o non coerenti $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_plus.php"); if (!in_array($cover, array('true', 'false'))) { $cover = 'true'; } if (!in_array($tagline, array('true', 'false'))) { $tagline = 'true'; } if (!in_array($publisher, array('true', 'false'))) { $publisher = 'false'; } if (!in_array($theme, array('light', 'dark'))) { $theme = 'light'; } if (!in_array($layout, array('portrait', 'landscape'))) { $layout = 'portrait'; } if (!ctype_digit($method) or $method == 0) { $method = '1'; } if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['plus_widget_size_portrait']['value']; $width_auto = '1'; } // Richiamo il template per la visualizzazione della // parte che riguarda il pannello di amministrazione @(require dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(require dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
/** * FORM display the widget in the management of * sidebar in the administration panel of wordpress */ function form($instance) { // Creating arrays for list fields that must be // present in the form before calling wp_parse_args() $array = array('title' => '', 'url' => '', 'width' => '', 'width_auto' => '', 'height' => '', 'height_auto' => '', 'pre' => ''); // Creating arrays for list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Reading of the options for the control of default values // be assigned to the widget when it is placed in the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleDrive')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { $width = $options->drive_viewer_w_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->drive_viewer_w_height; } // Check if the string contains a value consistent with the // selection of the parameter both as a numerical value that character $YESNO = array('1', '0', 'n', 'y'); if (!in_array($pre, $YESNO)) { $pre = $options->drive_viewer_w_wrap_pre; } } // Setting any of the default parameters for the // fields that contain invalid values or inconsistent $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_drive.php"); if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['drive_viewer_w_width']['value']; $width_auto = '1'; } if (!ctype_digit($height) or $height == 0) { $height = $DEFAULT['drive_viewer_w_height']['value']; $height_auto = '1'; } // Setting any of the default parameters for the // fields that contain invalid values or inconsistent $pre = str_replace(array('0', '1'), array('n', 'y'), $pre); // Calling the template for displaying the part // that concerns the administration panel (admin) @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
/** * Generazione del codice HTML del widget per la * visualizzazione completa nella sidebar di appartenenza */ function widget($args, $instance) { // Controllo se esistono le variabili che servono durante l'elaborazione // dello script e assegno dei valori di default nel caso non fossero specificati $options = $this->common_empty(array('url' => '', 'size' => '', 'width' => '', 'annotation' => '', 'float' => '', 'align' => '', 'text' => '', 'img' => '', 'rel' => '', 'position' => '', 'margintop' => '', 'marginright' => '', 'marginbottom' => '', 'marginleft' => '', 'marginunit' => ''), $instance); // Definizione delle variabili di controllo del widget, questi valori non // interessano le opzioni della funzione base ma incidono su alcuni aspetti $controls = $this->common_empty(array('badge' => '', 'urltype' => ''), $instance); // Se sul widget ho escluso il badge dal pulsante azzero anche // le variabili del badge eventualmente impostate e memorizzate if ($controls['badge'] != '1') { $options['img'] = ''; $options['text'] = ''; $options['position'] = ''; } // Lettura opzioni generali per impostazione dei dati di default if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $general = $object->getOptions($options); // Imposto i valori di default nel caso siano specificati dei valori // che non appartengono al range dei valori accettati if ($controls['urltype'] == '2') { if ($general['plus_page'] == '') { $options['url'] = 'https://plus.google.com/117259631219963935481'; } else { $options['url'] = 'https://plus.google.com/' . $general['plus_page']; } } if ($controls['urltype'] == '3') { if ($general['plus_profile'] == '') { $options['url'] = 'https://plus.google.com/106189723444098348646'; } else { $options['url'] = 'https://plus.google.com/' . $general['plus_profile']; } } } // Creazione del codice HTML per il widget attuale richiamando la // funzione base che viene richiamata anche dallo shortcode corrispondente if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusFollowShortcode($options); } // Output del codice HTML legato al widget da visualizzare // chiamata alla funzione generale per wrap standard echo $this->common_widget($args, $instance, $HTML); }
/** * Generation of the HTML code of the widget * for the full display in the sidebar associated */ function widget($args, $instance) { // Checking whether there are the variables that are used during the processing // the script and check the default values in case they were not specified $options = $this->common_empty(array('url' => '', 'size' => '', 'width' => '', 'annotation' => '', 'float' => '', 'align' => '', 'text' => '', 'img' => '', 'rel' => '', 'position' => '', 'margintop' => '', 'marginright' => '', 'marginbottom' => '', 'marginleft' => '', 'marginunit' => ''), $instance); // Definition of the control variables of the widget, these values // do not affect the items of basic but affect some aspects $controls = $this->common_empty(array('badge' => '', 'urltype' => ''), $instance); // If the widget I excluded from the badge button I reset // the variables of the badge possibly set and saved if ($controls['badge'] != '1') { $options['img'] = ''; $options['text'] = ''; $options['position'] = ''; } // Reading general options for setting default data // check if you specify the page or profile for select if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $general = $object->getOptions($options); if ($controls['urltype'] == '2') { if ($general['plus_page'] == '') { $options['url'] = 'https://plus.google.com/117259631219963935481'; } else { $options['url'] = 'https://plus.google.com/' . $general['plus_page']; } } if ($controls['urltype'] == '3') { if ($general['plus_profile'] == '') { $options['url'] = 'https://plus.google.com/106189723444098348646'; } else { $options['url'] = 'https://plus.google.com/' . $general['plus_profile']; } } } // Create the HTML code for the current widget recalling the basic // function which is also invoked by the corresponding shortcode if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $HTML = $object->getPlusFollowShortcode($options); } // Output HTML code linked to the widget to // display call to the general standard for wrap echo $this->common_widget($args, $instance, $HTML); }
/** * FORM display the widget in the management of * sidebar in the administration panel of wordpress */ function form($instance) { // Creating arrays for list fields that must be // present in the form before calling wp_parse_args() $array = array('title' => '', 'calendarT' => '', 'calendar' => '', 'mode' => '', 'weekstart' => '', 'language' => '', 'timezone' => '', 'width' => '', 'height' => '', 'showtitle' => '', 'shownavs' => '', 'showdate' => '', 'showprint' => '', 'showtabs' => '', 'showcalendars' => '', 'showtimezone' => '', 'width_auto' => '', 'height_auto' => ''); // Creating arrays for list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Reading of the options for the control of default values // be assigned to the widget when it is placed in the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleCalendar')) { $options = (object) $object->getOptions(); if ($options->calendar_w_show_title == '1') { $options->calendar_w_show_title = 'y'; } else { $options->calendar_w_show_title = 'n'; } if ($options->calendar_w_show_navs == '1') { $options->calendar_w_show_navs = 'y'; } else { $options->calendar_w_show_navs = 'n'; } if ($options->calendar_w_show_date == '1') { $options->calendar_w_show_date = 'y'; } else { $options->calendar_w_show_date = 'n'; } if ($options->calendar_w_show_print == '1') { $options->calendar_w_show_print = 'y'; } else { $options->calendar_w_show_print = 'n'; } if ($options->calendar_w_show_tabs == '1') { $options->calendar_w_show_tabs = 'y'; } else { $options->calendar_w_show_tabs = 'n'; } if ($options->calendar_w_show_calendars == '1') { $options->calendar_w_show_calendars = 'y'; } else { $options->calendar_w_show_calendars = 'n'; } if ($options->calendar_w_show_timezone == '1') { $options->calendar_w_show_timezone = 'y'; } else { $options->calendar_w_show_timezone = 'n'; } if ($mode == '') { $mode = $options->calendar_o_mode; } if ($weekstart == '') { $weekstart = $options->calendar_o_weekstart; } if ($language == '') { $language = $options->calendar_o_language; } if ($timezone == '') { $timezone = $options->calendar_o_timezone; } if ($showtitle == '') { $showtitle = $options->calendar_w_show_title; } if ($shownavs == '') { $shownavs = $options->calendar_w_show_navs; } if ($showdate == '') { $showdate = $options->calendar_w_show_date; } if ($showprint == '') { $showprint = $options->calendar_w_show_print; } if ($showtabs == '') { $showtabs = $options->calendar_w_show_tabs; } if ($showcalendars == '') { $showcalendars = $options->calendar_w_show_calendars; } if ($showtimezone == '') { $showtimezone = $options->calendar_w_show_timezone; } if (!ctype_digit($width) and $width != 'auto') { $width = $options->calendar_w_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->calendar_w_height; } } // Setting any of the default parameters for the // fields that contain invalid values or inconsistent $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_calendar.php"); if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['calendar_w_width']['value']; $width_auto = '1'; } if (!ctype_digit($height) or $height == 0) { $height = $DEFAULT['calendar_w_height']['value']; $height_auto = '1'; } // Calling the template for displaying the part // that concerns the administration panel (admin) @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
* @subpackage Admin * @author Massimo Della Rovere * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ if (!defined('SZ_PLUGIN_GOOGLE') or !SZ_PLUGIN_GOOGLE) { die; } // Creating array to list the fields that must be // present in the form before calling wp_parse_args () $array = array('title' => '', 'template' => '', 'width' => '', 'width_auto' => '', 'height' => '', 'height_auto' => '', 'user' => '', 'group' => '', 'tag' => '', 'set' => '', 'columns' => '', 'rows' => '', 'orientation' => '', 'position' => ''); // Creating arrays to list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Read the options to control the default values to be // assigned to the widget when it is added to the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModulePanoramio')) { $options = (object) $object->getOptions(); if (!ctype_digit($columns)) { $columns = $options->panoramio_s_columns; } if (!ctype_digit($rows)) { $rows = $options->panoramio_s_rows; } if (!in_array($template, array('photo', 'slideshow', 'list', 'photo_list'))) { $options->panoramio_s_template; } if (!in_array($set, array('all', 'public', 'recent'))) { $options->panoramio_s_set; } if (!in_array($orientation, array('horizontal', 'vertical'))) { $options->panoramio_s_orientation;
/** * FORM display the widget in the management of * sidebar in the administration panel of wordpress */ function form($instance) { // Creating arrays for list fields that must be // present in the form before calling wp_parse_args() $array = array('title' => '', 'id' => '', 'responsive' => '', 'width' => '', 'height' => '', 'delayed' => '', 'autoplay' => '', 'loop' => '', 'fullscreen' => '', 'disableiframe' => '', 'disablekeyboard' => '', 'disablerelated' => '', 'theme' => '', 'cover' => ''); // Creating arrays for list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Reading of the options for the control of default values // be assigned to the widget when it is placed in the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleYoutube')) { $options = (object) $object->getOptions(); if (!in_array($theme, array('light', 'dark'))) { $theme = $options->youtube_theme; } if (!in_array($cover, array('local', 'youtube'))) { $cover = $options->youtube_cover; } if (!in_array($responsive, array('n', 'y'))) { $responsive = $options->youtube_responsive; } if (!in_array($delayed, array('n', 'y'))) { $delayed = $options->youtube_delayed; } if (!in_array($autoplay, array('n', 'y'))) { $autoplay = $options->youtube_autoplay; } if (!in_array($loop, array('n', 'y'))) { $loop = $options->youtube_loop; } if (!in_array($fullscreen, array('n', 'y'))) { $fullscreen = $options->youtube_fullscreen; } if (!in_array($disableiframe, array('n', 'y'))) { $disableiframe = $options->youtube_disableiframe; } if (!in_array($disablekeyboard, array('n', 'y'))) { $disablekeyboard = $options->youtube_disablekeyboard; } if (!in_array($disablerelated, array('n', 'y'))) { $disablerelated = $options->youtube_disablerelated; } if (!ctype_digit($width) and $width != 'auto') { $width = $options->youtube_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->youtube_height; } } // Setting any of the default parameters for the // fields that contain invalid values or inconsistent $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_youtube.php"); if (!in_array($theme, array('light', 'dark'))) { $theme = 'dark'; } if (!in_array($cover, array('local', 'youtube'))) { $cover = 'local'; } if (!in_array($responsive, array('0', '1', 'n', 'y'))) { $responsive = $DEFAULT['youtube_responsive']['value']; } if (!in_array($delayed, array('0', '1', 'n', 'y'))) { $delayed = $DEFAULT['youtube_delayed']['value']; } if (!in_array($autoplay, array('0', '1', 'n', 'y'))) { $autoplay = $DEFAULT['youtube_autoplay']['value']; } if (!in_array($loop, array('0', '1', 'n', 'y'))) { $loop = $DEFAULT['youtube_loop']['value']; } if (!in_array($fullscreen, array('0', '1', 'n', 'y'))) { $fullscreen = $DEFAULT['youtube_fullscreen']['value']; } if (!in_array($disableiframe, array('0', '1', 'n', 'y'))) { $disableiframe = $DEFAULT['youtube_disableiframe']['value']; } if (!in_array($disablekeyboard, array('0', '1', 'n', 'y'))) { $disablekeyboard = $DEFAULT['youtube_disablekeyboard']['value']; } if (!in_array($disablerelated, array('0', '1', 'n', 'y'))) { $disablerelated = $DEFAULT['youtube_disablerelated']['value']; } if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['youtube_width']['value']; $width_auto = '1'; } if (!ctype_digit($height) or $height == 0) { $height = $DEFAULT['youtube_height']['value']; $height_auto = '1'; } // Unfortunately youtube values were set differently // the values of configuration options so we do a replace $responsive = str_replace(array('0', '1'), array('n', 'y'), $responsive); $delayed = str_replace(array('0', '1'), array('n', 'y'), $delayed); $autoplay = str_replace(array('0', '1'), array('n', 'y'), $autoplay); $loop = str_replace(array('0', '1'), array('n', 'y'), $loop); $fullscreen = str_replace(array('0', '1'), array('n', 'y'), $fullscreen); $disableiframe = str_replace(array('0', '1'), array('n', 'y'), $disableiframe); $disablekeyboard = str_replace(array('0', '1'), array('n', 'y'), $disablekeyboard); $disablerelated = str_replace(array('0', '1'), array('n', 'y'), $disablerelated); // Calling the template for displaying the part // that concerns the administration panel (admin) @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(include dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
* @subpackage Admin * @author Massimo Della Rovere * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ if (!defined('SZ_PLUGIN_GOOGLE') or !SZ_PLUGIN_GOOGLE) { die; } // Creating array to list the fields that must be // present in the form before calling wp_parse_args () $array = array('title' => '', 'url' => '', 'width' => '', 'width_auto' => '', 'height' => '', 'height_auto' => '', 'pre' => ''); // Creating arrays to list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Read the options to control the default values to be // assigned to the widget when it is added to the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleDrive')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { $width = $options->drive_viewer_s_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->drive_viewer_s_height; } // Checking if the string contains a value consistent with the // selection of the parameter as a numeric value that is character $YESNO = array('1', '0', 'n', 'y'); if (!in_array($pre, $YESNO)) { $pre = $options->drive_viewer_w_wrap_pre; } } // Setting any of the default parameters for fields
/** * Visualizzazione FORM del widget presente nella gestione * delle sidebar nel pannello di amministrazione di wordpress */ function form($instance) { // Creazione array per elenco campi che devono essere // presenti nel form prima di richiamare wp_parse_args() $array = array('title' => '', 'calendarT' => '', 'calendars' => '', 'mode' => '', 'weekstart' => '', 'language' => '', 'timezone' => '', 'width' => '', 'height' => '', 'showtitle' => '', 'shownavs' => '', 'showdate' => '', 'showprint' => '', 'showtabs' => '', 'showcalendars' => '', 'showtimezone' => '', 'width_auto' => '', 'height_auto' => ''); // Creazione array per elenco campi da recuperare su FORM e // caricamento del file con il template HTML da visualizzare extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Lettura delle opzioni per il controllo dei valori di default // da assegnare al widget nel momento che viene inserito in sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleCalendar')) { $options = (object) $object->getOptions(); if ($options->calendar_w_show_title == '1') { $options->calendar_w_show_title = 'y'; } else { $options->calendar_w_show_title = 'n'; } if ($options->calendar_w_show_navs == '1') { $options->calendar_w_show_navs = 'y'; } else { $options->calendar_w_show_navs = 'n'; } if ($options->calendar_w_show_date == '1') { $options->calendar_w_show_date = 'y'; } else { $options->calendar_w_show_date = 'n'; } if ($options->calendar_w_show_print == '1') { $options->calendar_w_show_print = 'y'; } else { $options->calendar_w_show_print = 'n'; } if ($options->calendar_w_show_tabs == '1') { $options->calendar_w_show_tabs = 'y'; } else { $options->calendar_w_show_tabs = 'n'; } if ($options->calendar_w_show_calendars == '1') { $options->calendar_w_show_calendars = 'y'; } else { $options->calendar_w_show_calendars = 'n'; } if ($options->calendar_w_show_timezone == '1') { $options->calendar_w_show_timezone = 'y'; } else { $options->calendar_w_show_timezone = 'n'; } if ($mode == '') { $mode = $options->calendar_o_mode; } if ($weekstart == '') { $weekstart = $options->calendar_o_weekstart; } if ($language == '') { $language = $options->calendar_o_language; } if ($timezone == '') { $timezone = $options->calendar_o_timezone; } if ($showtitle == '') { $showtitle = $options->calendar_w_show_title; } if ($shownavs == '') { $shownavs = $options->calendar_w_show_navs; } if ($showdate == '') { $showdate = $options->calendar_w_show_date; } if ($showprint == '') { $showprint = $options->calendar_w_show_print; } if ($showtabs == '') { $showtabs = $options->calendar_w_show_tabs; } if ($showcalendars == '') { $showcalendars = $options->calendar_w_show_calendars; } if ($showtimezone == '') { $showtimezone = $options->calendar_w_show_timezone; } if (!ctype_digit($width) and $width != 'auto') { $width = $options->calendar_w_width; } if (!ctype_digit($height) and $height != 'auto') { $height = $options->calendar_w_height; } } // Impostazione eventuale di parametri di default per i // campi che contengono dei valori non validi o non coerenti $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_calendar.php"); if (!ctype_digit($width) or $width == 0) { $width = $DEFAULT['calendar_w_width']['value']; $width_auto = '1'; } if (!ctype_digit($height) or $height == 0) { $height = $DEFAULT['calendar_w_height']['value']; $height_auto = '1'; } // Richiamo il template per la visualizzazione della // parte che riguarda il pannello di amministrazione @(require dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/SZGoogleWidget.php'); @(require dirname(SZ_PLUGIN_GOOGLE_MAIN) . '/admin/widgets/' . __CLASS__ . '.php'); }
* @subpackage Admin * @author Massimo Della Rovere * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ if (!defined('SZ_PLUGIN_GOOGLE') or !SZ_PLUGIN_GOOGLE) { die; } // Creating array to list the fields that must be // present in the form before calling wp_parse_args () $array = array('title' => '', 'method' => '', 'specific' => '', 'width' => '', 'width_auto' => '', 'height' => '', 'height_auto' => '', 'align' => ''); // Creating arrays to list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Read the options to control the default values to be // assigned to the widget when it is added to the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModulePlus')) { $options = (object) $object->getOptions(); if (!ctype_digit($width) and $width != 'auto') { if ($layout == 'landscape') { $width = $options->plus_shortcode_size_landscape; } else { $width = $options->plus_shortcode_size_portrait; } } } // Setting any of the default parameters for fields // that contain invalid values or inconsistent $DEFAULT = (include dirname(SZ_PLUGIN_GOOGLE_MAIN) . "/options/sz_google_options_plus.php"); if (!ctype_digit($method) or $method == 0) { $method = '1'; }
} // Creating array to list the fields that must be // present in the form before calling wp_parse_args () $array = array('title' => '', 'type' => '', 'topic' => '', 'badge' => '', 'text' => '', 'img' => '', 'align' => '', 'position' => '', 'profile' => '', 'email' => '', 'logged' => '', 'guest' => '', 'width' => '', 'width_auto' => ''); // Creating arrays to list of fields to be retrieved FORM // and loading the file with the HTML template to display extract(wp_parse_args($instance, $array), EXTR_OVERWRITE); // Setting any of the default parameters for fields // that contain invalid values or inconsistent if (!ctype_digit($width) or $width == 0) { $width = 'auto'; $width_auto = '1'; } // Read the options to control the default values to be // assigned to the widget when it is added to the sidebar if ($object = SZGoogleModule::getObject('SZGoogleModuleHangouts')) { $options = (object) $object->getOptions(); // Checking if the string contains a value consistent with the // selection of the parameter as a numeric value that is character $YESNO = array('1', '0', 'n', 'y'); if (!in_array($logged, $YESNO)) { $logged = $options->hangouts_start_logged; } if (!in_array($guest, $YESNO)) { $guest = $options->hangouts_start_guest; } } // If the values are taken from the default options, you can // create the problems caused to the difference in the storage state $logged = str_replace(array('0', '1'), array('n', 'y'), $logged); $guest = str_replace(array('0', '1'), array('n', 'y'), $guest);