This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

How can I remove built-in themes and change the default theme?


  1. williamansley
    Member

    I finally have Machform 3.3 installed in a test environment and am trying it out. While the theme creating/editing features are nice, I *don't want* our users to be able to assign arbitrary themes to the forms they create and I would like to make a form other than White the default. Or I would like to be able to edit the "White (default)" theme, but I don't see how to to that, since I can't select it from the drop-down menu in the theme editor. Is this possible. I suspect that the "White (default)" theme is what is contained in the "view.css" file in the root of the Machform directory, but I haven't tested this yet. If this is true, then I could change the "White (default)" theme by editing that file directly.

    I would also like to know if it is possible to remove the built-in themes from Machform or prevent my users from selecting any of them. In other words, I want to lock down the themes so my users have to use the theme that has been created to match the college web site "look and feel."

    Posted 11 years ago #
  2. yuniar

    The default theme is pulling the code from the view.css which is located in the root of machform directory indeed. You can edit that file directly.

    To remove the built-in themes, you can edit "manage_forms.php" file, search around line 271 for this code:

    while($row = mf_do_fetch_result($sth)){
    	$theme_builtin_list_array[$row['theme_id']] = htmlspecialchars($row['theme_name']);
    }

    simply remove the above block of code.


    MachForm Founder

    Posted 11 years ago #
  3. williamansley
    Member

    Thank you for your prompt reply. Your solution to remove the built-in form list from the drop down menu works fine.

    Posted 11 years ago #
  4. danielmee
    Member

    I was also looking for theme adjustments. I have removed the Built in themes but the default 'white' is still there (also, it doesn't seem to remove them from the listing in the theme editor but I worked out to comment out the listing in line 1060 of edit_theme.php).
    Much like williamansley I too am wanting to restrict theme selections to only what I add. Where are the files for each theme? Can I use the default white as a base to create my own themes? Can I edit the HTML of a theme?

    Posted 10 years ago #
  5. williamansley
    Member

    @danielmee: As a Machform administrator, you can see all the themes, but non-admin non-theme-editor users can only see the themes you make available to them by using the "Share This Theme" option from the drop down menu next to the "Save Theme" button. However, if you have any users to whom you have granted the right to edit themes, you are correct; they will still see the built-in themes. If you are never going to grant the right to edit themes to any non-admin users, however, commenting out the code that shows the built-in themes isn't necessary.

    As yuniar says above, the default "White" theme is controlled by the view.css which is located in the root of the "/machform" directory, so you can edit that to control the default theme's appearance, although it will still have the same name, unless you customize the code. The themes are controlled entirely by CSS, so there is no html to edit. Machform generates all of the html for its forms on the fly from the information in the database for each form, so there is really no way to edit the html of a form at all.

    Posted 10 years ago #
  6. vu-webcomm
    Member

    Is there a way to make this configurable via an option in the Settings? As easy as it is to edit that file, some environments don't necessarily allow or want to always have to make manual modifications.

    Posted 10 years ago #

RSS feed for this topic

Reply