Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
_table( 'WP_Plugins_List_Table' );
$action = $wp_list_table->current_action();
if ( 'deactivate-selected' === $action ) {
$referer = 'bulk-plugins';
}
check_admin_referer( $referer );
}
$settings = $this->_registry->get( 'model.settings' );
foreach ( $this->_settings as $name => $params ) {
$settings->hide_option( $name );
}
}
/**
* Show the settings
*/
public function show_settings( Ai1ec_Registry_Object $registry ) {
$settings = $registry->get( 'model.settings' );
foreach ( $this->_settings as $name => $params ) {
if ( isset( $params['renderer'] ) ) {
$settings->show_option( $name, $params['renderer'] );
}
}
$settings->set( 'allow_statistics', true );
}
/**
* If extensions need to add tables, they will need to override the function to add a schema.
*
* @param string $prefix Database prefix to use for table names.
*
* @return array An array with two keys, schema and tables which are used
* for installing and dropping the table.
*/
protected static function _get_schema( $prefix ) {
return array(
'tables' => array(),
'schema' => '',
);
}
/**
* Performe upgarde actions based on extension version
*
* @param Ai1ec_Registry_Object $registry
*/
protected function _perform_upgrade( Ai1ec_Registry_Object $registry ) {
$version_variable = 'ai1ec_' . $this->get_machine_name() .
'_version';
$option = $registry->get( 'model.option' );
$version = $option->get( $version_variable );
if ( $version !== $this->get_version() ) {
$registry->get( 'model.settings' )->perform_upgrade_actions();
$this->_perform_upgrade_actions();
$option->set( $version_variable, $this->get_version(), true );
}
}
/**
* Function called on add on upgrade.
* Can be overridden by add ons for extra behaviour
*/
protected function _perform_upgrade_actions() {
}
/**
* Since the call the to the uninstall hook it's static, if a different behaviour
* is needed also this call must be overridden.
*/
protected function _register_uninstall_hook() {
register_uninstall_hook(
$this->get_file(),
array( get_class( $this ), 'on_uninstall' )
);
}
/**
* Adds extension settings
*
* @param Ai1ec_Settings $settings
*/
protected function _add_settings( Ai1ec_Settings $settings ) {
foreach ( $this->_settings as $name => $params ) {
$renderer = null;
if ( isset( $params['renderer'] ) ) {
$renderer = $params['renderer'];
}
$settings->register(
$name,
$params['value'],
$params['type'],
$renderer,
$this->get_version()
);
}
}
/**
* Check if the schema needs to be updated
*
* @param Ai1ec_Registry_Object $registry
* @throws Ai1ec_Database_Update_Exception
*/
protected function _install_schema( Ai1ec_Registry_Object $registry ) {
$option = $registry->get( 'model.option' );
$schema = self::$_schema;
if (
is_admin() &&
! empty( $schema['schema'] )
) {
$db_version_variable = 'ai1ec_' . $this->get_machine_name() .
'_db_version';
$version = sha1( $schema['schema'] );
if (
$option->get( $db_version_variable ) !== $version
) {
if (
$registry->get( 'database.helper' )->apply_delta(
$schema['schema']
)
) {
$option->set( $db_version_variable, $version );
} else {
throw new Ai1ec_Database_Update_Exception(
'Database upgrade for ' . $this->get_name() .
' failed'
);
}
}
}
}
}