1 | <?php |
||
31 | class WidgetController extends Controller |
||
32 | { |
||
33 | /** |
||
34 | * @var Widget |
||
35 | */ |
||
36 | protected $widget; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | private static $allowed_actions = array( |
||
42 | 'editablesegment' |
||
43 | ); |
||
44 | |||
45 | /** |
||
46 | * @param Widget $widget |
||
47 | */ |
||
48 | public function __construct($widget = null) |
||
57 | |||
58 | /** |
||
59 | * @param string $action |
||
60 | * @return string |
||
61 | */ |
||
62 | public function Link($action = null) |
||
78 | |||
79 | /** |
||
80 | * Cycles up the controller stack until it finds a non-widget controller |
||
81 | * This is needed becauseController::currreturns the widget controller, |
||
82 | * which means anyLinkfunction turns into endless loop. |
||
83 | * |
||
84 | * @return Controller |
||
85 | */ |
||
86 | public function getParentController() |
||
95 | |||
96 | /** |
||
97 | * @return Widget |
||
98 | */ |
||
99 | public function getWidget() |
||
103 | |||
104 | /** |
||
105 | * Overloaded from {@link Widget->Content()} to allow for controller / form |
||
106 | * linking. |
||
107 | * |
||
108 | * @return string HTML |
||
109 | */ |
||
110 | public function Content() |
||
114 | |||
115 | /** |
||
116 | * Overloaded from {@link Widget->WidgetHolder()} to allow for controller/ |
||
117 | * form linking. |
||
118 | * |
||
119 | * @return string HTML |
||
120 | */ |
||
121 | public function WidgetHolder() |
||
125 | |||
126 | /** |
||
127 | * Uses the `WidgetEditor.ss` template and {@link Widget->editablesegment()} |
||
128 | * to render a administrator-view of the widget. It is assumed that this |
||
129 | * view contains form elements which are submitted and saved through |
||
130 | * {@link WidgetAreaEditor} within the CMS interface. |
||
131 | * |
||
132 | * @return string HTML |
||
133 | */ |
||
134 | public function editablesegment() |
||
155 | } |
||
156 |
This check marks private properties in classes that are never used. Those properties can be removed.