示例#1
0
 public function SJB_FacebookSocialDetails($info)
 {
     $this->commonFields = parent::getCommonFields();
     $this->postingFields = self::getPostingFields();
     $this->systemFields = self::getSystemFields();
     $detailsInfo = self::getDetails($this->commonFields);
     $sortArray = array();
     $locationPrefix = '';
     foreach ($detailsInfo as $index => $propertyInfo) {
         $sortArray[$index] = $propertyInfo['order'];
         if ($propertyInfo['type'] == 'location') {
             $locationPrefix = $propertyInfo['id'];
         }
     }
     $sortArray = SJB_HelperFunctions::array_sort($sortArray);
     foreach ($sortArray as $index => $value) {
         $sortedDetailsInfo[$index] = $detailsInfo[$index];
     }
     foreach ($sortedDetailsInfo as $detailInfo) {
         $detailInfo['value'] = '';
         $accountID = SJB_Request::getVar('account_id', false);
         if (isset($info[$detailInfo['id']])) {
             $detailInfo['value'] = $info[$detailInfo['id']];
         } elseif ($detailInfo['id'] == 'hash_tags') {
             $detailInfo['value'] = '#Jobs';
         } elseif ($detailInfo['id'] == 'post_template') {
             $detailInfo['value'] = '{$user.CompanyName}: {$listing.Title} ({$listing.' . $locationPrefix . '.City}, {$listing.' . $locationPrefix . '.State})';
         } elseif (isset($accountID) && $detailInfo['id'] == 'account_id') {
             $detailInfo['value'] = $accountID;
         }
         $this->properties[$detailInfo['id']] = new SJB_ObjectProperty($detailInfo);
     }
 }
示例#2
0
 /**
  * @param array $info
  * @param bool $isGroupsExist
  * @param bool $isAuthorized
  */
 function __construct($info = array(), $isGroupsExist = false, $isAuthorized = false)
 {
     $this->commonFields = parent::getCommonFields();
     $this->postingFields = self::getPostingFields();
     $this->systemFields = self::getSystemFields($isGroupsExist, $isAuthorized);
     $detailsInfo = self::getDetails($this->commonFields, $isGroupsExist, $isAuthorized);
     $locationPrefix = '';
     foreach ($detailsInfo as $index => $propertyInfo) {
         $sortArray[$index] = $propertyInfo['order'];
         if ($propertyInfo['type'] == 'location') {
             $locationPrefix = $propertyInfo['id'];
         }
     }
     $sortArray = SJB_HelperFunctions::array_sort($sortArray);
     foreach ($sortArray as $index => $value) {
         $sortedDetailsInfo[$index] = $detailsInfo[$index];
     }
     foreach ($sortedDetailsInfo as $detailInfo) {
         $detailInfo['value'] = '';
         if (isset($info[$detailInfo['id']])) {
             $detailInfo['value'] = $info[$detailInfo['id']];
         } elseif ($detailInfo['id'] == 'post_template') {
             $detailInfo['value'] = '{$user.CompanyName}: {$listing.Title} ({$listing.' . $locationPrefix . '.City}, {$listing.' . $locationPrefix . '.State})';
         }
         $this->properties[$detailInfo['id']] = new SJB_ObjectProperty($detailInfo);
     }
 }
示例#3
0
 function __construct($productInfo = array())
 {
     $details_info = $this->getDetails();
     foreach ($details_info as $index => $property_info) {
         $sort_array[$index] = $property_info['order'];
     }
     $sort_array = SJB_HelperFunctions::array_sort($sort_array);
     foreach ($sort_array as $index => $value) {
         $sorted_details_info[$index] = $details_info[$index];
     }
     foreach ($sorted_details_info as $detail_info) {
         $detail_info['value'] = '';
         if (isset($productInfo[$detail_info['id']])) {
             $detail_info['value'] = $productInfo[$detail_info['id']];
         }
         $this->properties[$detail_info['id']] = new SJB_ObjectProperty($detail_info);
     }
 }
示例#4
0
 function SJB_PostingPagesDetails($page_info, $listing_type_sid)
 {
     $details_info = self::getDetails($listing_type_sid);
     foreach ($details_info as $index => $property_info) {
         $sort_array[$index] = $property_info['order'];
     }
     $sort_array = SJB_HelperFunctions::array_sort($sort_array);
     foreach ($sort_array as $index => $value) {
         $sorted_details_info[$index] = $details_info[$index];
     }
     foreach ($sorted_details_info as $detail_info) {
         $detail_info['value'] = '';
         if (isset($page_info[$detail_info['id']])) {
             $detail_info['value'] = $page_info[$detail_info['id']];
         }
         $this->properties[$detail_info['id']] = new SJB_ObjectProperty($detail_info);
     }
 }
示例#5
0
 public function __construct($listing_field_info, $pages_list = array())
 {
     $details_info = self::getDetails($listing_field_info, $pages_list);
     $sort_array = array();
     foreach ($details_info as $index => $property_info) {
         $sort_array[$index] = isset($property_info['order']) ? $property_info['order'] : 1000;
     }
     $sort_array = SJB_HelperFunctions::array_sort($sort_array);
     foreach ($sort_array as $index => $value) {
         $sorted_details_info[$index] = $details_info[$index];
     }
     foreach ($sorted_details_info as $detail_info) {
         if (isset($listing_field_info[$detail_info['id']])) {
             $detail_info['value'] = $listing_field_info[$detail_info['id']];
         } else {
             $detail_info['value'] = isset($detail_info['value']) ? $detail_info['value'] : '';
         }
         $this->properties[$detail_info['id']] = new SJB_ObjectProperty($detail_info);
     }
 }
示例#6
0
 public function __construct($articleInfo)
 {
     $detailsInfo = self::getDetails();
     //SORT BY ORDER
     $sortArray = array();
     foreach ($detailsInfo as $index => $propertyInfo) {
         $sortArray[$index] = $propertyInfo['order'];
     }
     $sortArray = SJB_HelperFunctions::array_sort($sortArray);
     $sortedDetailsInfo = array();
     foreach ($sortArray as $index => $value) {
         $sortedDetailsInfo[$index] = $detailsInfo[$index];
     }
     foreach ($sortedDetailsInfo as $detailInfo) {
         $detailInfo['value'] = '';
         if (isset($articleInfo[$detailInfo['id']])) {
             $detailInfo['value'] = $articleInfo[$detailInfo['id']];
         }
         $this->properties[$detailInfo['id']] = new SJB_ObjectProperty($detailInfo);
     }
 }
示例#7
0
 public static function array_sort_reverse($array)
 {
     $sorted_array = SJB_HelperFunctions::array_sort($array);
     return array_reverse($sorted_array, true);
 }
示例#8
0
 function SJB_CaptchaDetails($info, $type = false)
 {
     $details_info = self::getDetails($type);
     foreach ($details_info as $index => $property_info) {
         $sort_array[$index] = $property_info['order'];
     }
     $sort_array = SJB_HelperFunctions::array_sort($sort_array);
     $sorted_details_info = array();
     foreach ($sort_array as $index => $value) {
         $sorted_details_info[$index] = $details_info[$index];
     }
     foreach ($sorted_details_info as $detail_info) {
         $detail_info['value'] = '';
         if (isset($info[$detail_info['id']])) {
             $detail_info['value'] = $info[$detail_info['id']];
         }
         $this->properties[$detail_info['id']] = new SJB_ObjectProperty($detail_info);
     }
 }
示例#9
0
 function SJB_ComplexDetails($details_info, $fields_info = array())
 {
     $sort_array = array();
     $sorted_details_info = array();
     foreach ($details_info as $index => $property_info) {
         $sort_array[$index] = $property_info['order'];
     }
     $sort_array = SJB_HelperFunctions::array_sort($sort_array);
     foreach ($sort_array as $index => $value) {
         $sorted_details_info[$index] = $details_info[$index];
     }
     foreach ($sorted_details_info as $detail_info) {
         $detail_info['value'] = null;
         if (isset($fields_info[$detail_info['id']])) {
             $detail_info['value'] = $fields_info[$detail_info['id']];
         }
         $this->properties[$detail_info['id']] = new SJB_ObjectProperty($detail_info);
     }
 }