当前位置: 首页>>代码示例>>PHP>>正文


PHP PhocaGalleryFile::getCSSPath方法代码示例

本文整理汇总了PHP中PhocaGalleryFile::getCSSPath方法的典型用法代码示例。如果您正苦于以下问题:PHP PhocaGalleryFile::getCSSPath方法的具体用法?PHP PhocaGalleryFile::getCSSPath怎么用?PHP PhocaGalleryFile::getCSSPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhocaGalleryFile的用法示例。


在下文中一共展示了PhocaGalleryFile::getCSSPath方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: save

 public function save($data)
 {
     jimport('joomla.filesystem.file');
     // New
     if ($data['id'] < 1) {
         $data['type'] = 2;
         // Custom in every case
         if ($data['title'] != '') {
             $filename = JApplication::stringURLSafe($data['title']);
             if (trim(str_replace('-', '', $filename)) == '') {
                 $filename = JFactory::getDate()->format("Y-m-d-H-i-s");
             }
         } else {
             $filename = JFactory::getDate()->format("Y-m-d-H-i-s");
         }
         $filename = $filename . '.css';
         $data['filename'] = $filename;
         $filePath = PhocaGalleryFile::existsCSS($filename, $data['type']);
         if ($filePath) {
             $this->setError(JText::sprintf('COM_PHOCAGALLERY_FILE_ALREADY_EXISTS', $fileName));
             return false;
         } else {
             $filePath = PhocaGalleryFile::getCSSPath($data['type']) . $filename;
         }
     } else {
         $filename = PhocaGalleryFile::getCSSFile($data['id']);
         $filePath = PhocaGalleryFile::existsCSS($filename, $data['type']);
     }
     //$dispatcher = JEventDispatcher::getInstance();
     $fileName = $filename;
     // Include the extension plugins for the save events.
     //JPluginHelper::importPlugin('extension');
     // Set FTP credentials, if given.
     JClientHelper::setCredentialsFromRequest('ftp');
     $ftp = JClientHelper::getCredentials('ftp');
     // Try to make the template file writeable.
     if (!$ftp['enabled'] && JPath::isOwner($filePath) && !JPath::setPermissions($filePath, '0644')) {
         $this->setError(JText::_('COM_PHOCAGALLERY_ERROR_SOURCE_FILE_NOT_WRITABLE'));
         return false;
     }
     // Trigger the onExtensionBeforeSave event.
     /*$result = $dispatcher->trigger('onExtensionBeforeSave', array('com_phocagallery.source', &$data, false));
     		if (in_array(false, $result, true)) {
     			$this->setError($table->getError());
     			return false;
     		}*/
     $return = JFile::write($filePath, $data['source']);
     // Try to make the template file unwriteable.
     if (!$ftp['enabled'] && JPath::isOwner($filePath) && !JPath::setPermissions($filePath, '0444')) {
         $this->setError(JText::_('COM_PHOCAGALLERY_ERROR_SOURCE_FILE_NOT_UNWRITABLE'));
         return false;
     } elseif (!$return) {
         $this->setError(JText::sprintf('COM_PHOCAGALLERY_ERROR_FAILED_TO_SAVE_FILENAME', $fileName));
         return false;
     }
     // Trigger the onExtensionAfterSave event.
     //$dispatcher->trigger('onExtensionAfterSave', array('com_templates.source', &$table, false));
     //return true;
     return parent::save($data);
 }
开发者ID:naka211,项目名称:malerfirmaet,代码行数:60,代码来源:phocagalleryef.php

示例2: renderAllCSS

 public static function renderAllCSS($noBootStrap = 0)
 {
     $app = JFactory::getApplication();
     $itemid = $app->input->get('Itemid', 0, 'int');
     $db = JFactory::getDBO();
     $query = 'SELECT a.filename as filename, a.type as type, a.menulink as menulink' . ' FROM #__phocagallery_styles AS a' . ' WHERE a.published = 1' . ' ORDER BY a.type, a.ordering ASC';
     $db->setQuery($query);
     $filenames = $db->loadObjectList();
     if (!empty($filenames)) {
         foreach ($filenames as $fk => $fv) {
             if ($noBootStrap == 1) {
                 $pos = strpos($fv->filename, 'bootstrap');
                 if ($pos === false) {
                 } else {
                     continue;
                 }
             }
             $path = PhocaGalleryFile::getCSSPath($fv->type, 1);
             if ($fv->menulink != '') {
                 $menuLinks = explode(',', $fv->menulink);
                 $isIncluded = in_array((int) $itemid, $menuLinks);
                 if ($isIncluded) {
                     JHtml::stylesheet($path . $fv->filename);
                 }
             } else {
                 JHtml::stylesheet($path . $fv->filename);
             }
         }
     }
 }
开发者ID:01J,项目名称:skazkipronebo,代码行数:30,代码来源:renderfront.php


注:本文中的PhocaGalleryFile::getCSSPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。