Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eadf0ea
commit 6dabf14
Showing
10 changed files
with
363 additions
and
317 deletions.
There are no files selected for viewing
50 changes: 39 additions & 11 deletions
50
...SDK/hooks/opengraph-hook/docroot/META-INF/custom_jsps/html/common/themes/top_meta-ext.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,47 @@ | ||
<%@ page import="com.liferay.portal.kernel.facebook.FacebookConnectUtil" %> | ||
<%-- | ||
/** | ||
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. | ||
* | ||
* The contents of this file are subject to the terms of the Liferay Enterprise | ||
* Subscription License ("License"). You may not use this file except in | ||
* compliance with the License. You can obtain a copy of the License by | ||
* contacting Liferay, Inc. See the License for the specific language governing | ||
* permissions and limitations under the License, including but not limited to | ||
* distribution rights of the Software. | ||
* | ||
* | ||
* | ||
*/ | ||
--%> | ||
|
||
<%@ include file="/html/common/init.jsp" %> | ||
|
||
<meta content="<%= FacebookConnectUtil.getAppId(company.getCompanyId()) %>" property="fb:app_id" /> | ||
|
||
<% | ||
Map<String, String> opengraphAttributes = (Map<String, String>)request.getAttribute("LIFERAY_SHARED_OPENGRAPH"); | ||
if (opengraphAttributes != null) { | ||
for (String key : opengraphAttributes.keySet()) { | ||
Map<String, String> ogAttrs = (Map<String, String>)request.getAttribute("LIFERAY_SHARED_OPENGRAPH"); | ||
if (ogAttrs != null) { | ||
for (String key : ogAttrs.keySet()) { | ||
%> | ||
<meta property="og:<%= key %>" content="<%= HtmlUtil.escape(ogAttrs.get(key)) %>" /> | ||
<% | ||
} | ||
} | ||
Map<String, String> fbAttrs = (Map<String, String>)request.getAttribute("LIFERAY_SHARED_FACEBOOK"); | ||
if (fbAttrs != null) { | ||
for (String key : fbAttrs.keySet()) { | ||
%> | ||
<meta property="fb:<%= key %>" content="<%= HtmlUtil.escape(fbAttrs.get(key)) %>" /> | ||
<% | ||
} | ||
} | ||
<meta content="<%= HtmlUtil.escape(opengraphAttributes.get(key)) %>" property="og:<%= key %>" /> | ||
|
||
Map<String, String> twAttrs = (Map<String, String>)request.getAttribute("LIFERAY_SHARED_TWITTER"); | ||
if (twAttrs != null) { | ||
for (String key : twAttrs.keySet()) { | ||
%> | ||
<meta name="twitter:<%= key %>" content="<%= HtmlUtil.escape(twAttrs.get(key)) %>" /> | ||
<% | ||
} | ||
} | ||
} | ||
%> |
66 changes: 0 additions & 66 deletions
66
...-hook/docroot/META-INF/custom_jsps/html/portlet/layouts_admin/layout/facebook_preview.jsp
This file was deleted.
Oops, something went wrong.
91 changes: 91 additions & 0 deletions
91
...hook/docroot/META-INF/custom_jsps/html/portlet/layouts_admin/layout/opengraph_preview.jsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<%-- | ||
/** | ||
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved. | ||
* | ||
* This library is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This library is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
*/ | ||
--%> | ||
|
||
<%@ include file="/html/portlet/layouts_admin/init.jsp" %> | ||
|
||
<% | ||
Layout selLayout = (Layout)request.getAttribute("edit_pages.jsp-selLayout"); | ||
UnicodeProperties layoutTypeSettings = null; | ||
if (selLayout != null) { | ||
layoutTypeSettings = selLayout.getTypeSettingsProperties(); | ||
} | ||
String ogTitle = layoutTypeSettings.getProperty("og-title"); | ||
String ogType = layoutTypeSettings.getProperty("og-type"); | ||
String ogURL = layoutTypeSettings.getProperty("og-URL"); | ||
String ogImage = layoutTypeSettings.getProperty("og-image"); | ||
String ogDescription = layoutTypeSettings.getProperty("og-description"); | ||
String ogLocale = layoutTypeSettings.getProperty("og-locale"); | ||
String ogSiteName = layoutTypeSettings.getProperty("og-site_name"); | ||
String ogVideo = layoutTypeSettings.getProperty("og-video"); | ||
String ogAudio = layoutTypeSettings.getProperty("og-audio"); | ||
String fbAppId = layoutTypeSettings.getProperty("fb-app_id"); | ||
String fbAdmins = layoutTypeSettings.getProperty("fb-admins"); | ||
String twCard = layoutTypeSettings.getProperty("twitter-card"); | ||
String twTitle = layoutTypeSettings.getProperty("twitter-title"); | ||
String twDescription = layoutTypeSettings.getProperty("twitter-description"); | ||
String twURL = layoutTypeSettings.getProperty("twitter-url"); | ||
String twImage = layoutTypeSettings.getProperty("twitter-image"); | ||
String twSite = layoutTypeSettings.getProperty("twitter-site"); | ||
String twCreator = layoutTypeSettings.getProperty("twitter-creator"); | ||
%> | ||
|
||
<liferay-ui:error-marker key="errorSection" value="opengraph-preview" /> | ||
|
||
<h3><liferay-ui:message key="opengraph-preview" /></h3> | ||
|
||
<aui:model-context bean="<%= selLayout %>" model="<%= Layout.class %>" /> | ||
|
||
<h4><liferay-ui:message key="opengraph-metadata" /></h4> | ||
|
||
<aui:fieldset> | ||
<aui:input helpMessage="og-type-help" label="type" name="TypeSettingsProperties--og-type--" type="text" value="<%= ogType %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="og-title-help" label="title" name="TypeSettingsProperties--og-title--" type="text" value="<%= ogTitle %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="og-image-help" label="image-url" name="TypeSettingsProperties--og-image--" type="text" value="<%= ogImage %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="og-description-help" label="description" name="TypeSettingsProperties--og-description--" type="textarea" value="<%= ogDescription %>" style="min-width:300px;min-height:150px;" /> | ||
<aui:input helpMessage="og-video-help" label="video-url" name="TypeSettingsProperties--og-video--" type="text" value="<%= ogVideo %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="og-audio-help" label="audio-url" name="TypeSettingsProperties--og-audio--" type="text" value="<%= ogAudio %>" style="min-width:300px;" /> | ||
</aui:fieldset> | ||
|
||
<br /> | ||
|
||
<h4><liferay-ui:message key="facebook-metadata" /></h4> | ||
|
||
<aui:fieldset> | ||
<aui:input helpMessage="fb-app_id-help" label="fb-app_id" name="TypeSettingsProperties--fb-app_id--" type="text" value="<%= fbAppId %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="fb-admins-help" label="fb-admins" name="TypeSettingsProperties--fb-admins--" type="text" value="<%= fbAdmins %>" style="min-width:300px;" /> | ||
</aui:fieldset> | ||
|
||
<br /> | ||
|
||
<h4><liferay-ui:message key="twitter-metadata" /></h4> | ||
|
||
<aui:fieldset> | ||
<aui:select helpMessage="twitter-card-help" label="twitter-card" name="TypeSettingsProperties--twitter-card--" style="min-width:300px;"> | ||
<aui:option label="" value="" /> | ||
<aui:option label="twitter-card-summary" selected='<%= Validator.equals(twCard, "summary") %>' value="summary" /> | ||
<aui:option label="twitter-card-summary_large_image" selected='<%= Validator.equals(twCard, "summary_large_image") %>' value="summary_large_image" /> | ||
<aui:option label="twitter-card-photo" selected='<%= Validator.equals(twCard, "photo") %>' value="photo" /> | ||
<aui:option label="twitter-card-gallery" selected='<%= Validator.equals(twCard, "gallery") %>' value="gallery" /> | ||
<aui:option label="twitter-card-product" selected='<%= Validator.equals(twCard, "product") %>' value="product" /> | ||
<aui:option label="twitter-card-app" selected='<%= Validator.equals(twCard, "app") %>' value="app" /> | ||
<aui:option label="twitter-card-player" selected='<%= Validator.equals(twCard, "player") %>' value="player" /> | ||
</aui:select> | ||
<aui:input helpMessage="twitter-title-help" label="twitter-title" name="TypeSettingsProperties--twitter-title--" type="text" value="<%= twTitle %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="twitter-description-help" label="twitter-description" name="TypeSettingsProperties--twitter-description--" type="textarea" value="<%= twDescription %>" style="min-width:300px;min-height:150px;" /> | ||
<aui:input helpMessage="twitter-image-help" label="twitter-image" name="TypeSettingsProperties--twitter-image--" type="text" value="<%= twImage %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="twitter-site-help" label="twitter-site" name="TypeSettingsProperties--twitter-site--" type="text" value="<%= twSite %>" style="min-width:300px;" /> | ||
<aui:input helpMessage="twitter-creator-help" label="twitter-creator" name="TypeSettingsProperties--twitter-creator--" type="text" value="<%= twCreator %>" style="min-width:300px;" /> | ||
</aui:fieldset> |
35 changes: 0 additions & 35 deletions
35
...hook/docroot/META-INF/custom_jsps/html/portlet/portal_settings/facebook_configuration.jsp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.