18 require_once SQ_INCLUDE_PATH.
'/asset.inc';
64 $this->_ser_attrs = TRUE;
67 if (!$ipbid || empty($data)) {
71 $ipb_bridge =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($ipbid,
'ipb_bridge');
72 if (is_null($ipb_bridge))
return;
74 $this->_ipbid = $ipbid;
77 $tmp = explode(
'_', $data[
'id']);
78 $this->_prefix = $tmp[0];
79 $this->_suffix = $tmp[1];
80 $this->
id = $ipb_bridge->id.
':'.$data[
'id'];
81 if ($this->_suffix !=
'0') {
82 $this->name =
'('.$data[
'poll_state'].
') '.$data[
'poll_question'];
84 $this->name = $data[
'poll_question'];
87 $this->short_name = $this->name;
88 $this->status = $ipb_bridge->status;
89 $this->version =
'0.1';
90 if (!empty($ipb_bridge->created)) {
91 $this->created = date(
'Y-m-d H:m:i', $ipb_bridge->created);
93 if (!empty($ipb_bridge->updated)) {
94 $this->updated = date(
'Y-m-d H:m:i', $ipb_bridge->updated);
96 if (!empty($ipb_bridge->published)) {
97 $this->published = date(
'Y-m-d H:m:i', $ipb_bridge->published);
99 if (!empty($ipb_bridge->status_changed)) {
100 $this->status_changed = date(
'Y-m-d H:m:i', $ipb_bridge->status_changed);
106 if ($this->_suffix !=
'0') {
107 $this->vars[
'pid'][
'type'] =
'int';
108 $this->vars[
'pid'][
'value'] = $data[
'pid'];
110 $this->vars[
'tid'][
'type'] =
'int';
111 $this->vars[
'tid'][
'value'] = $data[
'tid'];
113 $this->vars[
'start_date'][
'type'] =
'int';
114 $this->vars[
'start_date'][
'value'] = $data[
'start_date'];
116 $this->vars[
'choices'][
'type'] =
'text';
117 $this->vars[
'choices'][
'value'] = $data[
'choices'];
119 $this->vars[
'starter_id'][
'type'] =
'int';
120 $this->vars[
'starter_id'][
'value'] = $data[
'starter_id'];
122 $this->vars[
'votes'][
'type'] =
'int';
123 $this->vars[
'votes'][
'value'] = $data[
'votes'];
125 $this->vars[
'forum_id'][
'type'] =
'int';
126 $this->vars[
'forum_id'][
'value'] = $data[
'forum_id'];
128 $this->vars[
'poll_question'][
'type'] =
'text';
129 $this->vars[
'poll_question'][
'value'] = $data[
'poll_question'];
131 $this->vars[
'poll_state'][
'type'] =
'text';
132 $this->vars[
'poll_state'][
'value'] = $data[
'poll_state'];