Minahito
minah****@users*****
2006年 3月 15日 (水) 19:20:21 JST
Index: xoops2jp/html/modules/base/class/Legacy_Validator.class.php diff -u /dev/null xoops2jp/html/modules/base/class/Legacy_Validator.class.php:1.1.2.1 --- /dev/null Wed Mar 15 19:20:21 2006 +++ xoops2jp/html/modules/base/class/Legacy_Validator.class.php Wed Mar 15 19:20:21 2006 @@ -0,0 +1,24 @@ +<?php + +require_once XOOPS_ROOT_PATH . "/class/XCube_Validator.class.php"; + +class XCube_ObjectExistValidator extends XCube_Validator +{ + function isValid(&$form, $vars) + { + if ($form->isNull()) { + return true; + } + else { + $handleName = $vars['handler']; + $moduleName = isset($vars['module']) ? $vars['module'] : null; + + $handler =& xoops_getmodulehandler($handleName); + $obj =& $handler->get($form->getValue()); + + return is_object($obj); + } + } +} + +?> \ No newline at end of file