Exemplo n.º 1
0
 public function testCompile()
 {
     $field = new Radio("test", "Test", array("test", "blue"));
     $expected = "<label for=\"test\">Test</label><div class=\"elements\"><div class=\"element\"><input type=\"radio\"  name=\"test\" value=\"test\"  /> <span>test</span></div><div class=\"element\"><input type=\"radio\"  name=\"test\" value=\"blue\"  /> <span>blue</span></div></div>";
     $value = $field->compile();
     $this->assertEquals($expected, $value);
 }
 public function heartbeatAction()
 {
     include_once 'source/lib/Radio.php';
     $Radio = new Radio(array('silent' => true));
     $Radio->getShows();
     $npShow = $Radio->getNowPlaylingShow();
     $npSong = $Radio->getNowPlayingSong();
     $return = array('show' => $npShow['name'], 'song' => $npSong);
     echo json_encode($return);
 }
Exemplo n.º 3
0
 /**
  * @param array $rowData
  * @param string $expectedResult
  * @dataProvider renderDataProvider
  */
 public function testRender(array $rowData, $expectedResult)
 {
     $selectedTreeArray = array(array('value' => 1, 'label' => 'One'));
     $selectedFlatArray = array(1 => 'One');
     $this->_column->expects($this->once())->method('getValues')->will($this->returnValue($selectedTreeArray));
     $this->_column->expects($this->once())->method('getIndex')->will($this->returnValue('label'));
     $this->_column->expects($this->once())->method('getHtmlName')->will($this->returnValue('test[]'));
     $this->_converter->expects($this->once())->method('toFlatArray')->with($selectedTreeArray)->will($this->returnValue($selectedFlatArray));
     $this->assertEquals($expectedResult, $this->_object->render(new \Magento\Framework\Object($rowData)));
 }
Exemplo n.º 4
0
 public function setOptions(array $options)
 {
     $this->options = $options;
     foreach ($options as $value => $label) {
         $radio = new Radio($this->attributes['name']);
         $radio->setLabel($label);
         $radio->setValue($value);
         $this->radioElements[$value] = $radio;
     }
     return $this;
 }
Exemplo n.º 5
0
 /**
  * Forgery constructor
  */
 public function __forge()
 {
     $this->checkbox = Radio::forge();
     $this->label = Label::forge()->removeClass('control-label');
     $this->label->addContent($this->checkbox);
     $this->label->addClass('checkbox');
 }
Exemplo n.º 6
0
 public static function getInstance()
 {
     if (self::$instance == NULL) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Exemplo n.º 7
0
 /**
  * @covers Xoops\Form\Radio::render
  */
 public function testRender()
 {
     $this->object->addOption('key', 'value');
     $value = $this->object->render();
     $this->assertTrue(is_string($value));
     $this->assertTrue(false !== strpos($value, '<label class="radio'));
     $this->assertTrue(false !== strpos($value, '<input type="radio"'));
 }
Exemplo n.º 8
0
 public function __construct($label, $name, array $properties = null)
 {
     $options = array("1" => "Yes", "0" => "No");
     if (!is_array($properties)) {
         $properties = array("inline" => 1);
     } elseif (!array_key_exists("inline", $properties)) {
         $properties["inline"] = 1;
     }
     parent::__construct($label, $name, $options, $properties);
 }
Exemplo n.º 9
0
 public function getEditMovil($id_movil)
 {
     $movil = Movil::find($id_movil);
     if (is_null($movil)) {
         App::abou(404);
     }
     $modelos = ModeloMovil::all();
     $radios = Radio::all();
     $avls = Avl::all();
     return View::make('edit_movil')->with('movil', $movil)->with('modelos', $modelos)->with('radios', $radios)->with('avls', $avls);
 }
Exemplo n.º 10
0
 /**
  * Override parent's method and return array.
  *
  * @param bool $filter
  *
  * @return array
  */
 protected function get_data($filter = true)
 {
     $data = array_filter(explode(',', parent::get_data(false)), function ($var) {
         return !empty($var);
     });
     if ($filter) {
         $data = array_map(function ($val) {
             return $this->filter($val);
         }, $data);
     }
     return $data;
 }
Exemplo n.º 11
0
 /**
  * Constructor
  *
  * @param string|array $caption Caption or array of all attributes
  *                               Control attributes:
  *                                   :yes label for '1' response
  *                                   :no  label for '0' response
  * @param string       $name    element name
  * @param string|null  $value   Pre-selected value, can be "0" (No) or "1" (Yes)
  * @param string       $yes     String for "Yes"
  * @param string       $no      String for "No"
  */
 public function __construct($caption, $name = null, $value = null, $yes = \XoopsLocale::YES, $no = \XoopsLocale::NO)
 {
     parent::__construct($caption, $name, $value, true);
     if (is_array($caption)) {
         $this->set(':inline');
         $this->setIfNotSet(':yes', \XoopsLocale::YES);
         $this->setIfNotSet(':no', \XoopsLocale::NO);
     } else {
         $this->setWithDefaults(':yes', $yes, \XoopsLocale::YES);
         $this->setWithDefaults(':no', $no, \XoopsLocale::NO);
     }
     $this->addOptionArray([1 => $this->get(':yes'), 0 => $this->get(':no')]);
 }
 public function __construct(array $nested_params, array $external_params)
 {
     parent::__construct($nested_params, $external_params);
     $this->manager = \Radio::getInstance();
     if (!empty($this->nested_params['users.id'])) {
         $user_id = $this->nested_params['users.id'];
         $user = \Stb::getById($user_id);
         if (empty($user)) {
             throw new RESTNotFound("User not found");
         }
         $this->user_id = $user['id'];
     }
 }
Exemplo n.º 13
0
 protected function convertInput()
 {
     $input = $this->getRawInput();
     $value = null;
     $callback = function (Radio &$radio) use(&$value, $input) {
         if ($radio->getValue() == $input) {
             $value = $radio->getModelObject();
             return Component::VISITOR_STOP_TRAVERSAL;
         }
         return Component::VISITOR_CONTINUE_TRAVERSAL;
     };
     $this->visitChildren(Radio::getIdentifier(), $callback);
     if ($value != null) {
         $this->setConvertedInput($value);
     }
 }
Exemplo n.º 14
0
 public function getFromList(&$list, $selectFrom = null)
 {
     parent::getFromList($list, $selectFrom);
     $appInfo = $this->getFormObj()->getAppInfo();
     $trailDays = $appInfo['APP_TRAIL_DAYS'];
     if ((int) $trailDays) {
         unset($list[3]);
         $this->m_Value = 'FREETRIAL';
     } else {
         unset($list[1]);
         $this->m_Value = 'PURCHASE';
     }
     foreach ($list as $key => $value) {
         $value = str_replace("[strong]", "<strong>", $value);
         $value = str_replace("[/strong]", "</strong>", $value);
         $value = str_replace("[days]", $trailDays, $value);
         $list[$key] = $value;
     }
 }
 protected function get_option(array $attrs, $value, $k, $v, $default, $i, $checked = 0)
 {
     if ($v === '%text%') {
         if (!empty($value)) {
             $checked = !in_array($value, $this->config['args']['values']);
             $v = $checked ? $value : $v;
             $disabled = $checked;
         } else {
             $checked = false;
             $is_custom = false;
             $disabled = 'disabled';
         }
         $result = parent::get_option($attrs, $value, $k, $v, $default, $i, $checked);
         $result .= \Cibulka::Base('HTML', 'input', array('type' => 'text', 'disabled' => $disabled, 'class' => 'radio-text', 'value' => $checked ? $value : ''));
     } else {
         $result = parent::get_option($attrs, $value, $k, $v, $default, $i, $checked);
     }
     return $result;
 }
Exemplo n.º 16
0
                    $response['result'] = vclubinfo::getInfoById($_GET['kinopoisk_id']);
                }
            }
        }
    } catch (KinopoiskException $e) {
        echo $e->getMessage();
        $logger = new Logger();
        $logger->setPrefix("vclubinfo_");
        // format: [date] - error_message - [base64 encoded response];
        $logger->error(sprintf("[%s] - %s - \"%s\"\n", date("r"), $e->getMessage(), base64_encode($e->getResponse())));
    }
} elseif ($_GET['get'] == 'tv_services') {
    $response['result'] = Itv::getServices();
} elseif ($_GET['get'] == 'video_services') {
    $response['result'] = Video::getServices();
} elseif ($_GET['get'] == 'radio_services') {
    $response['result'] = Radio::getServices();
} elseif ($_GET['get'] == 'module_services') {
    $response['result'] = Module::getServices();
} elseif ($_GET['get'] == 'option_services') {
    $option_services = Config::getSafe('option_services', array());
    $response['result'] = array_map(function ($item) {
        return array('id' => $item, 'name' => $item);
    }, $option_services);
}
$output = ob_get_contents();
ob_end_clean();
if ($output) {
    $response['output'] = $output;
}
echo json_encode($response);
Exemplo n.º 17
0
 /**
  * getInternetRadioStations
  * Get all internet radio stations
  * Takes no parameter.
  */
 public static function getinternetradiostations($input)
 {
     self::check_version($input, "1.9.0");
     $r = Subsonic_XML_Data::createSuccessResponse();
     $radios = Radio::get_all_radios();
     Subsonic_XML_Data::addRadios($r, $radios);
     self::apiOutput($input, $r);
 }
Exemplo n.º 18
0
 /**
  * Class constructor.
  *
  * For an overview of the supported arguments, please read the Field Types Reference.
  *
  * @since 0.5.0
  * @param string $type the field type
  * @param array $args array of field type arguments
  */
 public function __construct($type, $args)
 {
     parent::__construct($type, $args);
     $this->args['multiple'] = true;
 }
Exemplo n.º 19
0
 /** @test */
 public function it_is_a_correct_object()
 {
     $field = new Radio('test', 'Test', ['value' => 'test']);
     $this->assertSame('administr/form::radio', $field->getView());
     $this->assertInstanceOf(Text::class, $field);
 }
Exemplo n.º 20
0
 <?php 
require_once "./include/shoutcast.php";
$link = $_GET["url"];
$display_array = array("Stream Title", "Stream Genre", "Stream URL", "Current Song");
$radio = new Radio($link);
$data_array = $radio->getServerInfo($display_array);
return $data_array;
?>
 
Exemplo n.º 21
0
    switch ($component) {
        case "radio":
            $radio = new Radio(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-on-focus":
            $radio = new RadioOnFocus(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-on-pressed":
            $radio = new RadioOnPress(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-on-disabled-focus":
            $radio = new RadioDisabledOnFocus(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-off":
            $radio = new RadioOff(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-off-pressed":
            $radio = new RadioOffPress(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-off-focus":
            $radio = new RadioOffFocus(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        case "radio-off-disabled-focus":
            $radio = new RadioDisabledOffFocus(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
        default:
            $radio = new Radio(HOLO_COLORS_COMPONENTS_PATH . '/radio/');
            break;
    }
    $radio->generate_image($color, $size, $holo, $kitkat = false);
}
 public function testInput()
 {
     $radio = new Radio(['name' => "name", 'value' => '1']);
     $this->assertEquals($radio->render(), '<div><input value="1" name="name" type="radio" /></div>');
 }
Exemplo n.º 23
0
 public function __construct($name = null, $owner = null, $value = null, $checked = Cons::NO)
 {
     parent::__construct($name, $owner, $value);
     $this->type = "checkbox";
     $this->checked = $checked;
 }
Exemplo n.º 24
0
<?php

require_once 'imports.php';
// Create a radio and its up/down command objects
$radio = new Radio();
$radio->on();
$volumeUpCommand = new VolumeUpCommand($radio);
$volumeDownCommand = new VolumeDownCommand($radio);
// Create an electric window and its up/down command objects
$window = new ElectricWindow();
$windowUpCommand = new WindowUpCommand($window);
$windowDownCommand = new WindowDownCommand($window);
// Create a speech recogniser object
$speechRecogniser = new SpeechRecogniser();
// Control the radio
$speechRecogniser->setCommands($volumeUpCommand, $volumeDownCommand);
$speechRecogniser->hearUpSpoken();
$speechRecogniser->hearDownSpoken();
// Control the electric window
$speechRecogniser->setCommands($windowUpCommand, $windowDownCommand);
$speechRecogniser->hearUpSpoken();
$speechRecogniser->hearDownSpoken();
Exemplo n.º 25
0
 /**
  * Show field
  */
 protected function display_field()
 {
     printf('<select name="%1$s" id="%1$s">', esc_attr($this->get_name()));
     parent::display_field();
     echo '</select>';
 }
Exemplo n.º 26
0
        }
    }
}
/**
 * Radiobutton getter Function
 * @see skip_radio()
 * @ignore
 */
function get_radio($name, $value, $label = FALSE, $args = array(), $return = 'html')
{
Exemplo n.º 27
0
 private function get_radio_services()
 {
     return \Radio::getServices();
 }
Exemplo n.º 28
0
             $playlist->delete();
             $key = 'playlist_row_' . $playlist->id;
             break;
         case 'smartplaylist':
             $playlist = new Search('song', $_REQUEST['id']);
             if (!$playlist->has_access()) {
                 exit;
             }
             $playlist->delete();
             $key = 'smartplaylist_row_' . $playlist->id;
             break;
         case 'live_stream':
             if (!$GLOBALS['user']->has_access('75')) {
                 exit;
             }
             $radio = new Radio($_REQUEST['id']);
             $radio->delete();
             $key = 'live_stream_' . $radio->id;
             break;
         default:
             exit;
     }
     // end switch on type
     $results[$key] = '';
     break;
 case 'page':
     $browse->set_start($_REQUEST['start']);
     ob_start();
     $browse->show_objects();
     $results['browse_content_' . $browse->get_type()] = ob_get_clean();
     break;
$lang_tables[] = 'pharmacy.php';
$lang_tables[] = 'diagnoses_ICD10.php';
define('LANG_FILE', 'nursing.php');
//define('LANG_FILE','aufnahme.php');
define('NO_2LEVEL_CHK', 1);
require_once $root_path . 'include/inc_front_chain_lang.php';
include_once $root_path . 'include/care_api_classes/class_mini_dental.php';
include_once $root_path . 'include/care_api_classes/class_radio.php';
include_once $root_path . 'include/care_api_classes/class_multi.php';
require_once $root_path . 'include/care_api_classes/class_tz_diagnostics.php';
//$diagnostic_obj->get_array_search_results($keyword);
$diagnostic_obj = new Diagnostics();
$diagnostic_obj->get_array_search_results($keyword);
$alergic = new dental();
$Radiology = new dental();
$rad_obj = new Radio();
$multi = new multi();
/**
 * If the script call comes from the op module replace the user cookie with the user info from op module
 */
//$db->debug=true;
if (isset($op_shortcut) && $op_shortcut) {
    $_COOKIE['ck_pflege_user' . $sid] = $op_shortcut;
    setcookie('ck_pflege_user' . $sid, $op_shortcut, 0, '/');
    $edit = 1;
} elseif ($_COOKIE['ck_op_pflegelogbuch_user' . $sid]) {
    setcookie('ck_pflege_user' . $sid, $_COOKIE['ck_op_pflegelogbuch_user' . $sid], 0, '/');
    $edit = 1;
} elseif ($_COOKIE['aufnahme_user' . $sid]) {
    setcookie('ck_pflege_user' . $sid, $_COOKIE['aufnahme_user' . $sid], 0, '/');
    $edit = 1;
Exemplo n.º 30
0
     $artist->format();
     require AmpConfig::get('prefix') . '/templates/show_artist_row.inc.php';
     break;
 case 'refresh_playlist':
     $playlist = new Playlist($_REQUEST['id']);
     $playlist->format();
     $count = $playlist->get_song_count();
     require AmpConfig::get('prefix') . '/templates/show_playlist_row.inc.php';
     break;
 case 'refresh_smartplaylist':
     $playlist = new Search('song', $_REQUEST['id']);
     $playlist->format();
     require AmpConfig::get('prefix') . '/templates/show_smartplaylist_row.inc.php';
     break;
 case 'refresh_livestream':
     $radio = new Radio($_REQUEST['id']);
     $radio->format();
     require AmpConfig::get('prefix') . '/templates/show_live_stream_row.inc.php';
     break;
 case 'refresh_channel':
     $channel = new Channel($_REQUEST['id']);
     $channel->format();
     require AmpConfig::get('prefix') . '/templates/show_channel_row.inc.php';
     break;
 case 'refresh_broadcast':
     $broadcast = new Broadcast($_REQUEST['id']);
     $broadcast->format();
     require AmpConfig::get('prefix') . '/templates/show_broadcast_row.inc.php';
     break;
 case 'refresh_tag':
     $tag = new Tag($_REQUEST['id']);