oont-contents/plugins/xc-woo-google-cloud-print/includes/functions.php
2025-02-08 15:10:23 +01:00

28 lines
No EOL
953 B
PHP

<?php
if(!function_exists('get_xc_cloud_printers')){
function get_xc_cloud_printers(){
if('yes' == get_option('xc_woo_cloud_use_printnode')){
global $xc_woo_printnode;
$printers = $xc_woo_printnode->get_printers();
}else{
$XC_WOO_CLOUD_Settings = new XC_WOO_CLOUD_Settings();
$printers = $XC_WOO_CLOUD_Settings->get_printers();
}
return $printers;
}
}
function xc_woo_cloud_print_get_options() {
$section = new XC_WOO_Settings();
$subsections = array_unique( array_merge( array( '' ), array_keys( $section->get_sections() ) ) );
$options = array();
foreach ( $subsections as $subsection ) {
if($subsection == '') $key = 'general'; else $key = $subsection;
foreach ( $section->get_settings( $subsection ) as $value ) {
if ( isset( $value['id'] ) ) {
$options[$key][]=array("id"=>$value['id'], 'name' => $value['name'], 'value' => get_option($value['id']));
}
}
}
return $options;
}