Profile Customiser Themes

I have been working with the theme part of the Profile Customiser module because some of my members have expressed the desire to create themes they could share with other members.  What I learned is that members can only publish themes to "My Themes" and Admins could only publish themes to "Shared Themes"; this was hardwired into the code.  Interesting thought process there and I can see the benefit to perhaps not wanting members to be able to share themes they created since they could create "adult" type themes on a non-adult site.  However, I am not really concerned with that.  So I hacked the Profile Customiser and added a set of radio buttons so that anyone, regular members or Admins, could choose where to publish a theme.  Shared themes have an ID of zero; there are no members with ID of zero, while "My Themes" themes will have the ID of the member that owns the theme.

What I have also found out is that the backend/admin part of the theme thingy does not seem to be responding.  I tried on both test sites; and only one test site had my modified theme publisher, and I could not delete themes from the backend.  Also, the import/export feature does not seem to work.  By the way, exporting or importing a theme involves a zip package that contains the images used in the theme as well as the css code.  I will work on the backend at a later date to see why it appears to not be functioning for me.  Is it working for anyone else?

By the way, I tested the theme part on 7.0.9 and the backend is the same, I could not delete a theme from the backend and the 7.0.9 site has not been modified either.  I wonder how long this has not worked, if it is not working for others, and why this had not been addressed before now?  I was told that any work on this would most likely be pushed to 7.2 or 7.3.  I don't want to wait that long so maybe I can figure out the backend part; at least the backend delete part.  Oh, a member can delete themes from "My Themes" through the frontend of the Profile Customiser.

Geeks, making the world a better place
Quote · 8 May 2013

On the export and delete buttons issue:

Looking at the code in BxProfileCustomizeTemplate.php I see this function:

    function getAdminPageThemes($sType)
    {
        $sPageThemes = $this->_customPageThemes(0);
        if ($sPageThemes) {
            $sFormName = 'custom_themes_form';
            $aButtons = array(
                'action_theme_export' => '_bx_profile_customize_btn_export',
                'action_theme_delete' => '_bx_profile_customize_btn_delete'
            );

            $sContent = $this->parseHtmlByName('admin_form_units.html', array(
                'form_name' => $sFormName,
                'action' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'administration/' . $sType,
                'units' => $sPageThemes,
                'actions_panel' => BxTemplSearchResult::showAdminActionsPanel($sFormName, $aButtons, 'entry', false),
            ));
        } else
            $sContent = MsgBox(_t('_Empty'));

        return $sContent;
    }

We have two buttons, action_theme_export and action_theme_delete.  If we choose a theme to delete and click on action_theme_delete, it should be processed by the function in BxProfileCustomiseModule.php by the following function if I understand this correctly:

    function _checkActions()
    {
        $sResult = '';
        $sFileImport = 'theme_file';

        if ($_POST['theme']) {
            if ($_POST['action_theme_export'])
                $this->_exportTheme($_POST['theme']);

            if ($_POST['action_theme_delete'])
                $sResult = $this->_deleteTheme($_POST['theme']);
        } else if (isset($_FILES[$sFileImport]) && is_uploaded_file($_FILES[$sFileImport]['tmp_name'])) {
            $sResult = $this->_importTheme($sFileImport);
            unlink($_FILES[$sFileImport]['tmp_name']);
        }

        return $sResult;
    }

The current action if one clicks on export or delete is nothing happens.  Any help with this will be appreciated.

Geeks, making the world a better place
Quote · 8 May 2013

I was kinda hoping that Alex or Anton would take a look-see at this.

I may put some checks in to see if it is passing the button along.

Geeks, making the world a better place
Quote · 9 May 2013

Anyone looked at this to see why the delete and export don't work in the admin?  I have the save theme part solved; where a member can decided to save in "My Themes" or "Shared Themes" but need to be able to delete shared themes from the admin.

Geeks, making the world a better place
Quote · 20 May 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.