Пример #1
0
 protected function _verifyExtraData(&$extraData)
 {
     if ($extraData === null) {
         $extraData = '';
         return true;
     }
     return XenForo_DataWriter_Helper_Denormalization::verifySerialized($extraData, $this, 'extra_data');
 }
Пример #2
0
 protected function _verifyPrivacy(&$privacy)
 {
     if (!is_array($privacy)) {
         $privacy = @unserialize($privacy);
     }
     if ($privacy === null) {
         $privacy = array('view' => array(-1), 'post' => array(-1));
         return true;
     }
     return XenForo_DataWriter_Helper_Denormalization::verifySerialized($privacy, $this, 'category_privacy');
 }
Пример #3
0
 protected function _verifyItemLimit(&$itemLimit)
 {
     if ($itemLimit === null || !$itemLimit) {
         $this->error(new XenForo_Phrase('BRMS_please_enter_valid_item_limit'), 'item_limit');
         return false;
     }
     if (!empty($itemLimit['value'])) {
         foreach ($itemLimit['value'] as $number) {
             if (!empty($number) && $number > 0) {
                 $output[] = intval($number);
             }
         }
         asort($output);
         $itemLimit['value'] = array_values(array_unique($output));
     }
     if (!empty($itemLimit['default'])) {
         $itemLimit['default'] = intval($itemLimit['default']);
     } else {
         $itemLimit['default'] = 15;
     }
     if (!empty($itemLimit['enabled']) && empty($itemLimit['value'])) {
         $this->error(new XenForo_Phrase('BRMS_must_have_value_for_item_limit'), 'item_limit');
         return false;
     }
     return XenForo_DataWriter_Helper_Denormalization::verifySerialized($itemLimit, $this, 'item_limit');
 }
Пример #4
0
 protected function _verifyPrivacy(&$privacy)
 {
     if ($privacy === null) {
         $xenOptions = XenForo_Application::getOptions();
         $privacy = array('allow_view' => $xenOptions->sonnbXG_albumPrivacyView, 'allow_view_data' => array(), 'allow_comment' => $xenOptions->sonnbXG_albumPrivacyComment, 'allow_comment_data' => array(), 'allow_download' => $xenOptions->sonnbXG_albumPrivacyDownload, 'allow_download_data' => array(), 'allow_add_photo' => $xenOptions->sonnbXG_albumPrivacyAdd, 'allow_add_photo_data' => array(), 'allow_add_video' => $xenOptions->sonnbXG_albumPrivacyAddVideo, 'allow_add_video_data' => array());
         $visitor = XenForo_Visitor::getInstance();
         if (!empty($visitor['xengallery'])) {
             $privacy = array('allow_view' => $visitor['xengallery']['album_allow_view'], 'allow_view_data' => array(), 'allow_comment' => $visitor['xengallery']['album_allow_comment'], 'allow_comment_data' => array(), 'allow_download' => $visitor['xengallery']['album_allow_download'], 'allow_download_data' => array(), 'allow_add_photo' => $visitor['xengallery']['album_allow_add_photo'], 'allow_add_photo_data' => array(), 'allow_add_video' => $visitor['xengallery']['album_allow_add_video'], 'allow_add_video_data' => array());
         }
         return true;
     }
     return XenForo_DataWriter_Helper_Denormalization::verifySerialized($privacy, $this, 'album_privacy');
 }
Пример #5
0
 protected function _verifyPrivacy(&$privacy)
 {
     if ($privacy === null || empty($privacy)) {
         $contentType = $this->get('content_type');
         $privacy = array('allow_view' => $this->_getDefaultPrivacy($contentType, 'view'), 'allow_view_data' => array(), 'allow_comment' => $this->_getDefaultPrivacy($contentType, 'comment'), 'allow_comment_data' => array());
         return true;
     }
     return XenForo_DataWriter_Helper_Denormalization::verifySerialized($privacy, $this, 'content_privacy');
 }