本文整理汇总了PHP中RSFormProHelper::getRelativeUploadPath方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::getRelativeUploadPath方法的具体用法?PHP RSFormProHelper::getRelativeUploadPath怎么用?PHP RSFormProHelper::getRelativeUploadPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSFormProHelper
的用法示例。
在下文中一共展示了RSFormProHelper::getRelativeUploadPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateName
public function validateName()
{
$input = JFactory::getApplication()->input;
$componentName = trim(JRequest::getVar('componentName', ''));
if (preg_match('#([^a-zA-Z0-9_ ])#', $componentName) || empty($componentName) || $componentName == 'elements') {
echo '0|' . JText::_('RSFP_UNIQUE_NAME_MSG');
$this->close();
}
//on file upload component, check destination
$componentType = $input->getInt('componentType');
if ($componentType == 9) {
$destination = JRequest::getVar('destination');
$destination = RSFormProHelper::getRelativeUploadPath($destination);
if (empty($destination)) {
echo '2|' . JText::_('RSFP_ERROR_DESTINATION_MSG');
$this->close();
}
if (!is_dir($destination)) {
echo '2|' . JText::_('RSFP_ERROR_DESTINATION_MSG');
$this->close();
}
if (!is_writable($destination)) {
echo '2|' . JText::_('RSFP_ERROR_DESTINATION_WRITABLE_MSG');
$this->close();
}
}
$currentComponentId = $input->getInt('currentComponentId');
$componentId = $input->getInt('componentId');
$formId = $input->getInt('formId');
$exists = RSFormProHelper::componentNameExists($componentName, $formId, $currentComponentId);
if ($exists) {
echo '0|' . JText::_('RSFP_UNIQUE_NAME_MSG');
} else {
echo 'Ok';
}
$this->close();
}