Skip to content

Commit 6838cf7

Browse files
committed
LINEMSG_Template actions
1 parent 9c6ced8 commit 6838cf7

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

api.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,77 @@ public function set($var, $value = null){
659659
public function out(){
660660
return $this->object;
661661
}
662+
663+
public function actions($type){
664+
switch($type){
665+
case "postback":
666+
$this->actions = array(
667+
"type" => "postback",
668+
"label" => null,
669+
"data" => null,
670+
"text" => null
671+
);
672+
break;
673+
case "message":
674+
$this->actions = array(
675+
"type" => "message",
676+
"label" => null,
677+
"text" => null
678+
);
679+
break;
680+
case "uri":
681+
$this->actions = array(
682+
"type" => "uri",
683+
"label" => null,
684+
"uri" => null
685+
);
686+
break;
687+
case "datetimepicker":
688+
$this->actions = array(
689+
"type" => "datetimepicker",
690+
"label" => null,
691+
"data" => null,
692+
"mode" => null,
693+
"initial" => null,
694+
"max" => null,
695+
"min" => null
696+
);
697+
break;
698+
case "camera":
699+
$this->actions = array(
700+
"type" => "camera",
701+
"label" => null
702+
);
703+
break;
704+
case "cameraRoll":
705+
$this->actions = array(
706+
"type" => "cameraRoll",
707+
"label" => null
708+
);
709+
break;
710+
case "location":
711+
$this->actions = array(
712+
"type" => "location",
713+
"label" => null
714+
);
715+
break;
716+
}
717+
}
718+
719+
public function actions_set($var, $value = null){
720+
if(gettype($var) == "array"){
721+
$keys = array_keys($this->actions);
722+
foreach($var as $num => $run){
723+
$this->set($keys[$num+1], $run);
724+
}
725+
}else{
726+
$this->actions[$var] = $value;
727+
}
728+
}
729+
730+
public function actions_out(){
731+
return $this->actions;
732+
}
662733
}
663734

664735
class LINEMSG_FlexContainer {

0 commit comments

Comments
 (0)