|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00012 require_once(dirname(__FILE__) . '/tag.php'); 00013 require_once(dirname(__FILE__) . '/encoding.php'); 00022 class SimpleByName { 00023 var $_name; 00024 00029 function SimpleByName($name) { 00030 $this->_name = $name; 00031 } 00032 00033 function getName() { 00034 return $this->_name; 00035 } 00036 00042 function isMatch($widget) { 00043 return ($widget->getName() == $this->_name); 00044 } 00045 } 00046 00053 class SimpleByLabel { 00054 var $_label; 00055 00060 function SimpleByLabel($label) { 00061 $this->_label = $label; 00062 } 00063 00070 function isMatch($widget) { 00071 if (! method_exists($widget, 'isLabel')) { 00072 return false; 00073 } 00074 return $widget->isLabel($this->_label); 00075 } 00076 } 00077 00084 class SimpleById { 00085 var $_id; 00086 00091 function SimpleById($id) { 00092 $this->_id = $id; 00093 } 00094 00100 function isMatch($widget) { 00101 return $widget->isId($this->_id); 00102 } 00103 } 00104 00111 class SimpleByLabelOrName { 00112 var $_label; 00113 00118 function SimpleByLabelOrName($label) { 00119 $this->_label = $label; 00120 } 00121 00128 function isMatch($widget) { 00129 if (method_exists($widget, 'isLabel')) { 00130 if ($widget->isLabel($this->_label)) { 00131 return true; 00132 } 00133 } 00134 return ($widget->getName() == $this->_label); 00135 } 00136 } 00137 ?>