[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/administrator/components/com_languages/tmpl/multilangstatus/ -> default.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Administrator
   5   * @subpackage  com_languages
   6   *
   7   * @copyright   (C) 2011 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Language\Text;
  14  
  15  $notice_disabled  = !$this->language_filter && ($this->homes > 1 || $this->switchers != 0);
  16  $notice_switchers = !$this->switchers && ($this->homes > 1 || $this->language_filter);
  17  
  18  // Defining arrays
  19  $content_languages = array_column($this->contentlangs, 'lang_code');
  20  $sitelangs         = array_column($this->site_langs, 'element');
  21  $home_pages        = array_column($this->homepages, 'language');
  22  ?>
  23  <div class="mod-multilangstatus">
  24      <?php if (!$this->language_filter && $this->switchers == 0) : ?>
  25          <?php if ($this->homes == 1) : ?>
  26              <div class="alert alert-info">
  27                  <span class="icon-info-circle" aria-hidden="true"></span>
  28                  <span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  29                  <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_NONE'); ?>
  30              </div>
  31          <?php else : ?>
  32              <div class="alert alert-info">
  33                  <span class="icon-info-circle" aria-hidden="true"></span>
  34                  <span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>
  35                  <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_USELESS_HOMES'); ?>
  36              </div>
  37          <?php endif; ?>
  38      <?php else : ?>
  39          <?php if (!in_array($this->default_lang, $content_languages)) : ?>
  40              <div class="alert alert-error">
  41                  <span class="icon-exclamation" aria-hidden="true"></span>
  42                  <span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
  43                  <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_DEFAULT_CONTENT_LANGUAGE', $this->default_lang); ?>
  44              </div>
  45          <?php else : ?>
  46              <?php foreach ($this->contentlangs as $contentlang) : ?>
  47                  <?php if ($contentlang->lang_code == $this->default_lang && $contentlang->published != 1) : ?>
  48                      <div class="alert alert-error">
  49                          <span class="icon-exclamation" aria-hidden="true"></span>
  50                          <span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
  51                          <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_DEFAULT_CONTENT_LANGUAGE', $this->default_lang); ?>
  52                      </div>
  53                  <?php endif; ?>
  54              <?php endforeach; ?>
  55          <?php endif; ?>
  56          <?php if ($this->defaultHome == true) : ?>
  57              <div class="alert alert-warning">
  58                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
  59                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
  60                  <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_DEFAULT_HOME_MODULE_PUBLISHED'); ?>
  61              </div>
  62          <?php endif; ?>
  63          <?php foreach ($this->statuses as $status) : ?>
  64              <?php // Displays error when Site language and Content language are published but Home page is unpublished, trashed or missing. ?>
  65              <?php if ($status->lang_code && $status->published == 1 && $status->home_published != 1) : ?>
  66                  <div class="alert alert-warning">
  67                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
  68                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
  69                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_HOME_UNPUBLISHED', $status->lang_code, $status->lang_code); ?>
  70                  </div>
  71              <?php endif; ?>
  72              <?php // Displays error when both Content Language and Home page are unpublished. ?>
  73              <?php if ($status->lang_code && $status->published == 0 && $status->home_published != 1) : ?>
  74                  <div class="alert alert-warning">
  75                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
  76                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
  77                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_HOME_UNPUBLISHED', $status->lang_code, $status->lang_code); ?>
  78                  </div>
  79              <?php endif; ?>
  80          <?php endforeach; ?>
  81          <?php if ($notice_disabled) : ?>
  82              <div class="alert alert-warning">
  83                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
  84                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
  85                  <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER_DISABLED'); ?>
  86              </div>
  87          <?php endif; ?>
  88          <?php if ($notice_switchers) : ?>
  89              <div class="alert alert-warning">
  90                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
  91                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
  92                  <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_UNPUBLISHED'); ?>
  93              </div>
  94          <?php endif; ?>
  95          <?php foreach ($this->contentlangs as $contentlang) : ?>
  96              <?php if (array_key_exists($contentlang->lang_code, $this->homepages) && (!array_key_exists($contentlang->lang_code, $this->site_langs) || $contentlang->published != 1)) : ?>
  97                  <div class="alert alert-warning">
  98                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
  99                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 100                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_CONTENT_LANGUAGE', $contentlang->lang_code); ?>
 101                  </div>
 102              <?php endif; ?>
 103              <?php if (!array_key_exists($contentlang->lang_code, $this->site_langs)) : ?>
 104                  <div class="alert alert-warning">
 105                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 106                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 107                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_ERROR_LANGUAGE_TAG', $contentlang->lang_code); ?>
 108                  </div>
 109              <?php endif; ?>
 110              <?php if ($contentlang->published == -2) : ?>
 111                  <div class="alert alert-warning">
 112                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 113                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 114                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_TRASHED', $contentlang->lang_code); ?>
 115                  </div>
 116              <?php endif; ?>
 117              <?php if (empty($contentlang->sef)) : ?>
 118                  <div class="alert alert-error">
 119                      <span class="icon-exclamation" aria-hidden="true"></span>
 120                      <span class="visually-hidden"><?php echo Text::_('ERROR'); ?></span>
 121                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_SEF_MISSING', $contentlang->lang_code); ?>
 122                  </div>
 123              <?php endif; ?>
 124          <?php endforeach; ?>
 125          <?php if ($this->listUsersError) : ?>
 126              <div class="alert alert-warning">
 127                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 128                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 129                  <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR_TIP'); ?>
 130                  <ul>
 131                  <?php foreach ($this->listUsersError as $user) : ?>
 132                      <li>
 133                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTACTS_ERROR', $user->name); ?>
 134                      </li>
 135                  <?php endforeach; ?>
 136                  </ul>
 137              </div>
 138          <?php endif; ?>
 139          <?php // Displays error when the Content Language has been deleted ?>
 140          <?php foreach ($sitelangs as $sitelang) : ?>
 141              <?php if (!in_array($sitelang, $content_languages) && in_array($sitelang, $home_pages)) : ?>
 142                  <div class="alert alert-warning">
 143                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 144                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 145                      <?php echo Text::sprintf('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_MISSING', $sitelang); ?>
 146                  </div>
 147              <?php endif; ?>
 148          <?php endforeach; ?>
 149          <table class="table table-sm">
 150              <caption class="visually-hidden"><?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_TABLE_CAPTION'); ?></caption>
 151              <thead>
 152                  <tr>
 153                      <th scope="col">
 154                          <?php echo Text::_('JDETAILS'); ?>
 155                      </th>
 156                      <th class="text-center" scope="col">
 157                          <?php echo Text::_('JSTATUS'); ?>
 158                      </th>
 159                  </tr>
 160              </thead>
 161              <tbody>
 162                  <tr>
 163                      <th scope="row">
 164                          <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGUAGEFILTER'); ?>
 165                      </th>
 166                      <td class="text-center">
 167                          <?php if ($this->language_filter) : ?>
 168                              <?php echo Text::_('JENABLED'); ?>
 169                          <?php else : ?>
 170                              <?php echo Text::_('JDISABLED'); ?>
 171                          <?php endif; ?>
 172                      </td>
 173                  </tr>
 174  
 175                  <tr>
 176                      <th scope="row">
 177                          <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_LANGSWITCHER_PUBLISHED'); ?>
 178                      </th>
 179                      <td class="text-center">
 180                          <?php if ($this->switchers != 0) : ?>
 181                              <?php echo $this->switchers; ?>
 182                          <?php else : ?>
 183                              <?php echo Text::_('JNONE'); ?>
 184                          <?php endif; ?>
 185                      </td>
 186                  </tr>
 187                  <tr>
 188                      <th scope="row">
 189                          <?php if ($this->homes > 1) : ?>
 190                              <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_INCLUDING_ALL'); ?>
 191                          <?php else : ?>
 192                              <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED'); ?>
 193                          <?php endif; ?>
 194                      </th>
 195                      <td class="text-center">
 196                          <?php if ($this->homes > 1) : ?>
 197                              <?php echo $this->homes; ?>
 198                          <?php else : ?>
 199                              <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED_ALL'); ?>
 200                          <?php endif; ?>
 201                      </td>
 202                  </tr>
 203              </tbody>
 204          </table>
 205          <table class="table table-sm">
 206              <caption class="visually-hidden"><?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_TABLE_CAPTION'); ?></caption>
 207              <thead>
 208                  <tr>
 209                      <th scope="col">
 210                          <?php echo Text::_('JGRID_HEADING_LANGUAGE'); ?>
 211                      </th>
 212                      <th class="text-center" scope="col">
 213                          <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_SITE_LANG_PUBLISHED'); ?>
 214                      </th>
 215                      <th class="text-center" scope="col">
 216                          <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_CONTENT_LANGUAGE_PUBLISHED'); ?>
 217                      </th>
 218                      <th class="text-center" scope="col">
 219                          <?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_HOMES_PUBLISHED'); ?>
 220                      </th>
 221                  </tr>
 222              </thead>
 223              <tbody>
 224                  <?php foreach ($this->statuses as $status) : ?>
 225                      <?php if ($status->element) : ?>
 226                          <tr>
 227                              <th scope="row">
 228                                  <?php echo $status->element; ?>
 229                              </th>
 230                      <?php endif; ?>
 231                      <?php // Published Site languages ?>
 232                      <?php if ($status->element) : ?>
 233                              <td class="text-center">
 234                                  <span class="text-success icon-check" aria-hidden="true"></span>
 235                                  <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 236                              </td>
 237                      <?php else : ?>
 238                              <td class="text-center">
 239                                  <?php echo Text::_('JNO'); ?>
 240                              </td>
 241                      <?php endif; ?>
 242                      <?php // Published Content languages ?>
 243                          <td class="text-center">
 244                              <?php if ($status->lang_code && $status->published == 1) : ?>
 245                                  <span class="text-success icon-check" aria-hidden="true"></span>
 246                                  <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 247                              <?php elseif ($status->lang_code && $status->published == 0) : ?>
 248                                  <span class="text-danger icon-times" aria-hidden="true"></span>
 249                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 250                              <?php elseif ($status->lang_code && $status->published == -2) : ?>
 251                                  <span class="icon-trash" aria-hidden="true"></span>
 252                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 253                              <?php else : ?>
 254                                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 255                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 256                              <?php endif; ?>
 257                          </td>
 258                      <?php // Published Home pages ?>
 259                          <td class="text-center">
 260                              <?php if ($status->home_published == 1) : ?>
 261                                  <span class="text-success icon-check" aria-hidden="true"></span>
 262                                  <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 263                              <?php elseif ($status->home_published == 0) : ?>
 264                                  <span class="text-danger icon-times" aria-hidden="true"></span>
 265                                  <span class="visually-hidden"><?php echo Text::_('JNO'); ?></span>
 266                              <?php elseif ($status->home_published == -2) : ?>
 267                                  <span class="icon-trash" aria-hidden="true"></span>
 268                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 269                              <?php else : ?>
 270                                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 271                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 272                              <?php endif; ?>
 273                          </td>
 274                      </tr>
 275                  <?php endforeach; ?>
 276                  <?php foreach ($this->contentlangs as $contentlang) : ?>
 277                      <?php if (!array_key_exists($contentlang->lang_code, $this->site_langs)) : ?>
 278                          <tr>
 279                              <th scope="row">
 280                                  <?php echo $contentlang->lang_code; ?>
 281                              </th>
 282                              <td class="text-center">
 283                                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 284                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 285                              </td>
 286                              <td class="text-center">
 287                                  <?php if ($contentlang->published == 1) : ?>
 288                                      <span class="text-success icon-check" aria-hidden="true"></span>
 289                                      <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 290                                  <?php elseif ($contentlang->published == 0 && array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
 291                                      <span class="text-danger icon-times" aria-hidden="true"></span>
 292                                      <span class="visually-hidden"><?php echo Text::_('JNO'); ?></span>
 293                                  <?php elseif ($contentlang->published == -2 && array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
 294                                      <span class="icon-trash" aria-hidden="true"></span>
 295                                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 296                                  <?php endif; ?>
 297                              </td>
 298                              <td class="text-center">
 299                                  <?php if (!array_key_exists($contentlang->lang_code, $this->homepages)) : ?>
 300                                      <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 301                                      <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 302                                  <?php else : ?>
 303                                      <span class="text-success icon-check" aria-hidden="true"></span>
 304                                      <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 305                                  <?php endif; ?>
 306                              </td>
 307                          </tr>
 308                      <?php endif; ?>
 309                  <?php endforeach; ?>
 310                  <?php // Display error when the Content Language has been deleted ?>
 311                  <?php foreach ($sitelangs as $sitelang) : ?>
 312                      <?php if (!in_array($sitelang, $content_languages) && in_array($sitelang, $home_pages)) : ?>
 313                          <tr>
 314                              <th scope="row">
 315                                  <?php echo $sitelang; ?>
 316                              </th>
 317                              <td class="text-center">
 318                                  <span class="text-success icon-check" aria-hidden="true"></span>
 319                                  <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 320                              </td>
 321                              <td class="text-center">
 322                                  <span class="icon-exclamation-triangle" aria-hidden="true"></span>
 323                                  <span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
 324                              </td>
 325                              <td class="text-center">
 326                                  <span class="text-success icon-check" aria-hidden="true"></span>
 327                                  <span class="visually-hidden"><?php echo Text::_('JYES'); ?></span>
 328                              </td>
 329                          </tr>
 330                      <?php endif; ?>
 331                  <?php endforeach; ?>
 332              </tbody>
 333          </table>
 334      <?php endif; ?>
 335  </div>


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer