本文整理汇总了PHP中BASE_CLASS_Widget::validateSettingList方法的典型用法代码示例。如果您正苦于以下问题:PHP BASE_CLASS_Widget::validateSettingList方法的具体用法?PHP BASE_CLASS_Widget::validateSettingList怎么用?PHP BASE_CLASS_Widget::validateSettingList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BASE_CLASS_Widget
的用法示例。
在下文中一共展示了BASE_CLASS_Widget::validateSettingList方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: validateSettingList
public static function validateSettingList($settingList)
{
parent::validateSettingList($settingList);
if ($settingList["list"] == "by_role" && empty($settingList["roles"])) {
throw new WidgetSettingValidateException(OW::getLanguage()->text("ucarousel", "widget_settings_list_roles_error"), 'roles');
}
if ($settingList["list"] == "by_account_type" && empty($settingList["account_types"])) {
throw new WidgetSettingValidateException(OW::getLanguage()->text("ucarousel", "widget_settings_list_roles_account_types"), 'account_types');
}
}
示例2: validateSettingList
public static function validateSettingList($settingList)
{
parent::validateSettingList($settingList);
$validationMessage = OW::getLanguage()->text('photo', 'cmp_widget_photo_count_msg');
if (!preg_match('/^\\d+$/', $settingList['photoCount'])) {
throw new WidgetSettingValidateException($validationMessage, 'photoCount');
}
if ($settingList['photoCount'] > 100) {
throw new WidgetSettingValidateException($validationMessage, 'photoCount');
}
}
示例3: validateSettingList
public static function validateSettingList($settingList)
{
parent::validateSettingList($settingList);
$validationMessage = OW::getLanguage()->text('gheader', 'widget_height_validation_error', array('min' => self::MIN_HEIGHT, 'max' => self::MAX_HEIGHT));
$settingList['coverHeight'] = intval($settingList['coverHeight']);
if ($settingList['coverHeight'] < self::MIN_HEIGHT) {
throw new WidgetSettingValidateException($validationMessage, 'coverHeight');
}
if ($settingList['coverHeight'] > self::MAX_HEIGHT) {
throw new WidgetSettingValidateException($validationMessage, 'coverHeight');
}
if (!GHEADER_CLASS_PhotoBridge::getInstance()->isActive()) {
return;
}
$albumName = trim($settingList['albumName']);
if ($settingList['saveToPhoto'] && empty($albumName)) {
$errorMessage = OW::getLanguage()->text('gheader', 'widget_album_name_validation_error');
throw new WidgetSettingValidateException($errorMessage, 'albumName');
}
}
示例4: validateSettingList
public static function validateSettingList($settingList)
{
parent::validateSettingList($settingList);
if (!UTIL_Validator::isUrlValid($settingList['rss_url'])) {
throw new WidgetSettingValidateException(OW::getLanguage()->text('base', 'rss_widget_url_invalid_msg'), 'rss_url');
}
$urlInfo = parse_url($settingList['rss_url']);
$urlHomeInfo = parse_url(OW_URL_HOME);
if ($urlInfo['host'] == $urlHomeInfo['host']) {
throw new WidgetSettingValidateException(OW::getLanguage()->text('base', 'rss_widget_url_invalid_msg'), 'rss_url');
}
}
示例5: validateSettingList
public static function validateSettingList($settingList)
{
parent::validateSettingList($settingList);
$validationMessage = OW::getLanguage()->text('forum', 'cmp_widget_forum_topics_count_msg');
if (!preg_match('/^\\d+$/', $settingList['topicCount'])) {
throw new WidgetSettingValidateException($validationMessage, 'topicCount');
}
if ($settingList['topicCount'] > 20) {
throw new WidgetSettingValidateException($validationMessage, 'topicCount');
}
$validationMessage = OW::getLanguage()->text('forum', 'cmp_widget_forum_topics_post_length_msg');
if (!preg_match('/^\\d+$/', $settingList['postLength'])) {
throw new WidgetSettingValidateException($validationMessage, 'postLength');
}
if ($settingList['postLength'] > 1000) {
throw new WidgetSettingValidateException($validationMessage, 'postLength');
}
}
示例6: validateSettingList
public static function validateSettingList($settingList)
{
parent::validateSettingList($settingList);
if (!UTIL_Validator::isUrlValid($settingList['rss_url'])) {
throw new WidgetSettingValidateException(OW::getLanguage()->text('base', 'rss_widget_url_invalid_msg'), 'rss_url');
}
}