';
echo '
' . __( 'Advanced Font Changer', 'afc_textdomain' ) . '
';
$afc_selectorToEdit = '';
$afcSelectors = new afcselectors();
if( get_option('afc_selector_for_edit') == '' ){
if( isset( $_GET['id'] ) && $_GET['id'] != '' ){
$dbSelectors = $afcSelectors->getelems( 'id', array( $_GET['id'] ) );
if( is_array( $dbSelectors ) )
foreach( $dbSelectors as $key )
if( $key['id'] == $_GET['id'] ){
$afc_selectorToEdit = $key;
update_option('afc_selector_for_edit', $key );
break;
}
}
}
else{
$afc_selectorToEdit = get_option('afc_selector_for_edit');
}
if( is_array( $afc_selectorToEdit ) && isset( $_GET['action'] ) && $_GET['action'] == 'edit' ){
afc_editselector();
}
else{
echo '';
$current = 'afc_manageselectors';
$tabs = afcStrings::getString( 'manageSelectors' );
foreach( $tabs as $tab => $name ){
$classnames = ( $tab == $current ) ? ' nav-tab-active' : '';
echo "$name";
}
echo '
';
update_option('afc_selector_for_edit', '' );
global $afcSelectorsListTable;
if( isset( $_POST['s'] ) ){
$afcSelectorsListTable->prepare_items( $_POST['s'] );
}
else{
$afcSelectorsListTable->prepare_items();
}
?>
';
}
}
/*
* This function sets default data for our table
* we call this function when wp is loading admin menu items in main plugin file
*/
function selectors_table_options(){
global $afcSelectorsListTable;
$option = 'per_page';
$args = array(
'label' => 'Fonts',
'default' => 15,
'option' => 'selectors_per_page'
);
add_screen_option( $option, $args );
$afcSelectorsListTable = new afc_selectorsList();
}
?>