浏览代码

Move roku to apps.

Mark Crane 13 年之前
父节点
当前提交
0fa031bb4b
共有 2 个文件被更改,包括 117 次插入0 次删除
  1. 91 0
      roku/roku.php
  2. 26 0
      roku/v_config.php

+ 91 - 0
roku/roku.php

@@ -0,0 +1,91 @@
+<?php
+/*
+	FusionPBX
+	Version: MPL 1.1
+
+	The contents of this file are subject to the Mozilla Public License Version
+	1.1 (the "License"); you may not use this file except in compliance with
+	the License. You may obtain a copy of the License at
+	http://www.mozilla.org/MPL/
+
+	Software distributed under the License is distributed on an "AS IS" basis,
+	WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+	for the specific language governing rights and limitations under the
+	License.
+
+	The Original Code is FusionPBX
+
+	The Initial Developer of the Original Code is
+	Mark J Crane <[email protected]>
+	Portions created by the Initial Developer are Copyright (C) 2008-2010
+	the Initial Developer. All Rights Reserved.
+
+	Contributor(s):
+	Mark J Crane <[email protected]>
+*/
+error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ); //hide notices and warnings
+
+//roku commands
+	//press up
+	//press down
+	//press left
+	//press right
+	//press select
+	//press home
+	//press fwd
+	//press back
+	//press pause 
+
+if (strlen($_SERVER['argv'][1]) > 0) { 
+	$cmd = $_SERVER['argv'][1];
+	switch ($cmd) {
+	case "1":
+		$cmd = "home";
+		break;
+	case "2":
+		$cmd = "up";
+		break;
+	case "3":
+		$cmd = "home";
+		break;
+	case "4":
+		$cmd = "left";
+		break;
+	case "5":
+		$cmd = "select";
+		break;
+	case "6":
+		$cmd = "right";
+		break;
+	case "7":
+		$cmd = "back";
+		break;
+	case "8":
+		$cmd = "down";
+		break;
+	case "9":
+		$cmd = "fwd";
+		break;
+	case "0":
+		$cmd = "pause"; //toggle play/pause
+		break;
+	case "#":
+		$cmd = "pause"; //toggle play/pause
+		break;
+	default:
+		$cmd = "pause"; //toggle play/pause
+	}
+}
+if (strlen($cmd)==0) {
+	if (strlen($_GET['cmd']) > 0) { $cmd = $_GET['cmd']; }
+}
+
+$host = $_SERVER['argv'][2];
+$port = $_SERVER['argv'][3];
+
+$cmd = "press ".$cmd;
+
+$fp = fsockopen($host, $port, $errno, $errdesc) or die("Connection to $host $errno $errdesc failed");
+fputs($fp, $cmd."\r\n");
+
+?>

+ 26 - 0
roku/v_config.php

@@ -0,0 +1,26 @@
+<?php
+	/*
+	//application details
+		$apps[$x]['name'] = "Roku";
+		$apps[$x]['guid'] = 'zzz';
+		$apps[$x]['category'] = '';
+		$apps[$x]['subcategory'] = '';
+		$apps[$x]['version'] = '';
+		$apps[$x]['license'] = 'Mozilla Public License 1.1';
+		$apps[$x]['url'] = 'http://www.fusionpbx.com';
+		$apps[$x]['description']['en'] = 'zzz.';
+
+	//menu details
+		$apps[$x]['menu'][0]['title']['en'] = 'Roku';
+		$apps[$x]['menu'][0]['guid'] = 'zzz';
+		$apps[$x]['menu'][0]['parent_guid'] = 'zzz';
+		$apps[$x]['menu'][0]['category'] = 'internal';
+		$apps[$x]['menu'][0]['path'] = '/mod/zzz/zzz.php';
+		//$apps[$x]['menu'][0]['groups'][] = 'superadmin';
+
+	//permission details
+		$apps[$x]['permissions'][0]['name'] = 'zzz';
+		$apps[$x]['permissions'][0]['groups'][] = 'admin';
+		$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
+	*/
+?>