p =& $plugin; if ( $this->p->debug->enabled ) { $this->p->debug->mark(); } $this->menu_id = $id; $this->menu_name = $name; $this->menu_lib = $lib; $this->menu_ext = $ext; $this->menu_metaboxes = array( 'addons' => _x( 'Free Plugin Add-ons', 'metabox title', 'wpsso' ), ); } /* * Remove all action buttons. */ protected function add_form_buttons( &$form_button_rows ) { $form_button_rows = array(); } /* * Callback method must be public for add_meta_box() hook. * * See WpssoAdmin->add_settings_page_metaboxes(). */ public function show_metabox_addons( $obj, $mb ) { if ( $this->p->debug->enabled ) { $this->p->debug->mark(); } $ext_sorted = WpssoConfig::get_ext_sorted(); unset( $ext_sorted[ $this->p->id ] ); $tabindex = 0; $ext_num = 0; $ext_total = count( $ext_sorted ); $pkg_info = $this->p->util->get_pkg_info(); // Uses a local cache. $charset = get_bloginfo( $show = 'charset', $filter = 'raw' ); $icon_px = 100; echo '' . "\n"; foreach ( $ext_sorted as $ext => $info ) { if ( empty( $info[ 'name' ] ) ) { continue; } $ext_num++; $ext_links = $this->get_ext_action_links( $ext, $info, $tabindex ); $ext_name_html = '

' . htmlentities( $pkg_info[ $ext ][ 'name' ], ENT_QUOTES, $charset, $double_encode = false ) . ' (' . htmlentities( $pkg_info[ $ext ][ 'short' ], ENT_QUOTES, $charset, $double_encode = false ) . ')' . '

'; $ext_desc_transl = _x( $info[ 'desc' ], 'plugin description', 'wpsso' ); $ext_desc_html = '

' . htmlentities( $ext_desc_transl, ENT_QUOTES, $charset, $double_encode = false ) . '

'; $table_rows = array(); /* * Plugin name, description and links. */ $table_rows[ 'plugin_name' ] = ''; /* * Plugin separator. */ if ( $ext_num < $ext_total ) { $table_rows[ 'dotted_line' ] = ''; } else { $table_rows[] = ''; } /* * Show the plugin icon and table rows. */ foreach ( $table_rows as $key => $row ) { echo ''; if ( $key === 'plugin_name' ) { $span_rows = count( $table_rows ); $icon_col_px = $icon_px + 30; $icon_style = 'width:' . $icon_col_px . 'px; min-width:' . $icon_col_px . 'px; max-width:' . $icon_col_px . 'px;'; echo ''; } echo $row . '' . "\n"; } } echo '
' . '' . $ext_name_html . $ext_desc_html . ( empty( $ext_links ) ? '' : '
' . implode( $glue = ' | ', $ext_links ) . '
' ) . '
'; echo $this->get_ext_img_icon( $ext, $icon_px ); echo '
' . "\n"; } } }