当前位置: 首页>>代码示例>>PHP>>正文


PHP API::channel_api方法代码示例

本文整理汇总了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;
 }
开发者ID:katembu,项目名称:Swiftriver,代码行数:33,代码来源:channeltree.php

示例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);
 }
开发者ID:katembu,项目名称:Swiftriver,代码行数:13,代码来源:sources.php

示例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;
 }
开发者ID:ultimateprogramer,项目名称:Swiftriver,代码行数:15,代码来源:termstomonitor.php

示例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;
         }
     }
 }
开发者ID:katembu,项目名称:Swiftriver,代码行数:15,代码来源:addchannel.php

示例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);
 }
开发者ID:Bridgeborn,项目名称:Swiftriver,代码行数:6,代码来源:sources.php

示例6: action_getall

 public function action_getall()
 {
     $json = API::channel_api()->get_all_channels();
     //return the json
     $this->request->response = $json;
 }
开发者ID:katembu,项目名称:Swiftriver,代码行数:6,代码来源:channels.php


注:本文中的API::channel_api方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。