{#
The current upstream version can be found here: https://github.com/owncloud/core/blob/master/themes/example/defaults.php
Raw: https://raw.githubusercontent.com/owncloud/core/master/themes/example/defaults.php

* Escape quotes to prevent PHP code injection via variables?
  No, to allow more flexibility for users of the role. Injecting PHP code can
  be useful.
#}
<?php
/**
 * {{ ansible_managed }}
 *
 * @author Björn Schießle <schiessle@owncloud.com>
 * @author Jan-Christoph Borchardt, http://jancborchardt.net
 * @copyright Copyright (c) 2015, ownCloud, Inc.
 * @license AGPL-3.0-only
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
 */

class OC_Theme {

  /**
   * Returns the base URL
   * @return string URL
   */
{% if owncloud__theme_base_url != '' %}
  public function getBaseUrl() {
    return '{{ owncloud__theme_base_url }}';
  }
{% else %}
  /* Not otherwise defined. Falling back to ownCloud default value. */
{% endif %}

  /**
   * Returns the URL where the sync clients are listed
   * @return string URL
   */
  public function getSyncClientUrl() {
    return 'https://owncloud.org/install';
  }

  /**
   * Returns the URL to the App Store for the iOS Client
   * @return string URL
   */
  public function getiOSClientUrl() {
    return 'https://itunes.apple.com/us/app/owncloud/id543672169?mt=8';
  }

  /**
   * Returns the AppId for the App Store for the iOS Client
   * @return string AppId
   */
  public function getiTunesAppId() {
    return '543672169';
  }

  /**
   * Returns the URL to Google Play for the Android Client
   * @return string URL
   */
  public function getAndroidClientUrl() {
    return 'https://play.google.com/store/apps/details?id=com.owncloud.android';
  }

{#
Fallback not possible as of 9.0.2.
#}
  /**
   * Returns the documentation URL
   * @return string URL
   */
  public function getDocBaseUrl() {
    return 'https://doc.owncloud.org';
  }

  /**
   * Returns the title
   * @return string title
   */
  public function getTitle() {
    return '{{ owncloud__theme_title }}';
  }

  /**
   * Returns the short name of the software
   * @return string title
   */
  public function getName() {
    return '{{ owncloud__theme_name }}';
  }

  /**
   * Returns the short name of the software containing HTML strings
   * @return string title
   */
  public function getHTMLName() {
    return '{{ owncloud__theme_name_html }}';
  }

  /**
   * Returns entity (e.g. company name) - used for footer, copyright
   * @return string entity name
   */
  public function getEntity() {
    return '{{ owncloud__theme_entity_name }}';
  }

  /**
   * Returns slogan
   * @return string slogan
   */
{% if owncloud__theme_slogan != '' %}
  public function getSlogan() {
    return '{{ owncloud__theme_slogan }}';
  }
{% else %}
  /* Not otherwise defined. Falling back to ownCloud default value. */
{% endif %}

{#

# .. envvar:: owncloud__theme_logo_claim
#
# The logo claim can be used to add a hidden claim about the logo.
# This feature seems to be rarely used and it is not sure if that is the intention behind this variable.
# Checkout `this comment about
# <https://github.com/owncloud/core/issues/5676#issuecomment-27649493>`_ for a
# for discussion.
#
# https://github.com/owncloud/core/issues/5676#issuecomment-228990394
# > The use is simply for the ownCloud Enterprise Edition to display »Enterprise
# > Edition« next to the logo/appname in the header when logged in. It’s used for
# > nothing else. I would strongly advise against ever using it because it will
# > just distract and clutter up the header (won’t work on mobile anyway).
owncloud__theme_logo_claim: ''

#}
  /**
   * Returns logo claim
   * @return string logo claim
   */
{% if owncloud__theme_logo_claim|d('') != '' %}
  public function getLogoClaim() {
    return '{{ owncloud__theme_logo_claim }}';
  }
{% else %}
  /* Not otherwise defined. Falling back to ownCloud default value. */
{% endif %}

{#
Fallback not possible as of 9.0.1.
#}
  /**
   * Returns short version of the footer
   * @return string short footer
   */
  public function getShortFooter() {
    $footer = {{ owncloud__theme_footer_short }};

    return $footer;
  }

{#
Fallback not possible as of 9.0.1.
#}
  /**
   * Returns long version of the footer
   * @return string long footer
   */
  public function getLongFooter() {
    $footer = {{ owncloud__theme_footer_long }};

    return $footer;
  }

  public function buildDocLinkToKey($key) {
    return {{ owncloud__theme_doc_link_to_key }};
  }


  /**
   * Returns mail header color
   * @return string
   */
  public function getMailHeaderColor() {
    return '#745bca';
  }

}
