Proyectos de Subversion LeadersLinked - Services

Rev

Rev 247 | Rev 254 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 247 Rev 249
Línea 704... Línea 704...
704
            
704
            
705
            $share_url          = $base_share . $_SERVER['REQUEST_URI'];
705
            $share_url          = $base_share . $_SERVER['REQUEST_URI'];
706
            $share_image        = $base_share . '/images/ll-logo.png';
706
            $share_image        = $base_share . '/images/ll-logo.png';
707
            $share_title        = '';
707
            $share_title        = '';
-
 
708
            $share_description  = '';
Línea 708... Línea 709...
708
            $share_description  = '';
709
  
709
            
710
            
710
            
711
            
Línea 766... Línea 767...
766
                                $share_image =  $base_share . '/images/feed/' . $feed->uuid . '/' . $image_name;
767
                                $share_image =  $base_share . '/images/feed/' . $feed->uuid . '/' . $image_name;
767
                            }
768
                            }
768
                        }
769
                        }
769
                } else {
770
                } else {
Línea 770... Línea 771...
770
                    
771
                    
771
                    $response = new Response();
-
 
772
                    $headers = $response->getHeaders();
772
                    return new JsonModel([
773
                    $headers->clearHeaders();
-
 
774
                    $headers->addHeaderLine('Content-type', 'application/json; charset=UTF-8');
-
 
775
                    
773
                        'success' => false,
776
                    $response->setStatusCode(404);
-
 
777
                    $response->setContent(json_encode(['success' => false, 'data' => 'error-router-no-match', 'fatal' => true]));
774
                        'data' => 'ERROR_FEED_OR_POST_SHARED'
778
                    return $response;
775
                    ]);
779
                }
776
                }
Línea 780... Línea 777...
780
            } else if ($type == 'post' && $code) {
777
            } else if ($type == 'post' && $code) {
781
                
778
                
Línea 811... Línea 808...
811
                            $share_image =  $base_share . '/images/post/' . $post->uuid . '/' . $post->image;
808
                            $share_image =  $base_share . '/images/post/' . $post->uuid . '/' . $post->image;
812
                        }
809
                        }
813
                    }
810
                    }
814
                } else {
811
                } else {
Línea 815... Línea 812...
815
                    
812
                    
816
                    $response = new Response();
-
 
817
                    $headers = $response->getHeaders();
813
                    return new JsonModel([
818
                    $headers->clearHeaders();
-
 
819
                    $headers->addHeaderLine('Content-type', 'application/json; charset=UTF-8');
-
 
820
                    
814
                        'success' => false,
821
                    $response->setStatusCode(404);
-
 
822
                    $response->setContent(json_encode(['success' => false, 'data' => 'error-router-no-match', 'fatal' => true]));
815
                        'data' => 'ERROR_FEED_OR_POST_SHARED'
823
                    return $response;
816
                    ]);
824
                }
817
                }
Línea 825... Línea -...
825
            }
-
 
826
            
-
 
827
            /*
-
 
828
             echo '<pre>';
-
 
829
             print_r([ 'share_image' => $share_image,
-
 
830
             'share_url' => $share_url,
-
 
831
             'share_title' => strip_tags($share_title),
-
 
832
             'share_description' => strip_tags($share_description)]);  echo '</pre>';
-
 
833
             exit;
-
 
834
             */
818
            }
835
            
819
            
836
            if ($currentUserPlugin->hasIdentity()) {
820
            if ($currentUserPlugin->hasIdentity()) {
Línea 837... Línea 821...
837
                $currentUser = $currentUserPlugin->getUser();
821
                $currentUser = $currentUserPlugin->getUser();
Línea 854... Línea 838...
854
                        $connectionMapper->insert($connection);
838
                        $connectionMapper->insert($connection);
855
                    }
839
                    }
856
                }
840
                }
Línea 857... Línea 841...
857
 
841
 
858
            } else {
842
            } else {
-
 
843
                $this->cache->setItem('user_share_invitation', [
-
 
844
                    'code' => $code,
-
 
845
                    'type' => $type,
-
 
846
                    'user' => $user
859
                $this->cache->setItem('user_share_invitation', $user);
847
                ]);
860
            }
848
            }
-
 
849
            return new JsonModel([
-
 
850
                'success' => true, 
861
            return new JsonModel([
851
                'data' => [
862
                'share_image' => $share_image,
852
                    'image' => $share_image,
863
                'share_url' => $share_url,
853
                    'url' => $share_url,
864
                'share_title' => strip_tags($share_title),
854
                    'title' => strip_tags($share_title),
865
                'share_description' => strip_tags($share_description),
855
                    'description' => strip_tags($share_description),
Línea 866... Línea 856...
866
                // 'share_increment_external_counter_url' => $share_increment_external_counter_url,
856
                ]
Línea 867... Línea 857...
867
                
857
                
868
            ]);
858
            ]);