本文整理汇总了PHP中API::channel_api方法的典型用法代码示例。如果您正苦于以下问题:PHP API::channel_api方法的具体用法?PHP API::channel_api怎么用?PHP API::channel_api使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类API
的用法示例。
在下文中一共展示了API::channel_api方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_render
public function action_render()
{
$availableChannelTypesJson = API::channel_api()->list_available_channel_types();
$availableChannelTypes = json_decode($availableChannelTypesJson);
$channelTypesArray = $availableChannelTypes->data->channelTypes;
$channelsJson = API::channel_api()->get_all_channels();
$channels = json_decode($channelsJson);
$channelsArray = $channels->data->channels;
$return;
$return->channelTypes = array();
foreach ($channelTypesArray as $channelType) {
$t->type = $channelType->type;
$t->subTypes = array();
foreach ($channelType->subTypes as $subType) {
$st->type = $subType;
$st->sources = array();
foreach ($channelsArray as $source) {
if ($source->type != $t->type || $source->subType != $st->type) {
continue;
}
$c->name = $source->name;
$c->id = $source->id;
$st->sources[] = $c;
unset($c);
}
$t->subTypes[] = $st;
unset($st);
}
$return->channelTypes[] = $t;
unset($t);
}
$this->template->channels = $return;
}
示例2: action_add
public function action_add()
{
$data->parameters = array();
foreach ($_POST as $key => $value) {
if ($key == "name" || $key == "type" || $key == "subType" || $key == "updatePeriod") {
$data->{$key} = $value;
} else {
$data->parameters[$key] = $value;
}
}
$json_encoded_parameters = json_encode($data);
$json = API::channel_api()->add_channel($json_encoded_parameters);
}
示例3: action_getterms
public function action_getterms($withcontrols)
{
$json = API::channel_api()->get_all_channels();
$widget = View::factory("parts/termstomonitorwidget")->set('json', $json);
$loggedinstatus = RiverId::is_logged_in();
$loggedinstatus = $loggedinstatus["IsLoggedIn"];
if ($withcontrols == "true") {
$widget->set('withcontrols', true);
} else {
$widget->set('withcontrols', false);
}
$widget->set('isloggedin', $loggedinstatus);
// Render the widget
$this->request->response = $widget;
}
示例4: action_index
public function action_index($type, $subType)
{
$this->template->title = "Add a new channel - {$type} / {$subType}";
$this->template->content = new View("parts/addchannel");
$this->template->content->type = $type;
$this->template->content->subType = $subType;
$json = API::channel_api()->list_available_channel_types();
$channelTypesContainer = json_decode($json);
$channelTypes = $channelTypesContainer->data->channelTypes;
foreach ($channelTypes as $channelType) {
if ($channelType->type == $type) {
$this->template->content->channel = $channelType;
}
}
}
示例5: action_deactivate
public function action_deactivate()
{
$object->id = $_POST["id"];
$json_encoded_parameters = json_encode($object);
$json = API::channel_api()->desctivate_channel($json_encoded_parameters);
}
示例6: action_getall
public function action_getall()
{
$json = API::channel_api()->get_all_channels();
//return the json
$this->request->response = $json;
}